fujaba/NetworkParser

View on GitHub

Showing 4,645 of 4,645 total issues

These nested if statements could be combined
Open

            if (value.equalsIgnoreCase(this.getValue())) {
                return this;
            }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

                if (this.banks.remove(item)) {
                    item.setRiver(null);
                    getPropertyChangeSupport().firePropertyChange(PROPERTY_BANKS, item, null);
                }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

Do not hard code the IP address
Open

    public static final String LOCALHOST = "127.0.0.1";

AvoidUsingHardCodedIP

Since: PMD 4.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Application with hard-coded IP addresses can become impossible to deploy in some cases. Externalizing IP adresses is preferable.

Example:

public class Foo {
 private String ip = '127.0.0.1'; // not recommended
}

Avoid using a branching statement as the last in a loop.
Open

            return feature;

AvoidBranchingStatementAsLastInLoop

Since: PMD 5.0

Priority: Medium High

Categories: Style

Remediation Points: 50000

Using a branching statement as the last part of a loop may be a bug, and/or is confusing. Ensure that the usage is not a bug, or consider using another approach.

Example:

// unusual use of branching statement in a loop
for (int i = 0; i < 10; i++) {
 if (i*i <= 25) {
 continue;
 }
 break;
}

// this makes more sense...
for (int i = 0; i < 10; i++) {
 if (i*i > 25) {
 break;
 }
}

These nested if statements could be combined
Open

      if ("size".equalsIgnoreCase(keyString)) {
        return this.size();
      }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

            if (value.equalsIgnoreCase(this.getTag())) {
                return this;
            }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

                if (this.home.remove(item)) {
                    item.withPlayer(null);
                }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

                if (this.banks.remove(item)) {
                    item.setRiver(null);
                    getPropertyChangeSupport().firePropertyChange(PROPERTY_BANKS, item, null);
                }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

            if (SUCCEEDED.equals("" + event.getNewValue())) {
                /* FINISH */
                this.loadFinish();
                return true;
            }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

            if (ReflectionLoader.INVALIDATIONLISTENER.isAssignableFrom(listener.getClass())) {
                invalidationListeners.remove(listener);
            }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

                if (this.children instanceof Annotation) {
                    ((Annotation) this.children).setParentNode(null);
                    this.children = null;
                }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

            if (code != null) {
                String codeString = code.toString();
                if (codeString != null && codeString.length() > 0) {
                    return code.toString();
                }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

Avoid using a branching statement as the last in a loop.
Open

                break;

AvoidBranchingStatementAsLastInLoop

Since: PMD 5.0

Priority: Medium High

Categories: Style

Remediation Points: 50000

Using a branching statement as the last part of a loop may be a bug, and/or is confusing. Ensure that the usage is not a bug, or consider using another approach.

Example:

// unusual use of branching statement in a loop
for (int i = 0; i < 10; i++) {
 if (i*i <= 25) {
 continue;
 }
 break;
}

// this makes more sense...
for (int i = 0; i < 10; i++) {
 if (i*i > 25) {
 break;
 }
}

These nested if statements could be combined
Open

            if (sourceMethod.getClazz().getName().equals(otherMethod.getClazz().getName())) {
                return false;
            }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

                if (association.getType().equals(AssociationTypes.ASSOCIATION) == false) {
                    return false;
                }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

                if (((GraphModel) entity).getClazzes().size() < 1) {
                    return null;
                }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

            if (features.match(Feature.SETCLASS, null) == false) {
                return null;
            }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

                if (value.indexOf('.') > 0) {
                    value.set(item.getValue());
                    return true;
                }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

                    if (((XMLEntity) item).getTag() == null) {
                        show = true;
                        break;
                    }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}

These nested if statements could be combined
Open

                if (this.meeple.remove(item)) {
                    item.withPlayer(null);
                }

CollapsibleIfStatements

Since: PMD 3.1

Priority: Medium

Categories: Style

Remediation Points: 50000

Sometimes two consecutive 'if' statements can be consolidated by separating their conditions with a boolean short-circuit operator.

Example:

void bar() {
 if (x) { // original implementation
 if (y) {
 // do stuff
 }
 }
}

void bar() {
 if (x && y) { // optimized implementation
 // do stuff
 }
}
Severity
Category
Status
Source
Language