fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/parser/ParserEntity.java

Summary

Maintainability
F
2 wks
Test Coverage

File ParserEntity.java has 1387 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.parser;

/*
The MIT License

Severity: Major
Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 3 days to fix

    ParserEntity has 73 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class ParserEntity {
        public static final String NAME_TOKEN = "nameToken";
    
        public static final String CLASS_BODY = "classBody";
    
    
    Severity: Major
    Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 day to fix

      Method handleComplexAttr has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
      Open

          private boolean handleComplexAttr(String attrName, SymTabEntry symTabEntry,
                  SimpleKeyValueList<String, SimpleList<SymTabEntry>> symbolTab) {
              GraphModel model = this.getClazz().getClassModel();
              if (model == null) {
                  return false;
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseMemberDecl has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
      Open

          private void parseMemberDecl() {
      /* FIXME        int preCommentStartPos = currentToken.preCommentStartPos; */
      /*        int preCommentEndPos = currentToken.preCommentEndPos; */
              long startLine = getLine();
              while (parseComment(true) != null) {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 nextToken has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          public void nextToken() {
              Token tmp = previousToken;
              previousToken = currentToken;
              currentToken = lookAheadToken;
      
      
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseExpression has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          private CharacterBuffer parseExpression(CharacterBuffer buffer) {
              /* ... { ;;; } ; */
              if (buffer == null) {
                  buffer = new CharacterBuffer();
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseMemberDecl has 129 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void parseMemberDecl() {
      /* FIXME        int preCommentStartPos = currentToken.preCommentStartPos; */
      /*        int preCommentEndPos = currentToken.preCommentEndPos; */
              long startLine = getLine();
              while (parseComment(true) != null) {
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 5 hrs to fix

        Method parseBlock has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            private CharacterBuffer parseBlock(CharacterBuffer body, char stopChar) {
                if (body == null) {
                    body = new CharacterBuffer();
                }
                char prevprevTokenKind;
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 handleComplexAttr has 122 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private boolean handleComplexAttr(String attrName, SymTabEntry symTabEntry,
                    SimpleKeyValueList<String, SimpleList<SymTabEntry>> symbolTab) {
                GraphModel model = this.getClazz().getClassModel();
                if (model == null) {
                    return false;
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 4 hrs to fix

          Method nextToken has 103 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void nextToken() {
                  Token tmp = previousToken;
                  previousToken = currentToken;
                  currentToken = lookAheadToken;
          
          
          Severity: Major
          Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 4 hrs to fix

            Method getMethod has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
            Open

                private Method getMethod(Method search) {
                    Clazz clazz = this.getClazz();
                    if (clazz == null) {
                        return search;
                    }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 addMemberToModel has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public void addMemberToModel(boolean addStaticAttribute) {
                    if (code == null) {
                        return;
                    }
                    SimpleKeyValueList<String, SimpleList<SymTabEntry>> symbolTab = code.getSymbolTab();
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 findMemberClass has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                private Clazz findMemberClass(Clazz clazz, SymTabEntry memberName,
                        SimpleKeyValueList<String, SimpleList<SymTabEntry>> symbolTab) {
            /* FIXME        String[] split = memberName.split(":"); */
                    if (memberName == null) {
                        return null;
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 addMemberAsMethod has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                private void addMemberAsMethod(SymTabEntry symTabEntry,
                        SimpleKeyValueList<String, SimpleList<SymTabEntry>> symTab) {
                    if (symTabEntry == null) {
                        return;
                    }
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 skip has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public boolean skip(char string, boolean skipCRLF, CharacterBuffer body) {
                    if (currentTokenEquals(string)) {
                        if (skipCRLF) {
                            if (body != null) {
                                body.add(currentToken.originalText);
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseClassDecl has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private void parseClassDecl() {
            /* FIXME        int preCommentStartPos = currentToken.preCommentStartPos; */
            /*        int preCommentEndPos = currentToken.preCommentEndPos; */
                    int startPosAnnotations = currentToken.startPos;
                    SymTabEntry nextEntity;
            Severity: Minor
            Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

              Method parseExpression has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private CharacterBuffer parseExpression(CharacterBuffer buffer) {
                      /* ... { ;;; } ; */
                      if (buffer == null) {
                          buffer = new CharacterBuffer();
                      }
              Severity: Minor
              Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

                Method parseClassDecl has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void parseClassDecl() {
                /* FIXME        int preCommentStartPos = currentToken.preCommentStartPos; */
                /*        int preCommentEndPos = currentToken.preCommentEndPos; */
                        int startPosAnnotations = currentToken.startPos;
                        SymTabEntry nextEntity;
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseBlock has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private CharacterBuffer parseBlock(CharacterBuffer body, char stopChar) {
                        if (body == null) {
                            body = new CharacterBuffer();
                        }
                        char prevprevTokenKind;
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

                  Method addMemberAsMethod has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private void addMemberAsMethod(SymTabEntry symTabEntry,
                              SimpleKeyValueList<String, SimpleList<SymTabEntry>> symTab) {
                          if (symTabEntry == null) {
                              return;
                          }
                  Severity: Minor
                  Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

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

                        private boolean isAssoc(String methodName, SimpleKeyValueList<String, SimpleList<SymTabEntry>> symTab) {
                            /* method starts with: with set get ... */
                            if (methodName == null) {
                                return false;
                            }
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 isGetterSetter has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private boolean isGetterSetter(String methodName, SimpleKeyValueList<String, SimpleList<SymTabEntry>> symTab) {
                            /* method starts with: with set get ... */
                            if (methodName == null) {
                                return false;
                            }
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseTypeRef has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private String parseTypeRef() {
                            CharacterBuffer typeString = new CharacterBuffer();
                            /* (void | qualifiedName) <T1, T2> [] ... */
                            String typeName = SymTabEntry.TYPE_VOID;
                            if (currentTokenEquals(SymTabEntry.TYPE_VOID)) {
                    Severity: Minor
                    Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

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

                          private void addMemberAsAttribut(SymTabEntry symTabEntry,
                                  SimpleKeyValueList<String, SimpleList<SymTabEntry>> symbolTab, boolean addStaticAttribute) {
                              /* filter public static final constances */
                              if (symTabEntry == null) {
                                  return;
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseClassBody has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private void parseClassBody() {
                              /* { classBodyDecl* } */
                              skip('{', true);
                              boolean isDebug = this.update instanceof DebugCondition;
                              code.withStartBody(currentToken.startPos, getLine());
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parse has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public Clazz parse(CharacterBuffer sequence) {
                              if (this.code == null) {
                                  /* FIX IT */
                                  this.code = new SourceCode();
                                  this.code.with(new Clazz(""));
                      Severity: Minor
                      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

                        Method findMemberClass has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private Clazz findMemberClass(Clazz clazz, SymTabEntry memberName,
                                    SimpleKeyValueList<String, SimpleList<SymTabEntry>> symbolTab) {
                        /* FIXME        String[] split = memberName.split(":"); */
                                if (memberName == null) {
                                    return null;
                        Severity: Minor
                        Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

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

                              private CharacterBuffer parseComment(boolean newBlock) {
                                  if (isComment() == false) {
                                      return null;
                                  }
                                  SymTabEntry nextEntity = startNextSymTab(SymTabEntry.TYPE_COMMENT);
                          Severity: Minor
                          Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

                            Method addMemberToModel has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public void addMemberToModel(boolean addStaticAttribute) {
                                    if (code == null) {
                                        return;
                                    }
                                    SimpleKeyValueList<String, SimpleList<SymTabEntry>> symbolTab = code.getSymbolTab();
                            Severity: Minor
                            Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

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

                                  private Method getMethod(Method search) {
                                      Clazz clazz = this.getClazz();
                                      if (clazz == null) {
                                          return search;
                                      }
                              Severity: Minor
                              Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 1 hr to fix

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

                                    private String parseTypeRef() {
                                        CharacterBuffer typeString = new CharacterBuffer();
                                        /* (void | qualifiedName) <T1, T2> [] ... */
                                        String typeName = SymTabEntry.TYPE_VOID;
                                        if (currentTokenEquals(SymTabEntry.TYPE_VOID)) {
                                Severity: Minor
                                Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseComment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    private CharacterBuffer parseComment(boolean newBlock) {
                                        if (isComment() == false) {
                                            return null;
                                        }
                                        SymTabEntry nextEntity = startNextSymTab(SymTabEntry.TYPE_COMMENT);
                                Severity: Minor
                                Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 findRoleCard has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    private int findRoleCard(String partnerTypeName, GraphModel model) {
                                        int partnerCard = Association.ONE;
                                        if (partnerTypeName == null) {
                                            return partnerCard;
                                        }
                                Severity: Minor
                                Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseAnnotations has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    private String parseAnnotations() {
                                        String result = "";
                                
                                        while ("@".equals(currentWord())) {
                                            result += currentWord();
                                Severity: Minor
                                Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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

                                Avoid deeply nested control flow statements.
                                Open

                                                        if (previousTokenKindEquals('\\') == false || prevprevTokenKind == '\\') {
                                                            break;
                                                        }
                                Severity: Major
                                Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 45 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                          if (methodName.startsWith("with") || methodName.startsWith("set") || methodName.startsWith("get")
                                                  || methodName.startsWith("add") || methodName.startsWith("remove") || methodName.startsWith("create")) {
                                  
                                              SimpleList<SymTabEntry> attributes = new SimpleList<SymTabEntry>();
                                              for (String key : symTab.keySet()) {
                                  Severity: Major
                                  Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if (methodName.startsWith("with") || methodName.startsWith("set") || methodName.startsWith("get")
                                                    || methodName.startsWith("add") || methodName.startsWith("remove") || methodName.startsWith("create")) {
                                    
                                                SimpleList<SymTabEntry> assoc = new SimpleList<SymTabEntry>();
                                                for (String key : symTab.keySet()) {
                                    Severity: Major
                                    Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 40 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                                          return;
                                      Severity: Major
                                      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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/parser/ParserEntity.java - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

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

                                            Avoid too many return statements within this method.
                                            Open

                                                                return; /* <==== sudden death */
                                            Severity: Major
                                            Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

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

                                                Avoid too many return statements within this method.
                                                Open

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

                                                  Avoid too many return statements within this method.
                                                  Open

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

                                                    Avoid too many return statements within this method.
                                                    Open

                                                            return true;
                                                    Severity: Major
                                                    Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                              return findClassInModel(name);
                                                      Severity: Major
                                                      Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                            return modelClass;
                                                        Severity: Major
                                                        Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.java - About 30 mins to fix

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

                                                              private String parseFormalParamList() {
                                                                  StringBuilder paramList = new StringBuilder().append('(');
                                                          
                                                                  /* '(' (type name[,] )* ') [throws type , (type,)*] */
                                                                  skip("(", true);
                                                          Severity: Minor
                                                          Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              public Clazz parse(CharacterBuffer sequence) {
                                                                  if (this.code == null) {
                                                                      /* FIX IT */
                                                                      this.code = new SourceCode();
                                                                      this.code.with(new Clazz(""));
                                                          Severity: Minor
                                                          Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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 parseGenericTypeDefPart has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              private void parseGenericTypeDefPart(CharacterBuffer typeString) {
                                                                  /* <T, T, ...> */
                                                                  skip("<", false);
                                                                  typeString.with('<');
                                                          
                                                          
                                                          Severity: Minor
                                                          Found in src/main/java/de/uniks/networkparser/parser/ParserEntity.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        int preCommentStartPos = currentToken.preCommentStartPos; */

                                                          FIXME found
                                                          Open

                                                          /*FIXME                nextEntity.withPreComment(preCommentStartPos, preCommentEndPos); */

                                                          FIXME found
                                                          Open

                                                              /* FIXME REMOVE */

                                                          FIXME found
                                                          Open

                                                          /* FIXME        .withPreComment(preCommentStartPos, preCommentEndPos); */

                                                          FIXME found
                                                          Open

                                                          /* FIXME                nextEntity.withPreComment(preCommentStartPos, preCommentEndPos); */

                                                          FIXME found
                                                          Open

                                                          /* FIXME            nextEntity.withPreComment(preCommentStartPos, preCommentEndPos); */

                                                          FIXME found
                                                          Open

                                                          /* FIXME        int preCommentStartPos = currentToken.preCommentStartPos; */

                                                          TODO found
                                                          Open

                                                                      /* TODO: should check for superclass ModelSet */

                                                          FIXME found
                                                          Open

                                                          /* FIXME                nextEntity.withPreComment(preCommentStartPos, preCommentEndPos); */

                                                          FIXME found
                                                          Open

                                                                          /* FIXME handleAssoc(memberName, card, partnerClassName, partnerClass, qualifiedName.substring("value.addTo".length())); */

                                                          FIXME found
                                                          Open

                                                          /* FIXME                    nextEntity.withPreComment(preCommentStartPos, preCommentEndPos); */

                                                          FIXME found
                                                          Open

                                                                                  /* FIXME nextEntity.withPreComment(preCommentStartPos, preCommentEndPos); */

                                                          FIXME found
                                                          Open

                                                          /* FIXME        String[] split = memberName.split(":"); */

                                                          These nested if statements could be combined
                                                          Open

                                                                                  if (previousTokenKindEquals('\\') == false || prevprevTokenKind == '\\') {
                                                                                      break;
                                                                                  }

                                                          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
                                                           }
                                                          }

                                                          Avoid using a branching statement as the last in a loop.
                                                          Open

                                                                              break;

                                                          AvoidBranchingStatementAsLastInLoop

                                                          Since: PMD 5.0

                                                          Priority: Medium High

                                                          Categories: Style

                                                          Remediation Points: 50000

                                                          Using a branching statement as the last part of a loop may be a bug, and/or is confusing. Ensure that the usage is not a bug, or consider using another approach.

                                                          Example:

                                                          // unusual use of branching statement in a loop
                                                          for (int i = 0; i < 10; i++) {
                                                           if (i*i <= 25) {
                                                           continue;
                                                           }
                                                           break;
                                                          }
                                                          
                                                          // this makes more sense...
                                                          for (int i = 0; i < 10; i++) {
                                                           if (i*i > 25) {
                                                           break;
                                                           }
                                                          }

                                                          These nested if statements could be combined
                                                          Open

                                                                          if (search.getReturnType().equals(method.getReturnType())) {
                                                                              /* Check all Parameter */
                                                                              ParameterSet searchParam = search.getParameters();
                                                                              ParameterSet param = method.getParameters();
                                                                              if (searchParam.size() == param.size()) {

                                                          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
                                                           }
                                                          }

                                                          These nested if statements could be combined
                                                          Open

                                                                          if (logger != null) {
                                                                              logger.debug(this, "parsing", "Parsing: " + getCurrentLine());
                                                                          }

                                                          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