fujaba/NetworkParser

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

Summary

Maintainability
F
3 days
Test Coverage

Method diffModel has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
Open

    public GraphPatternMatch diffModel(Object master, Object slave, MapEntity map) {
        if (map == null || map.add(master) == false) {
            return null;
        }
        GraphPatternMatch result = new GraphPatternMatch();
Severity: Minor
Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.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 diffModel has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public GraphPatternMatch diffModel(Object master, Object slave, MapEntity map) {
        if (map == null || map.add(master) == false) {
            return null;
        }
        GraphPatternMatch result = new GraphPatternMatch();
Severity: Major
Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.java - About 4 hrs to fix

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

        private Clazz parse(Object object, MapEntity map, GraphList list, int deep) {
            if (object == null) {
                return null;
            }
    
    
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.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

    File GraphTokener.java has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package de.uniks.networkparser.graph;
    
    /*
    NetworkParser
    The MIT License
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.java - About 2 hrs to fix

      Method highlightModel has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public GraphList highlightModel(GraphList clazzDiagram, GraphList objectDiagram) {
              if (clazzDiagram == null || objectDiagram == null) {
                  return clazzDiagram;
              }
              HashMap<String, Association> edges = new HashMap<String, Association>();
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.java - About 1 hr to fix

        Method parse has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private Clazz parse(Object object, MapEntity map, GraphList list, int deep) {
                if (object == null) {
                    return null;
                }
        
        
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.java - About 1 hr to fix

          Method highlightModel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public GraphList highlightModel(GraphList clazzDiagram, GraphList objectDiagram) {
                  if (clazzDiagram == null || objectDiagram == null) {
                      return clazzDiagram;
                  }
                  HashMap<String, Association> edges = new HashMap<String, Association>();
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.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 parsePropertyValue has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void parsePropertyValue(Object entity, MapEntity map, GraphList list, int deep, Clazz element,
                      String property, Object item, int cardinality) {
                  if (item == null) {
                      return;
                  }
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.java - About 1 hr to fix

            Method parsePropertyValue has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private void parsePropertyValue(Object entity, MapEntity map, GraphList list, int deep, Clazz element,
                        String property, Object item, int cardinality) {
            Severity: Major
            Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.java - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                                      for (Iterator<?> childIterator = child.iterator(); childIterator.hasNext();) {
                                          match.with(GraphPatternChange.createCreate(childIterator.next()));
                                      }
              Severity: Major
              Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.java - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (match.size() > 0) {
                                            result.with(match);
                                        }
                Severity: Major
                Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.java - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          for (Iterator<?> childIterator = masterCollection.iterator(); childIterator.hasNext();) {
                                              match.with(GraphPatternChange.createDelete(childIterator.next()));
                                          }
                  Severity: Major
                  Found in src/main/java/de/uniks/networkparser/graph/GraphTokener.java - About 45 mins to fix

                    Avoid too many return statements within this method.
                    Open

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

                      Avoid too many return statements within this method.
                      Open

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

                        Avoid too many return statements within this method.
                        Open

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

                          There are no issues that match your filters.

                          Category
                          Status