-
Notifications
You must be signed in to change notification settings - Fork 33
Conversation
…Tsunami screen system
…Tsunami screen system
Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](apache/maven-jar-plugin@maven-jar-plugin-3.1.0...maven-jar-plugin-3.1.1) Signed-off-by: dependabot[bot] <[email protected]>
@@ -350,7 +352,10 @@ public boolean accept(INetworkComponent networkComponent) | |||
|
|||
public NetworkManager sendAll(Packet packet, ChannelFilter filter) | |||
{ | |||
this.executorService.submit(() -> { | |||
TaskScheduler.runtimeScheduler().schedule(new Runnable() { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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")) |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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.
Code Climate has analyzed commit 1af764e and detected 34 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
2.1.14.2 update