fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/graph/Clazz.java

Summary

Maintainability
F
1 wk
Test Coverage

File Clazz.java has 797 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.graph;

import de.uniks.networkparser.EntityUtil;
/*
The MIT License
Severity: Major
Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 1 day to fix

    Method repairAssociation has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

        protected boolean repairAssociation(Association assoc, boolean renameName) {
            if (assoc == null || assoc.getOther() == null) {
                return false;
            }
            if (AssociationTypes.IMPLEMENTS.equals(assoc.getType()) == false
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Clazz.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 parseSuperElements has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

        protected void parseSuperElements(ClazzSet superClasses, SimpleSet<?> existsElements, SimpleSet<?> newExistElements,
                SimpleSet<?> newElements, Condition<?>... filters) {
            if (this.children == null || existsElements == null) {
                return;
            }
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 7 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

    Clazz has 47 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Clazz extends GraphEntity {
        public static final String TYPE_CLASS = "class";
        public static final String TYPE_ENUMERATION = "enum";
        public static final String TYPE_INTERFACE = "interface";
        public static final String TYPE_CREATOR = "creator";
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 6 hrs to fix

      Method getValue has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          @Override
          public Object getValue(String attribute) {
              if (attribute == null) {
                  return null;
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 5 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 withSuperClazz has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          public Clazz withSuperClazz(Clazz... values) {
              AssociationTypes type = AssociationTypes.GENERALISATION;
      
              if (values != null) {
                  if (values.length == 1) {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Clazz.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

      Method getAttributes has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          public AttributeSet getAttributes(Condition<?>... filters) {
              AttributeSet collection = new AttributeSet();
              if (this.children == null) {
                  return collection;
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Clazz.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 getMethods has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          public MethodSet getMethods(Condition<?>... filters) {
              MethodSet collection = new MethodSet();
              if (this.children == null) {
                  return collection;
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Clazz.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 createAssociation has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          protected boolean createAssociation(AssociationTypes direction, AssociationTypes backDirection, Clazz... values) {
              if (values == null) {
                  return false;
              }
              AssociationSet associations = getAssociations();
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Clazz.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 repairAssociation has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected boolean repairAssociation(Association assoc, boolean renameName) {
              if (assoc == null || assoc.getOther() == null) {
                  return false;
              }
              if (AssociationTypes.IMPLEMENTS.equals(assoc.getType()) == false
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 3 hrs to fix

        Method withAssoc has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            public Clazz withAssoc(Clazz tgtClass, int... cardinality) {
                if (tgtClass == null || tgtClass.getName() == null) {
                    return this;
                }
                int tgtCardinality = 1;
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/graph/Clazz.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 remove has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            @Override
            public boolean remove(GraphMember member) {
                if (this.children == null || member == null) {
                    return false;
                }
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/graph/Clazz.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 getValue has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @Override
            public Object getValue(String attribute) {
                if (attribute == null) {
                    return null;
                }
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 2 hrs to fix

          Method parseSuperElements has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected void parseSuperElements(ClazzSet superClasses, SimpleSet<?> existsElements, SimpleSet<?> newExistElements,
                      SimpleSet<?> newElements, Condition<?>... filters) {
                  if (this.children == null || existsElements == null) {
                      return;
                  }
          Severity: Major
          Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 2 hrs to fix

            Method repairAssociations has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                private void repairAssociations() {
                    if (this.children == null) {
                        return;
                    }
                    if (this.children instanceof Association) {
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/graph/Clazz.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 getAttributes has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public AttributeSet getAttributes(Condition<?>... filters) {
                    AttributeSet collection = new AttributeSet();
                    if (this.children == null) {
                        return collection;
                    }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 1 hr to fix

              Method getMethods has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public MethodSet getMethods(Condition<?>... filters) {
                      MethodSet collection = new MethodSet();
                      if (this.children == null) {
                          return collection;
                      }
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 1 hr to fix

                Method withAssoc has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public Clazz withAssoc(Clazz tgtClass, int... cardinality) {
                        if (tgtClass == null || tgtClass.getName() == null) {
                            return this;
                        }
                        int tgtCardinality = 1;
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 1 hr to fix

                  Method withSuperClazz has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public Clazz withSuperClazz(Clazz... values) {
                          AssociationTypes type = AssociationTypes.GENERALISATION;
                  
                          if (values != null) {
                              if (values.length == 1) {
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 1 hr to fix

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

                        @Override
                        public AssociationSet getAssociations(Condition<?>... filters) {
                            AssociationSet collection = super.getAssociations(filters);
                            boolean isInterface = TYPE_INTERFACE.equals(getType());
                            boolean isAbstract = getModifier().has(Modifier.ABSTRACT);
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/graph/Clazz.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

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

                        public SimpleSet<Literal> getValues() {
                            SimpleSet<Literal> collection = new SimpleSet<Literal>();
                            if (this.children == null) {
                                return collection;
                            }
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/graph/Clazz.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

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

                        public SimpleSet<Import> getImports() {
                            SimpleSet<Import> collection = new SimpleSet<Import>();
                            if (this.children == null) {
                                return collection;
                            }
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/graph/Clazz.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

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

                        protected ClazzSet getEdgeClazzes(AssociationTypes typ, AssociationTypes otherTyp) {
                            ClazzSet kidClazzes = new ClazzSet();
                            if (this.children == null || typ == null) {
                                return kidClazzes;
                            }
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/graph/Clazz.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 (assoc.getType() == direction && assoc.getOtherType() == backDirection) {
                                                if (assoc.contains(item, true, false) == false) {
                                                    assoc.getOther().setParentNode(item);
                                                    return true;
                                                }
                    Severity: Major
                    Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (assoc.getOther().getParents().size() == 1) {
                                                  this.remove(assoc);
                                              } else {
                                                  assoc.getOther().withoutParent(clazz);
                                              }
                      Severity: Major
                      Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 45 mins to fix

                        Method withBidirectional has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public Clazz withBidirectional(Clazz tgtClass, String tgtRoleName, int tgtCardinality, String srcRoleName,
                                    int srcCardinality) {
                        Severity: Minor
                        Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 35 mins to fix

                          Method createBidirectional has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public Association createBidirectional(Clazz tgtClass, String tgtRoleName, int tgtCardinality, String srcRoleName,
                                      int srcCardinality) {
                          Severity: Minor
                          Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 35 mins to fix

                            Method withAssoc has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public Clazz withAssoc(Clazz tgtClass, String tgtRoleName, int tgtCardinality, String srcRoleName,
                                        int srcCardinality) {
                            Severity: Minor
                            Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 35 mins to fix

                              Method parseSuperElements has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  protected void parseSuperElements(ClazzSet superClasses, SimpleSet<?> existsElements, SimpleSet<?> newExistElements,
                                          SimpleSet<?> newElements, Condition<?>... filters) {
                              Severity: Minor
                              Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 35 mins to fix

                                Method enableEnumeration has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public Clazz enableEnumeration(Object... literals) {
                                        this.withType(TYPE_ENUMERATION);
                                        if (literals == null) {
                                            return this;
                                        }
                                Severity: Minor
                                Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 35 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 too many return statements within this method.
                                Open

                                            return implementsClazz.toString(", ");
                                Severity: Major
                                Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return this.getName(false);
                                  Severity: Major
                                  Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return null;
                                    Severity: Major
                                    Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                      return attributes.getValue(attribute.substring(pos + 1));
                                      Severity: Major
                                      Found in src/main/java/de/uniks/networkparser/graph/Clazz.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/graph/Clazz.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                      return clazzes.toString(", ");
                                          Severity: Major
                                          Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                        return this.getType();
                                            Severity: Major
                                            Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                          return buffer.toString();
                                              Severity: Major
                                              Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                        return super.getValue(attribute);
                                                Severity: Major
                                                Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return attributes;
                                                  Severity: Major
                                                  Found in src/main/java/de/uniks/networkparser/graph/Clazz.java - About 30 mins to fix

                                                    These nested if statements could be combined
                                                    Open

                                                                                if (assoc.contains(item, true, false) == false) {
                                                                                    assoc.getOther().setParentNode(item);
                                                                                    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 (assoc.getOther().contains(clazz, true, true)) {
                                                                            if (assoc.getOther().getParents().size() == 1) {
                                                                                this.remove(assoc);
                                                                            } else {
                                                                                assoc.getOther().withoutParent(clazz);

                                                    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 (assoc.getCardinality() != otherAssoc.getCardinality()) {
                                                                        /* Self assoc with same RoleName but other Cardinality */
                                                                        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
                                                     }
                                                    }

                                                    There are no issues that match your filters.

                                                    Category
                                                    Status