fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/gui/TileMap.java

Summary

Maintainability
F
4 days
Test Coverage

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

    @Override
    public Object getValue(Object entity, String attribute) {
        if (entity instanceof TileMap == false) {
            return null;
        }
Severity: Minor
Found in src/main/java/de/uniks/networkparser/gui/TileMap.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 setValue has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean setValue(Object entity, String attribute, Object value, String type) {
        if (entity instanceof TileMap == false) {
            return false;
        }
Severity: Minor
Found in src/main/java/de/uniks/networkparser/gui/TileMap.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 setValue has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public boolean setValue(Object entity, String attribute, Object value, String type) {
        if (entity instanceof TileMap == false) {
            return false;
        }
Severity: Major
Found in src/main/java/de/uniks/networkparser/gui/TileMap.java - About 3 hrs to fix

    Method getValue has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public Object getValue(Object entity, String attribute) {
            if (entity instanceof TileMap == false) {
                return null;
            }
    Severity: Major
    Found in src/main/java/de/uniks/networkparser/gui/TileMap.java - About 3 hrs to fix

      File TileMap.java has 302 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      package de.uniks.networkparser.gui;
      
      /*
      The MIT License
      
      
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/gui/TileMap.java - About 3 hrs to fix

        Avoid deeply nested control flow statements.
        Open

                                if (text.charAt(i) != ',') {
                                    i++;
                                    continue;
                                }
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/gui/TileMap.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/gui/TileMap.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/gui/TileMap.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/gui/TileMap.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/gui/TileMap.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return map.images.first().height;
                  Severity: Major
                  Found in src/main/java/de/uniks/networkparser/gui/TileMap.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/gui/TileMap.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return map.images.first().width;
                      Severity: Major
                      Found in src/main/java/de/uniks/networkparser/gui/TileMap.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/gui/TileMap.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

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

                              Avoid too many return statements within this method.
                              Open

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

                                      Avoid too many return statements within this method.
                                      Open

                                                      return map.images.first().name;
                                      Severity: Major
                                      Found in src/main/java/de/uniks/networkparser/gui/TileMap.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/gui/TileMap.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/gui/TileMap.java - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

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

                                                Avoid too many return statements within this method.
                                                Open

                                                            return map.height;
                                                Severity: Major
                                                Found in src/main/java/de/uniks/networkparser/gui/TileMap.java - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return map.tilewidth;
                                                  Severity: Major
                                                  Found in src/main/java/de/uniks/networkparser/gui/TileMap.java - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

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

                                                        There are no issues that match your filters.

                                                        Category
                                                        Status