fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/ext/javafx/DiceController.java

Summary

Maintainability
D
1 day
Test Coverage

File DiceController.java has 317 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.ext.javafx;

/*
NetworkParser
The MIT License
Severity: Minor
Found in src/main/java/de/uniks/networkparser/ext/javafx/DiceController.java - About 3 hrs to fix

    DiceController has 25 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class DiceController extends SendableItem
            implements PropertyChangeListener, SendableEntityCreator, ObjectCondition {
        public static final String PROPERTY_CLICK = "click";
        public static final String PROPERTY_VALUE = "value";
        public static final String STOPPED = "STOPPED";
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/javafx/DiceController.java - About 2 hrs to fix

      Method showAnimation has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @SuppressWarnings("unchecked")
          public DiceController showAnimation(int number) {
              if(pane == null) {
                  return this;
              }
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/ext/javafx/DiceController.java - About 2 hrs to fix

        Method addListener has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public boolean addListener(Object item, String property, PropertyChangeListener listener) {
                if (item == null) {
                    return false;
                }
                GenericCreator creator = new GenericCreator(item);
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/javafx/DiceController.java - About 1 hr to fix

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

              public boolean addListener(Object item, String property, PropertyChangeListener listener) {
                  if (item == null) {
                      return false;
                  }
                  GenericCreator creator = new GenericCreator(item);
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/ext/javafx/DiceController.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 showNumber has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public void showNumber(int number) {
                  this.reset();
                  if (number == 1) {
                      this.addCircle(2, 2);
                  } else if (number == 2) {
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/ext/javafx/DiceController.java - About 55 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 too many return statements within this method.
          Open

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

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

                    @Override
                    public boolean update(Object value) {
                        if(mouseEventClass == null || value == null) {
                            return false;
                        }
                Severity: Minor
                Found in src/main/java/de/uniks/networkparser/ext/javafx/DiceController.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

                There are no issues that match your filters.

                Category
                Status