fujaba/NetworkParser

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

Summary

Maintainability
B
5 hrs
Test Coverage

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

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

    public static boolean setValue(String key, Object value) {
        if (PROPERTY_EDITABLE.equals(key)) {
            if (value instanceof Boolean) {
                StartData.editable = (Boolean) value;
                return true;
Severity: Minor
Found in src/main/java/de/uniks/networkparser/ext/StartData.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 getValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

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

    public static Integer getInteger(String key) {
        if (key == null) {
            return null;
        }
        for (StartElement item : properties) {
Severity: Minor
Found in src/main/java/de/uniks/networkparser/ext/StartData.java - About 35 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

Method getString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static String getString(String key) {
        if (key == null) {
            return "";
        }
        for (StartElement item : properties) {
Severity: Minor
Found in src/main/java/de/uniks/networkparser/ext/StartData.java - About 35 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 null;
Severity: Major
Found in src/main/java/de/uniks/networkparser/ext/StartData.java - About 30 mins to fix

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

        public static boolean load() {
            IdMap map = new IdMap();
            map.with(StartData.instance());
            CharacterBuffer readFile = FileBuffer.readFile(StartData.fileName);
            if (readFile.length() < 1) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/ext/StartData.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