fujaba/NetworkParser

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

Summary

Maintainability
D
2 days
Test Coverage

File StoryStepJUnit.java has 398 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package de.uniks.networkparser.ext.story;

/*
The MIT License

Severity: Minor
Found in src/main/java/de/uniks/networkparser/ext/story/StoryStepJUnit.java - About 5 hrs to fix

    Method writeResult has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        public boolean writeResult(Object source, Object newElement) {
            if(source == null) {
                return false;
            }
            if(newElement instanceof HTMLEntity == false) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/story/StoryStepJUnit.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

    StoryStepJUnit has 32 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class StoryStepJUnit extends StoryElement implements ObjectCondition {
        private static final String BLACKBOXFILE = "backbox.txt";
        private ReflectionBlackBoxTester tester = new ReflectionBlackBoxTester();
        private NetworkParserLog logger = new NetworkParserLog().withListener(this);
        private String packageName = null;
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/story/StoryStepJUnit.java - About 4 hrs to fix

      Method writeResult has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public boolean writeResult(Object source, Object newElement) {
              if(source == null) {
                  return false;
              }
              if(newElement instanceof HTMLEntity == false) {
      Severity: Major
      Found in src/main/java/de/uniks/networkparser/ext/story/StoryStepJUnit.java - About 2 hrs to fix

        Method createElement has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            public Object createElement(Clazz element, Object... values) {
                SendableEntityCreator creator = map.getCreator(element.getName(false), true);
                if (creator != null) {
                    Object newInstance = null;
                    try {
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/story/StoryStepJUnit.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 withUseCase has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public StoryStepJUnit withUseCase(Story story, GraphModel model) {
                this.map = new IdMap();
                this.model = model;
                if (this.column != null) {
                    story.add(this);
        Severity: Minor
        Found in src/main/java/de/uniks/networkparser/ext/story/StoryStepJUnit.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 deeply nested control flow statements.
        Open

                                    if (proz < 50) {
                                        level = 2;
                                    } else if (proz < 80) {
                                        level = 1;
                                    }
        Severity: Major
        Found in src/main/java/de/uniks/networkparser/ext/story/StoryStepJUnit.java - About 45 mins to fix

          There are no issues that match your filters.

          Category
          Status