ursinn/MinecraftServer

View on GitHub
src/main/java/com/github/joshj1091/mcserver/bootstrap/Bootstrap.java

Summary

Maintainability
A
0 mins
Test Coverage

Remove this expression which always evaluates to "true"
Open

        while (scanner.hasNext() && run) {

If a boolean expression doesn't change the evaluation of the condition, then it is entirely unnecessary, and can be removed. If it is gratuitous because it does not match the programmer's intent, then it's a bug and the expression should be fixed.

Noncompliant Code Example

a = true;
if (a) { // Noncompliant
  doSomething();
}

if (b && a) { // Noncompliant; "a" is always "true"
  doSomething();
}

if (c || !a) { // Noncompliant; "!a" is always "false"
  doSomething();
}

Compliant Solution

a = true;
if (foo(a)) {
  doSomething();
}

if (b) {
  doSomething();
}

if (c) {
  doSomething();
}

See

There are no issues that match your filters.

Category
Status