fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/parser/GraphMatcher.java

Summary

Maintainability
F
1 wk
Test Coverage

File GraphMatcher.java has 700 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.parser;

import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Severity: Major
Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 day to fix

    Method matchClazzValues has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
    Open

        private boolean matchClazzValues(Clazz oldClazz, Clazz newClazz) {
            if (oldClazz.getName().equals(newClazz.getName()) == false) {
                return false;
            }
    
    
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method matchClazzes has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        public boolean matchClazzes() {
            if (oldModel == null || newModel == null) {
                return oldModel == newModel;
            }
            ClazzSet oldClazzes = oldModel.getClazzes();
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method matchAssociations has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        private boolean matchAssociations(Clazz oldClazz, Clazz newClazz) {
            AssociationSet oldAssociations = oldClazz.getAssociations();
            AssociationSet newAssociations = newClazz.getAssociations();
    
            AssociationSet oldMatches = new AssociationSet();
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method matchMethodValues has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

        private boolean matchMethodValues(Method oldMethod, Method newMethod) {
            if (oldMethod.getName().equals(newMethod.getName()) == false) {
                return false;
            }
            if (oldMethod.getModifier().toString().equals(newMethod.getModifier().toString()) == false) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    GraphMatcher has 32 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class GraphMatcher extends GraphEntity {
        private SimpleList<Match> clazzMatches = new SimpleList<Match>();
    
        private SimpleList<Match> attributeMatches = new SimpleList<Match>();
    
    
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 4 hrs to fix

      Method matchClazzValues has 97 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private boolean matchClazzValues(Clazz oldClazz, Clazz newClazz) {
              if (oldClazz.getName().equals(newClazz.getName()) == false) {
                  return false;
              }
      
      
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 3 hrs to fix

        Method matchMethods has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            private boolean matchMethods(Clazz oldClazz, Clazz newClazz) {
                if (oldClazz == null || newClazz == null) {
                    return oldClazz == newClazz;
                }
                MethodSet oldMethods = oldClazz.getMethods();
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method matchAttributes has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            private boolean matchAttributes(Clazz oldClazz, Clazz newClazz) {
                if (oldClazz == null || newClazz == null) {
                    return false;
                }
                AttributeSet oldAttributes = oldClazz.getAttributes();
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method preparePotentMatches has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            private SimpleKeyValueList<Double, SimpleList<Match>> preparePotentMatches(
                    SimpleSet<? extends GraphMember> oldMembers, SimpleSet<? extends GraphMember> newMembers,
                    SimpleSet<? extends GraphMember> oldMatches, SimpleSet<? extends GraphMember> newMatches) {
                SimpleKeyValueList<Double, SimpleList<Match>> potentMatches = new SimpleKeyValueList<Double, SimpleList<Match>>()
                        .withComparator(EntityComparator.createComparator());
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method matchClazzes has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public boolean matchClazzes() {
                if (oldModel == null || newModel == null) {
                    return oldModel == newModel;
                }
                ClazzSet oldClazzes = oldModel.getClazzes();
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 2 hrs to fix

          Method matchAssociationValues has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

              private boolean matchAssociationValues(Association oldAssociation, Association newAssociation) {
                  if (oldAssociation == null || newAssociation == null) {
                      return false;
                  }
                  if (oldAssociation.getName().equals(newAssociation.getName()) == false) {
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method matchAssociations has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private boolean matchAssociations(Clazz oldClazz, Clazz newClazz) {
                  AssociationSet oldAssociations = oldClazz.getAssociations();
                  AssociationSet newAssociations = newClazz.getAssociations();
          
                  AssociationSet oldMatches = new AssociationSet();
          Severity: Major
          Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 2 hrs to fix

            Method matchMethodValues has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private boolean matchMethodValues(Method oldMethod, Method newMethod) {
                    if (oldMethod.getName().equals(newMethod.getName()) == false) {
                        return false;
                    }
                    if (oldMethod.getModifier().toString().equals(newMethod.getModifier().toString()) == false) {
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 hr to fix

              Method createMatches has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  public boolean createMatches() {
                      matchClazzes();
              
                      ClazzSet newMatches = new ClazzSet();
              
              
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method matchAttributes has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private boolean matchAttributes(Clazz oldClazz, Clazz newClazz) {
                      if (oldClazz == null || newClazz == null) {
                          return false;
                      }
                      AttributeSet oldAttributes = oldClazz.getAttributes();
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 hr to fix

                Method matchMethods has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private boolean matchMethods(Clazz oldClazz, Clazz newClazz) {
                        if (oldClazz == null || newClazz == null) {
                            return oldClazz == newClazz;
                        }
                        MethodSet oldMethods = oldClazz.getMethods();
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 hr to fix

                  Method matchAssociationValues has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private boolean matchAssociationValues(Association oldAssociation, Association newAssociation) {
                          if (oldAssociation == null || newAssociation == null) {
                              return false;
                          }
                          if (oldAssociation.getName().equals(newAssociation.getName()) == false) {
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 hr to fix

                    Method preparePotentMatches has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private SimpleKeyValueList<Double, SimpleList<Match>> preparePotentMatches(
                                SimpleSet<? extends GraphMember> oldMembers, SimpleSet<? extends GraphMember> newMembers,
                                SimpleSet<? extends GraphMember> oldMatches, SimpleSet<? extends GraphMember> newMatches) {
                            SimpleKeyValueList<Double, SimpleList<Match>> potentMatches = new SimpleKeyValueList<Double, SimpleList<Match>>()
                                    .withComparator(EntityComparator.createComparator());
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 hr to fix

                      Method prepareMatches has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private void prepareMatches(ClazzSet clazzes, boolean isFileMatch) {
                              for (Clazz clazz : clazzes) {
                                  Match match = Match.createMatch(this, clazz, isFileMatch);
                                  match.withOwner(this);
                                  this.addClazzMatch(match);
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 hr to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Method prepareMatches has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private void prepareMatches(ClazzSet clazzes, boolean isFileMatch) {
                              for (Clazz clazz : clazzes) {
                                  Match match = Match.createMatch(this, clazz, isFileMatch);
                                  match.withOwner(this);
                                  this.addClazzMatch(match);
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 1 hr to fix

                        Method checkAssociationNames has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private boolean checkAssociationNames(Association oldAssociation, Association newAssociation, int distance,
                                    int equals) {
                                if ((oldAssociation.getType() == AssociationTypes.EDGE && newAssociation.getType() != AssociationTypes.EDGE)) {
                                    if (Double.compare(GraphUtil.compareName(oldAssociation.getName(), newAssociation.getName()),
                                            distance) == equals) {
                        Severity: Minor
                        Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 45 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Avoid deeply nested control flow statements.
                        Open

                                                if (oldAssociation.getClazz() == oldAssociation.getOtherClazz()
                                                        && newAssociation.getClazz() == newAssociation.getOtherClazz()) {
                                                    matchAssociationValues(oldAssociation.getOther(), newAssociation.getOther());
                                                }
                        Severity: Major
                        Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 45 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return true;
                          Severity: Major
                          Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return false;
                            Severity: Major
                            Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return true;
                              Severity: Major
                              Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return false;
                                Severity: Major
                                Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return false;
                                  Severity: Major
                                  Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return false;
                                    Severity: Major
                                    Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                              return true;
                                      Severity: Major
                                      Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return false;
                                        Severity: Major
                                        Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                          return false;
                                          Severity: Major
                                          Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                            return false;
                                            Severity: Major
                                            Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                          return false;
                                              Severity: Major
                                              Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                            return false;
                                                Severity: Major
                                                Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                  return false;
                                                  Severity: Major
                                                  Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                return false;
                                                    Severity: Major
                                                    Found in src/main/java/de/uniks/networkparser/parser/GraphMatcher.java - About 30 mins to fix

                                                      FIXME found
                                                      Open

                                                      //FIXME        if (matchData != null) {

                                                      FIXME found
                                                      Open

                                                      //FIXME        if (matchData != null) {

                                                      FIXME found
                                                      Open

                                                      //FIXME        if (matchData != null) {

                                                      These nested if statements could be combined
                                                      Open

                                                                          if (matchMethodValues(oldMethod, newMethod)) {
                                                                              metaMatchedMethods.add(oldMethod);
                                                                              newMatchedMethods.add(newMethod);
                                                                          }

                                                      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 (matchAssociationValues(oldAssociation, newAssociation)) {
                                                                              metaMatchedAssociations.add(oldAssociation);
                                                                              newMatchedAssociations.add(newAssociation);
                                                      
                                                                              if (oldAssociation.getClazz() == oldAssociation.getOtherClazz()

                                                      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 (Double.compare(GraphUtil.compareName(oldAssociation.getName(), newAssociation.getName()),
                                                                          distance) == equals) {
                                                                      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 (Double.compare(
                                                                          GraphUtil.compareName(oldAssociation.getOther().getName(), newAssociation.getOther().getName()),
                                                                          distance) == equals) {
                                                                      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 (matchAttributeValues(oldAttribute, newAttribute)) {
                                                                              metaMatchedAttributes.add(oldAttribute);
                                                                              newMatchedAttributes.add(newAttribute);
                                                                          }

                                                      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