oglimmer/ggo

View on GitHub
atmosphere-mvc/src/main/java/de/oglimmer/atmospheremvc/util/Json.java

Summary

Maintainability
A
1 hr
Test Coverage

Method existsOrChanged has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private JsonNode existsOrChanged(JsonNode nodeToFind, ArrayNode arrayToSearchThrough) {
        if (nodeToFind.isObject()) {
            for (Iterator<JsonNode> it = arrayToSearchThrough.elements(); it.hasNext();) {
                JsonNode elementInArray = it.next();
                assert elementInArray.isObject();
Severity: Minor
Found in atmosphere-mvc/src/main/java/de/oglimmer/atmospheremvc/util/Json.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

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

    private void diffEntry(ObjectNode diffNode, String key, JsonNode oldValue, JsonNode newValue) {
        if (newValue != null && newValue.isArray()) {
            diffArray(diffNode, key, oldValue, newValue);
        } else if (newValue != null && newValue.isObject()) {
            diffObject(diffNode, key, oldValue, newValue);
Severity: Minor
Found in atmosphere-mvc/src/main/java/de/oglimmer/atmospheremvc/util/Json.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 diffPrimitive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private void diffPrimitive(ObjectNode diffNode, String key, JsonNode oldValue, JsonNode newValue) {
        assert newValue == null || !newValue.isContainerNode();
        assert oldValue == null || !oldValue.isContainerNode();
        if ((newValue == null && oldValue != null) || (newValue != null && !newValue.equals(oldValue))) {
            diffNode.set(key, newValue);
Severity: Minor
Found in atmosphere-mvc/src/main/java/de/oglimmer/atmospheremvc/util/Json.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