egordorichev/LastTry

View on GitHub

Showing 205 of 205 total issues

These nested if statements could be combined
Open

                        if (this.velocity.y != -0.4f) {
                            this.onGroundHit.call();
                        }

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 (rightLiquidLevel < 15) { // FIXME: fit 16 somewhere?
                    liquidLevel -= 1;

                    if (liquidLevel < 0) {
                        liquidLevel = 0;

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 (historyIndex < history.size() - 1) {
                        historyIndex += 1;
                        text = history.get(historyIndex);
                        System.out.println(text);
                        cursorX = text.length();

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 (item.canBeUsed(x, y) && item.use(x, y)) {
                        int count = holder.getCount();

                        if (count == 1) {
                            slots[activeSlot].setItemHolder(new ItemHolder(null, 0));

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 (leftLiquidLevel < 15) { // FIXME: fit 16 somewhere?
                    liquidLevel -= 1;
                    hp = BlockHelper.empty.setLiquidLevel(hp, liquidLevel);
                    Globals.getWorld().blocks.setHP(hp, x, y);
                    leftLiquidLevel += 1;

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