fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/logic/VariableCondition.java

Summary

Maintainability
D
2 days
Test Coverage

Method getValue has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    public Object getValue(LocalisationInterface value) {
        if (value instanceof SendableEntityCreator) {
            SendableEntityCreator variables = (SendableEntityCreator) value;
            String key = this.value.toString();
            /* SWITCH FOR # */
Severity: Minor
Found in src/main/java/de/uniks/networkparser/logic/VariableCondition.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 replaceText has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public String replaceText(String name, String format, String value) {
        if (name == null) {
            return name;
        }
        boolean upper = false;
Severity: Minor
Found in src/main/java/de/uniks/networkparser/logic/VariableCondition.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 getValue has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public Object getValue(LocalisationInterface value) {
        if (value instanceof SendableEntityCreator) {
            SendableEntityCreator variables = (SendableEntityCreator) value;
            String key = this.value.toString();
            /* SWITCH FOR # */
Severity: Major
Found in src/main/java/de/uniks/networkparser/logic/VariableCondition.java - About 2 hrs to fix

    Method replaceText has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public String replaceText(String name, String format, String value) {
            if (name == null) {
                return name;
            }
            boolean upper = false;
    Severity: Major
    Found in src/main/java/de/uniks/networkparser/logic/VariableCondition.java - About 2 hrs to fix

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

          public void addAnnotation(Annotation anno, CharacterBuffer buffer, String param, SendableEntityCreator variables) {
              if (anno == null || buffer == null) {
                  return;
              }
              if (param == null && anno.getScope() != null) {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/logic/VariableCondition.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 (child instanceof GraphMember) {
                                  GraphMember member = (GraphMember) child;
                                  if (temp.equalsIgnoreCase(member.getName())) {
                                      return true;
                                  }
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/logic/VariableCondition.java - About 45 mins to fix

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

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

            Avoid too many return statements within this method.
            Open

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

                Avoid too many return statements within this method.
                Open

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

                  Avoid too many return statements within this method.
                  Open

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

                      Avoid too many return statements within this method.
                      Open

                                  return value.substring(start, end);
                      Severity: Major
                      Found in src/main/java/de/uniks/networkparser/logic/VariableCondition.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

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

                          Avoid too many return statements within this method.
                          Open

                                      return value.getText(this.value, null, null);
                          Severity: Major
                          Found in src/main/java/de/uniks/networkparser/logic/VariableCondition.java - About 30 mins to fix

                            There are no issues that match your filters.

                            Category
                            Status