fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/yaml/YAMLTokener.java

Summary

Maintainability
F
3 days
Test Coverage

Method parseObjectTableAttrs has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

    private void parseObjectTableAttrs(CharacterBuffer currentToken, Buffer buffer) {
        /* skip column names */
        if (currentToken == null || map == null) {
            return;
        }
Severity: Minor
Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.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 parseLine has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    protected int parseLine(int deep, EntityList owner, Buffer buffer) {
        if (buffer == null) {
            return 0;
        }
        char c = buffer.getCurrentChar();
Severity: Minor
Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.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 decode has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public Object decode(String yaml) {
        CharacterBuffer buffer = new CharacterBuffer().with(yaml);
        Object root = null;
        refs = new SimpleKeyValueList<Object, SimpleKeyValueList<String, SimpleList<String>>>();
        while (buffer.isEnd() == false) {
Severity: Minor
Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.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 parseLine has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected int parseLine(int deep, EntityList owner, Buffer buffer) {
        if (buffer == null) {
            return 0;
        }
        char c = buffer.getCurrentChar();
Severity: Major
Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.java - About 2 hrs to fix

    Method parseObjectTableAttrs has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private void parseObjectTableAttrs(CharacterBuffer currentToken, Buffer buffer) {
            /* skip column names */
            if (currentToken == null || map == null) {
                return;
            }
    Severity: Major
    Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.java - About 2 hrs to fix

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

          private boolean setValue(SendableEntityCreator creator, Object obj, String attrName, String attrValue) {
              if (map == null) {
                  return false;
              }
              Object targetObj = map.getObject(attrValue);
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.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 setValue has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private boolean setValue(SendableEntityCreator creator, Object obj, String attrName, String attrValue) {
              if (map == null) {
                  return false;
              }
              Object targetObj = map.getObject(attrValue);
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.java - About 1 hr to fix

        Method decode has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public Object decode(String yaml) {
                CharacterBuffer buffer = new CharacterBuffer().with(yaml);
                Object root = null;
                refs = new SimpleKeyValueList<Object, SimpleKeyValueList<String, SimpleList<String>>>();
                while (buffer.isEnd() == false) {
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.java - About 1 hr to fix

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

              private Object parseUsualObjectAttrs(CharacterBuffer currentToken, Buffer buffer) {
                  if (buffer == null || currentToken == null || map == null) {
                      return null;
                  }
                  String objectId = currentToken.trimEnd(1).toString();
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.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 (currentToken.endsWith("]", true)) {
                                      value = currentToken.substring(0, currentToken.length() - 1);
                                  }
          Severity: Major
          Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.java - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (value != null) {
                                        creator.setValue(entity, attribute, value, SendableEntityCreator.NEW);
                                    }
            Severity: Major
            Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.java - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (value.trim().equals("") == false ) {
                                          setValue(creator, obj, attrName, value);
                                      }
              Severity: Major
              Found in src/main/java/de/uniks/networkparser/yaml/YAMLTokener.java - About 45 mins to fix

                There are no issues that match your filters.

                Category
                Status