fujaba/NetworkParser

View on GitHub
src/main/java/de/uniks/networkparser/bytes/qr/GenericGFPoly.java

Summary

Maintainability
C
7 hrs
Test Coverage

Method toString has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public String toString() {
        StringBuilder result = new StringBuilder(8 * getDegree());
        for (int degree = getDegree(); degree >= 0; degree--) {
            int coefficient = getCoefficient(degree);
Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/qr/GenericGFPoly.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

Method toString has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    public String toString() {
        StringBuilder result = new StringBuilder(8 * getDegree());
        for (int degree = getDegree(); degree >= 0; degree--) {
            int coefficient = getCoefficient(degree);
Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/qr/GenericGFPoly.java - About 1 hr to fix

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

        GenericGFPoly addOrSubtract(GenericGFPoly other) {
            if (field == null || field.equals(other.field) == false) {
                return null;
            }
            if (isZero()) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/bytes/qr/GenericGFPoly.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 multiply has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        GenericGFPoly multiply(GenericGFPoly other) {
            if (field == null || field.equals(other.field) == false) {
                return null;
            }
            if (isZero() || other.isZero()) {
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/bytes/qr/GenericGFPoly.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 evaluateAt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        int evaluateAt(int a) {
            if (a == 0 || coefficients == null) {
                /* Just return the x^0 coefficient */
                return getCoefficient(0);
            }
    Severity: Minor
    Found in src/main/java/de/uniks/networkparser/bytes/qr/GenericGFPoly.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