fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/xml/XSDEntity.java

Summary

Maintainability
F
3 days
Test Coverage

Method parsingRootStructure has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    protected String parsingRootStructure(ClassModel model, Clazz clazz, SimpleKeyValueList<Clazz, String> classTypes,
            SimpleKeyValueList<String, XMLEntity> typesValues, Clazz parent) {
        if (model == null || classTypes == null || typesValues == null) {
            return null;
        }
Severity: Minor
Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.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

File XSDEntity.java has 342 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.xml;

/*
NetworkParser
The MIT License
Severity: Minor
Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 4 hrs to fix

    Method parsingRootStructure has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected String parsingRootStructure(ClassModel model, Clazz clazz, SimpleKeyValueList<Clazz, String> classTypes,
                SimpleKeyValueList<String, XMLEntity> typesValues, Clazz parent) {
            if (model == null || classTypes == null || typesValues == null) {
                return null;
            }
    Severity: Major
    Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 3 hrs to fix

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

      public class XSDEntity extends XMLEntity implements SendableEntityCreator {
          public static final String XSD_COMPLEX_TYPE = ":complexType";
          public static final String XSD_ELEMENT_TYPE = ":element";
          public static final String XSD_STRING_TYPE = ":string";
          public static final String XSD_SEQUENCE_TYPE = ":sequence";
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 3 hrs to fix

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

            public boolean cleanUp(String prefix) {
                if (prefix == null) {
                    return false;
                }
        
        
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.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 createModel has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public ClassModel createModel(String prefix) {
                ClassModel model = new ClassModel();
                if (prefix == null) {
                    return model;
                }
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 1 hr to fix

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

              public ClassModel createModel(String prefix) {
                  ClassModel model = new ClassModel();
                  if (prefix == null) {
                      return model;
                  }
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.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 cleanUp has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public boolean cleanUp(String prefix) {
                  if (prefix == null) {
                      return false;
                  }
          
          
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 1 hr to fix

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

                private void cleanUpTypes(String prefix, SimpleKeyValueList<String, String> simpleReplaceType, XMLEntity parent) {
                    String elementType = prefix + XSD_ELEMENT_TYPE;
                    if (parent == null) {
                        return;
                    }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.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

            Avoid deeply nested control flow statements.
            Open

                                    if (pos >= 0) {
                                        simpleReplaceType.put(name, stringType);
                                        simpleReplaceType.setValue(pos, stringType);
                                    } else {
                                        simpleReplaceType.put(name, stringType);
            Severity: Major
            Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if ("0".equals(element.getMinOccurs()) == false) {
                                          /* ITS NESSESSARY */
                                          attr.withValue("\"\"");
                                          System.out.println("MUST BE INIT: " + clazz.getName() + ":" + name);
                                      }
              Severity: Major
              Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 45 mins to fix

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

                    @Override
                    public boolean setValue(Object entity, String attribute, Object value, String type) {
                        if (entity == null || entity instanceof XSDEntity == false) {
                            return false;
                        }
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.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 parsingRootStructure has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    protected String parsingRootStructure(ClassModel model, Clazz clazz, SimpleKeyValueList<Clazz, String> classTypes,
                            SimpleKeyValueList<String, XMLEntity> typesValues, Clazz parent) {
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 35 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return xsd.setMinOccurs((String) value);
                  Severity: Major
                  Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

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

                      Avoid too many return statements within this method.
                      Open

                                  return xsd.setTag((String) value);
                      Severity: Major
                      Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return xsd.setMaxOccurs((String) value);
                        Severity: Major
                        Found in src/main/java/de/uniks/networkparser/xml/XSDEntity.java - About 30 mins to fix

                          There are no issues that match your filters.

                          Category
                          Status