Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Merge development into master branch #96

Merged
merged 5 commits into from
Dec 14, 2018
Merged

Merge development into master branch #96

merged 5 commits into from
Dec 14, 2018

Conversation

ghost
Copy link

@ghost ghost commented Dec 13, 2018

2.1.14.2 update

@@ -350,7 +352,10 @@ public boolean accept(INetworkComponent networkComponent)

public NetworkManager sendAll(Packet packet, ChannelFilter filter)
{
this.executorService.submit(() -> {
TaskScheduler.runtimeScheduler().schedule(new Runnable() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this anonymous inner class a lambda (sonar.java.source not set. Assuming 8 or greater.)

@@ -62,7 +62,7 @@ public void appendScreenData(Collection<ScreenInfo> screenInfos)
{
this.screenInfos.getS(key).addAll(screenInfos);

while (this.screenInfos.getS(key).size() > 64)
while (this.screenInfos.getS(key).size() >= 64)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid deeply nested control flow statements.

{
if (text == null) return;

while (cachedLogMessages.size() >= 64)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'while' construct must use '{}'s.

@@ -67,7 +67,8 @@ public boolean tryConnect(boolean ssl, SimpleChannelInboundHandler<Packet> defau
{
try
{
if (ssl) sslContext = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build();
if (ssl)
sslContext = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is longer than 100 characters (found 118).


InputStream inputStream = server.getInstance().getInputStream();
private synchronized void readStream(AbstractScreenService screenService, InputStream inputStream)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is longer than 100 characters (found 102).

…ent/org.apache.maven.plugins-maven-jar-plugin-3.1.1

Bump maven-jar-plugin from 3.1.0 to 3.1.1

InputStream inputStream = server.getInstance().getInputStream();
private synchronized void readStream(AbstractScreenService screenService, InputStream inputStream)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method readStream has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.

@@ -67,7 +67,8 @@ public boolean tryConnect(boolean ssl, SimpleChannelInboundHandler<Packet> defau
{
try
{
if (ssl) sslContext = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build();
if (ssl)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'if' construct must use '{}'s.

stringBuffer.append(new String(buffer, 0, len, StandardCharsets.UTF_8));

String stringText = stringBuffer.toString();
if (!stringText.contains("\n") && !stringText.contains("\r")) return;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'if' construct must use '{}'s.


while (inputStream.available() > 0 && (len = inputStream.read(buffer, 0, buffer.length)) != -1)
stringBuffer.append(new String(buffer, 0, len, StandardCharsets.UTF_8));
for (String input : stringText.split("\r"))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'for' construct must use '{}'s.

stringBuffer.append(new String(buffer, 0, len, StandardCharsets.UTF_8));
for (String input : stringText.split("\r"))
for (String text : input.split("\n"))
if (!text.trim().isEmpty())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'if' construct must use '{}'s.

@codeclimate
Copy link

codeclimate bot commented Dec 14, 2018

Code Climate has analyzed commit 1af764e and detected 34 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3
Duplication 2
Style 26
Bug Risk 2
Clarity 1

View more on Code Climate.

@byRoadrunner byRoadrunner merged commit 74d5490 into master Dec 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants