fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/TextItems.java

Summary

Maintainability
D
1 day
Test Coverage

Method parseJsonObject has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean parseJsonObject(Entity item, String parent, boolean ignoreCase) {
        if (item == null) {
            return false;
        }
        for (int i = 0; i < item.size(); i++) {
Severity: Minor
Found in src/main/java/de/uniks/networkparser/TextItems.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 getText has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public String getText(CharSequence label, Object model, Object gui) {
        if (label == null) {
            return null;
        }
Severity: Minor
Found in src/main/java/de/uniks/networkparser/TextItems.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

TextItems has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

public class TextItems extends SimpleKeyValueList<String, Object>
        implements SendableEntityCreator, LocalisationInterface {
    public static final String PROPERTY_VALUE = "value";
    private LocalisationInterface customLanguage = null;
    private ObjectCondition listener = null;
Severity: Minor
Found in src/main/java/de/uniks/networkparser/TextItems.java - About 2 hrs to fix

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

        private boolean parseJsonObject(Entity item, String parent, boolean ignoreCase) {
            if (item == null) {
                return false;
            }
            for (int i = 0; i < item.size(); i++) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/TextItems.java - About 1 hr to fix

      Method getText has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          public String getText(CharSequence label, Object model, Object gui) {
              if (label == null) {
                  return null;
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/TextItems.java - About 1 hr to fix

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

            @Override
            public String get(Object key) {
                if (key == null || key instanceof String == false) {
                    return null;
                }
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/TextItems.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 too many return statements within this method.
        Open

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

            Avoid too many return statements within this method.
            Open

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

              There are no issues that match your filters.

              Category
              Status