fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/ext/FileClassModel.java

Summary

Maintainability
F
1 wk
Test Coverage

Method checkMethodsJavaDoc has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
Open

    private SimpleList<String> checkMethodsJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
            String currentPackage, String currentFileName) {
        SimpleList<String> msg = new SimpleList<String>();
        /* Create a matcher to find all method declarations */
        Matcher methodPattern = Pattern.compile(
Severity: Minor
Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.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 FileClassModel.java has 596 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.ext;

import java.io.File;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Severity: Major
Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 1 day to fix

    Method checkClassJavaDoc has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        private SimpleList<String> checkClassJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
                String currentPackage, String currentFileName) {
            SimpleList<String> msg = new SimpleList<String>();
            /*
             * First check if the class has java doc, first get the index of "public class"
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 6 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 analyseBounds has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

        public ClassModel analyseBounds(ClassModel model) {
            if (model == null) {
                model = this;
            }
            String search = "import " + model.getName();
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.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 analyseInBoundLinks has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        public ClassModel analyseInBoundLinks(ClassModel model) {
            if (model == null) {
                model = this;
            }
            for (int i = 0; i < list.size(); i++) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.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 getFiles has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        private void getFiles(File directory, ObjectCondition condition, String parent) {
            if (directory.exists() && directory.isDirectory()) {
                File[] items = directory.listFiles();
                if (items == null) {
                    return;
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.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

    FileClassModel has 27 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class FileClassModel extends ClassModel {
        /**
         * The suffix of a java file as constant for easer use
         */
        private static final String JAVA_FILE_SUFFIX = ".java";
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 3 hrs to fix

      Method checkMethodsJavaDoc has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private SimpleList<String> checkMethodsJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
                  String currentPackage, String currentFileName) {
              SimpleList<String> msg = new SimpleList<String>();
              /* Create a matcher to find all method declarations */
              Matcher methodPattern = Pattern.compile(
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 3 hrs to fix

        Method checkClassJavaDoc has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private SimpleList<String> checkClassJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
                    String currentPackage, String currentFileName) {
                SimpleList<String> msg = new SimpleList<String>();
                /*
                 * First check if the class has java doc, first get the index of "public class"
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 2 hrs to fix

          Method analyseLoC has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

              public GraphMetric analyseLoC(Object item) {
                  String methodBody = null;
                  Method owner = null;
                  if (item instanceof GraphModel) {
                      GraphModel model = (GraphModel) item;
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.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 analyseBounds has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public ClassModel analyseBounds(ClassModel model) {
                  if (model == null) {
                      model = this;
                  }
                  String search = "import " + model.getName();
          Severity: Major
          Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 2 hrs to fix

            Method analyseLoC has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public GraphMetric analyseLoC(Object item) {
                    String methodBody = null;
                    Method owner = null;
                    if (item instanceof GraphModel) {
                        GraphModel model = (GraphModel) item;
            Severity: Major
            Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 2 hrs to fix

              Method analyseInBoundLinks has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public ClassModel analyseInBoundLinks(ClassModel model) {
                      if (model == null) {
                          model = this;
                      }
                      for (int i = 0; i < list.size(); i++) {
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 1 hr to fix

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

                    private void getFiles(File directory, ObjectCondition condition, String parent) {
                        if (directory.exists() && directory.isDirectory()) {
                            File[] items = directory.listFiles();
                            if (items == null) {
                                return;
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 1 hr to fix

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

                      public boolean readFiles(String path, String type, ObjectCondition... conditions) {
                          ObjectCondition condition = null;
                          if (conditions != null && conditions.length > 0) {
                              condition = conditions[0];
                          }
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.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 extractJavaDocComment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private String extractJavaDocComment(CharacterBuffer extractFrom, int searchIndex) {
                  
                          /* Initialize attribute which describe the range of the doc */
                          int begin = -1;
                          int end = -1;
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.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 analyseMcCabe has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public int analyseMcCabe(Object item) {
                          String methodBody = null;
                          Method owner = null;
                          if (item instanceof Method) {
                              owner = (Method) item;
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 1 hr to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            for (Parameter param : methods.getParameters()) {
                                                if (param.getType().equals(targetClazz)) {
                                                    clazz.createBidirectional(targetClazz, "use", Association.ONE, "use", Association.ONE);
                                                    break;
                                                }
                    Severity: Major
                    Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 45 mins to fix

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

                          private SimpleList<String> checkClassJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
                                  String currentPackage, String currentFileName) {
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 35 mins to fix

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

                            private SimpleList<String> checkMethodsJavaDoc(CharacterBuffer text, SimpleList<String> lines, boolean fullCheck,
                                    String currentPackage, String currentFileName) {
                        Severity: Minor
                        Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.java - About 35 mins to fix

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

                              private int check(String body, String search) {
                                  int mcCabe = 0;
                                  int index = 0;
                                  while (index >= 0) {
                                      index = body.indexOf(search, index);
                          Severity: Minor
                          Found in src/main/java/de/uniks/networkparser/ext/FileClassModel.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