fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/ext/story/Story.java

Summary

Maintainability
F
3 days
Test Coverage

File Story.java has 482 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.ext.story;

import java.io.PrintStream;
/*
The MIT License
Severity: Minor
Found in src/main/java/de/uniks/networkparser/ext/story/Story.java - About 7 hrs to fix

    Story has 45 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Story extends StoryElement implements Comparable<Story> {
        private String outputFile;
        private SimpleList<ObjectCondition> steps = new SimpleList<ObjectCondition>();
        private int counter = -1;
        private boolean breakOnAssert = true;
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/story/Story.java - About 6 hrs to fix

      Method writeToFile has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean writeToFile(String... fileName) {
              String file = null;
              if(fileName == null) { 
                  file = this.outputFile;
              }else if(fileName.length>0) {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/ext/story/Story.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 addResource has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public static String addResource(HTMLEntity entity, String name, boolean include) {
              name = name.replace('\\', '/');
              if (name.toLowerCase().endsWith(".html") == false) {
                  name += ".html";
              }
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/ext/story/Story.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 writeToFile has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public boolean writeToFile(String... fileName) {
              String file = null;
              if(fileName == null) { 
                  file = this.outputFile;
              }else if(fileName.length>0) {
      Severity: Minor
      Found in src/main/java/de/uniks/networkparser/ext/story/Story.java - About 1 hr to fix

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

            public String getLabel() {
                StoryStepTitle title = getTitle();
                String label = null;
                if(title != null) {
                    label = title.getTitle();
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/story/Story.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 addResource has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static String addResource(HTMLEntity entity, String name, boolean include) {
                name = name.replace('\\', '/');
                if (name.toLowerCase().endsWith(".html") == false) {
                    name += ".html";
                }
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/story/Story.java - About 1 hr to fix

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

              private boolean addCondition(StoryStepCondition step) {
                  if (step == null) {
                      return false;
                  }
                  this.add(step);
          Severity: Minor
          Found in src/main/java/de/uniks/networkparser/ext/story/Story.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 FileBuffer.writeFile(path + file, output.toString(converter)) >= 0;
          Severity: Major
          Found in src/main/java/de/uniks/networkparser/ext/story/Story.java - About 30 mins to fix

            There are no issues that match your filters.

            Category
            Status