tomokinakamaru/silverchain

View on GitHub
src/main/java/silverchain/parser/Type.java

Summary

Maintainability
A
0 mins
Test Coverage

Merge this if statement with the enclosing one.
Open

      if (importMap.containsKey(name().name())) {

Merging collapsible if statements increases the code's readability.

Noncompliant Code Example

if (file != null) {
  if (file.isFile() || file.isDirectory()) {
    /* ... */
  }
}

Compliant Solution

if (file != null && isFileOrDirectory(file)) {
  /* ... */
}

private static boolean isFileOrDirectory(File file) {
  return file.isFile() || file.isDirectory();
}

These nested if statements could be combined
Open

      if (importMap.containsKey(name().name())) {
        left = importMap.get(name().name());
      }

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
 }
}

There are no issues that match your filters.

Category
Status