fujaba/NetworkParser

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

Summary

Maintainability
C
1 day
Test Coverage

Feature has 24 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Feature implements Comparable<Feature> {
    public static final Clazz ALL = new Clazz("*");
    public static final String NAME = "name";
    public static final String CLASSVALUE = "classValue";
    public static final String CLASSSTRING = "classString";
Severity: Minor
Found in src/main/java/de/uniks/networkparser/graph/Feature.java - About 2 hrs to fix

    File Feature.java has 258 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package de.uniks.networkparser.graph;
    
    import java.util.LinkedHashSet;
    
    /*
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/Feature.java - About 2 hrs to fix

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

          public boolean match(String clazzName) {
              /* if Clazz is positive */
              boolean result = false;
              if (this.classValue != null) {
                  return this.classValue.getName().equals(clazzName);
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Feature.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 match has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public boolean match(String clazzName) {
              /* if Clazz is positive */
              boolean result = false;
              if (this.classValue != null) {
                  return this.classValue.getName().equals(clazzName);
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/Feature.java - About 1 hr to fix

        Avoid too many return statements within this method.
        Open

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

          Method match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public boolean match(Clazz... clazzes) {
                  if (clazzes == null) {
                      return true;
                  }
                  for (Clazz clazz : clazzes) {
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/graph/Feature.java - About 25 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 withExcludeClazz has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public Feature withExcludeClazz(String... value) {
                  if (this.reference) {
                      return null;
                  }
                  if (value == null) {
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/graph/Feature.java - About 25 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 withExcludeClazz has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public Feature withExcludeClazz(Clazz... value) {
                  if (this.reference) {
                      return null;
                  }
                  if (value == null) {
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/graph/Feature.java - About 25 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

          There are no issues that match your filters.

          Category
          Status