fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/converter/GraphConverter.java

Summary

Maintainability
F
2 wks
Test Coverage

Method convertToAdvanced has a Cognitive Complexity of 165 (exceeds 5 allowed). Consider refactoring.
Open

    public TemplateResultFragment convertToAdvanced(TemplateResultFragment fragment) {
        if (fragment == null) {
            return null;
        }
        GraphModel model = (GraphModel) fragment.getMember();
Severity: Minor
Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 3 days 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 convertFromJson has a Cognitive Complexity of 154 (exceeds 5 allowed). Consider refactoring.
Open

    public GraphModel convertFromJson(Entity model, GraphModel reference) {
        if (model == null || model.has(NODES) == false) {
            return null;
        }
        EntityList nodes = (EntityList) model.getValue(NODES);
Severity: Minor
Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 3 days 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 GraphConverter.java has 1057 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.converter;

/*
NetworkParser
The MIT License
Severity: Major
Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 2 days to fix

    Method parseJsonObject has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
    Open

        public Clazz parseJsonObject(GraphList root, Entity node) {
            if (root == null || node == null) {
                return null;
            }
            String id = node.getString("id");
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 convertToAdvanced has 197 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public TemplateResultFragment convertToAdvanced(TemplateResultFragment fragment) {
            if (fragment == null) {
                return null;
            }
            GraphModel model = (GraphModel) fragment.getMember();
    Severity: Major
    Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 7 hrs to fix

      Method convertFromJson has 122 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public GraphModel convertFromJson(Entity model, GraphModel reference) {
              if (model == null || model.has(NODES) == false) {
                  return null;
              }
              EntityList nodes = (EntityList) model.getValue(NODES);
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 4 hrs to fix

        Method createMember has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            private void createMember(TemplateResultFragment fragment, GraphMember member,
                    SimpleKeyValueList<GraphMember, String> names, ModifierSet refModifier) {
                if (member instanceof Association) {
                    Association assoc = (Association) member;
                    String name = (String) names.getValue(assoc.getClazz());
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 parseJsonObject has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public Clazz parseJsonObject(GraphList root, Entity node) {
                if (root == null || node == null) {
                    return null;
                }
                String id = node.getString("id");
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 3 hrs to fix

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

              public TemplateResultFragment convertToMetaText(GraphModel model, boolean full, boolean useImport) {
                  TemplateResultFragment fragment = TemplateResultFragment.create(model, useImport, true);
                  if (full == false || model == null) {
                      return convertToAdvanced(fragment);
                  }
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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

          GraphConverter has 26 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public class GraphConverter implements Converter {
              public static final String TYPE = "type";
              public static final String ID = "id";
          
              public static final String NODE = "node";
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 3 hrs to fix

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

                public TemplateResultFragment convertToMetaText(GraphModel model, boolean full, boolean useImport) {
                    TemplateResultFragment fragment = TemplateResultFragment.create(model, useImport, true);
                    if (full == false || model == null) {
                        return convertToAdvanced(fragment);
                    }
            Severity: Major
            Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 2 hrs to fix

              Method createMember has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private void createMember(TemplateResultFragment fragment, GraphMember member,
                          SimpleKeyValueList<GraphMember, String> names, ModifierSet refModifier) {
                      if (member instanceof Association) {
                          Association assoc = (Association) member;
                          String name = (String) names.getValue(assoc.getClazz());
              Severity: Major
              Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 2 hrs to fix

                Method parseMethods has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    private EntityList parseMethods(GraphEntity list, boolean shortName, boolean removeParameterNames) {
                        EntityList result = (EntityList) factory.getNewList(false);
                        GraphSimpleSet children = GraphUtil.getChildren(list);
                        if (children == null) {
                            return result;
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 parseEntity has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    public Entity parseEntity(String type, GraphMember entity, boolean shortName, boolean removeParameterNames) {
                        if (type == null) {
                            type = GraphTokener.OBJECTDIAGRAM;
                            if (entity == null || entity.getName() == null) {
                                type = GraphTokener.CLASSDIAGRAM;
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 parseEdge has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    private Entity parseEdge(String type, Clazz source, Clazz target, Association edge, boolean shortName,
                            ArrayList<String> ids) {
                        Entity child = (Entity) factory.getNewList(true);
                        if (ids == null || edge == null || type == null || source == null || target == null) {
                            return child;
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 parseEdge has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private Entity parseEdge(String type, Clazz source, Clazz target, Association edge, boolean shortName,
                            ArrayList<String> ids) {
                        Entity child = (Entity) factory.getNewList(true);
                        if (ids == null || edge == null || type == null || source == null || target == null) {
                            return child;
                Severity: Major
                Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 2 hrs to fix

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

                      public TemplateResultFragment convertToTestCode(GraphModel model, boolean createModel) {
                          TemplateResultFragment code = new TemplateResultFragment();
                          if (model == null) {
                              return code;
                          }
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 parseEntities has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public EntityList parseEntities(String type, GraphEntity nodes, boolean shortName, boolean removeParameterNames) {
                          EntityList result = (EntityList) factory.getNewList(false);
                          ArrayList<String> ids = new ArrayList<String>();
                          GraphSimpleSet children = GraphUtil.getChildren(nodes);
                          if (children == null) {
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 parseEntity has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public Entity parseEntity(String type, GraphMember entity, boolean shortName, boolean removeParameterNames) {
                          if (type == null) {
                              type = GraphTokener.OBJECTDIAGRAM;
                              if (entity == null || entity.getName() == null) {
                                  type = GraphTokener.CLASSDIAGRAM;
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 1 hr to fix

                    Method parseEdges has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private EntityList parseEdges(String type, SimpleSet<Association> edges, boolean shortName) {
                            EntityList result = (EntityList) factory.getNewList(false);
                            if (edges == null) {
                                return result;
                            }
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 parseAttributes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private EntityList parseAttributes(String type, GraphEntity list, boolean shortName) {
                            EntityList result = (EntityList) factory.getNewList(false);
                            String splitter = "";
                            if (GraphTokener.OBJECTDIAGRAM.equals(type)) {
                                splitter = "=";
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 parseMethods has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private EntityList parseMethods(GraphEntity list, boolean shortName, boolean removeParameterNames) {
                            EntityList result = (EntityList) factory.getNewList(false);
                            GraphSimpleSet children = GraphUtil.getChildren(list);
                            if (children == null) {
                                return result;
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 1 hr to fix

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

                          public Entity convertToJson(GraphModel root, boolean removePackage, boolean removeParameterNames) {
                              if (root == null) {
                                  return null;
                              }
                              String type = GraphTokener.CLASSDIAGRAM;
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 1 hr to fix

                        Method parseAttributes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private EntityList parseAttributes(String type, GraphEntity list, boolean shortName) {
                                EntityList result = (EntityList) factory.getNewList(false);
                                String splitter = "";
                                if (GraphTokener.OBJECTDIAGRAM.equals(type)) {
                                    splitter = "=";
                        Severity: Minor
                        Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 1 hr to fix

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

                              public TemplateResultFragment convertToTestCode(GraphModel model, boolean createModel) {
                                  TemplateResultFragment code = new TemplateResultFragment();
                                  if (model == null) {
                                      return code;
                                  }
                          Severity: Minor
                          Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 1 hr to fix

                            Method getFreeName has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private String getFreeName(SimpleKeyValueList<GraphMember, String> names, GraphMember member) {
                                    if (names == null || member == null) {
                                        return null;
                                    }
                                    String value = member.getName().toLowerCase();
                            Severity: Minor
                            Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 1 hr to fix

                              Method convertToJson has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public Entity convertToJson(GraphModel root, boolean removePackage, boolean removeParameterNames) {
                                      if (root == null) {
                                          return null;
                                      }
                                      String type = GraphTokener.CLASSDIAGRAM;
                              Severity: Minor
                              Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 55 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 getFreeName has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private String getFreeName(SimpleKeyValueList<GraphMember, String> names, GraphMember member) {
                                      if (names == null || member == null) {
                                          return null;
                                      }
                                      String value = member.getName().toLowerCase();
                              Severity: Minor
                              Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 55 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 parseEdge has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  private Entity parseEdge(String type, GraphEntity source, GraphEntity target, Association edge, boolean shortName,
                                          ArrayList<String> ids) {
                              Severity: Minor
                              Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 45 mins to fix

                                Method parseEdge has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    private Entity parseEdge(String type, Clazz source, Clazz target, Association edge, boolean shortName,
                                            ArrayList<String> ids) {
                                Severity: Minor
                                Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 45 mins to fix

                                  Method parseEdge has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      private Entity parseEdge(String type, GraphPattern source, GraphPattern target, Association edge, boolean shortName,
                                              ArrayList<String> ids) {
                                  Severity: Minor
                                  Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if (entity instanceof String) {
                                                            } else if (entity instanceof Entity) {
                                                                Entity json = (Entity) entity;
                                                                if (json.has(ID)) {
                                                                    Method method = clazz.createMethod(json.getString(ID));
                                    Severity: Major
                                    Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if (oldValue == null) {
                                                                  String key = (String) names.getValue(newValue);
                                                                  if (key != null) {
                                                                      fragment.withLineString(matchNameMatch + ".withSuperClazz(\"" + key + "\");");
                                                                  } else {
                                      Severity: Major
                                      Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if (entity instanceof String) {
                                                                    String attribute = (String) entity;
                                                                    int pos = attribute.indexOf(":");
                                                                    if (pos > 0) {
                                                                        clazz.createAttribute(attribute.substring(0, pos),
                                        Severity: Major
                                        Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 45 mins to fix

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

                                              private void parseGraphEntity(GraphEntity entity, Entity item, String type, boolean shortName,
                                                      boolean removeParameterNames) {
                                          Severity: Minor
                                          Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.java - About 35 mins to fix

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

                                                @Override
                                                public String encode(BaseItem entity) {
                                                    if (entity instanceof GraphModel) {
                                                        GraphModel model = (GraphModel) entity;
                                                        GraphSimpleSet children = GraphUtil.getChildren(model);
                                            Severity: Minor
                                            Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 null;
                                            Severity: Major
                                            Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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/converter/GraphConverter.java - About 30 mins to fix

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

                                                    private Entity addInfo(Association edge, boolean cardinality, boolean property) {
                                                        Entity result = (Entity) factory.getNewList(true);
                                                        if (edge == null) {
                                                            return result;
                                                        }
                                                Severity: Minor
                                                Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 getNodeHeader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    public GraphCustomItem getNodeHeader(GraphEntity entity) {
                                                        GraphSimpleSet children = GraphUtil.getChildren(entity);
                                                        if (children != null) {
                                                            for (GraphMember member : children) {
                                                                if (member instanceof GraphCustomItem) {
                                                Severity: Minor
                                                Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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 parseEdge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                    private Entity parseEdge(String type, GraphEntity source, GraphEntity target, Association edge, boolean shortName,
                                                            ArrayList<String> ids) {
                                                        if (source instanceof Clazz && target instanceof Clazz) {
                                                            return parseEdge(type, (Clazz) source, (Clazz) target, edge, shortName, ids);
                                                        }
                                                Severity: Minor
                                                Found in src/main/java/de/uniks/networkparser/converter/GraphConverter.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

                                                FIXME found
                                                Open

                                                                                /* FIXME FOR ASSOC -- ATTRIBUTE */

                                                These nested if statements could be combined
                                                Open

                                                                        if (newValue instanceof DataType == false) {
                                                                            newValue = fragment.replacing("#IMPORT.create(\"" + newValue + "\")",
                                                                                    DataType.class.getName());
                                                                        }

                                                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