fujaba/NetworkParser

View on GitHub

Showing 3,691 of 4,645 total issues

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

    public String toBinaryString() {
        if (values == null || values.length < 1) {
            return "";
        }
        byte[] result = new byte[values.length * 9 + 9];
Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/ByteEntity.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

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

    private static boolean embedTimingPatterns(ByteMatrix matrix) {
        if (matrix == null) {
            return false;
        }
        /*
Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/qr/QRTokener.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

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

    private static void embedPositionDetectionPattern(int xStart, int yStart, ByteMatrix matrix) {
        if (matrix != null) {
            for (int y = 0; y < 7; ++y) {
                for (int x = 0; x < 7; ++x) {
                    matrix.set(xStart + x, yStart + y, POSITION_DETECTION_PATTERN[y][x]);
Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/qr/QRTokener.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

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

    static Version decodeVersionInformation(int versionBits) {
        int bestDifference = Integer.MAX_VALUE;
        int bestVersion = 0;
        for (int i = 0; i < VERSION_DECODE_INFO.length; i++) {
            int targetVersion = VERSION_DECODE_INFO[i];
Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/qr/Version.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

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

    FormatInformation readFormatInformation() {
        if (parsedFormatInfo != null || bitMatrix == null) {
            return parsedFormatInfo;
        }

Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/qr/BitMatrixParser.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

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

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

    private void initDate() {
        if (items != null && !isInitConstants) {
            /* Month */
            for (int i = 0; i < 12; i++) {
                monthOfYear[i] = items.getText(monthOfYear[i], this, null);
Severity: Minor
Found in src/main/java/de/uniks/networkparser/DateTimeEntity.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

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

    public int[] getGenTable() {
        int[] result = new int[256];
        for (int b = 0; b < 256; b++) {
            int v = b;
            for (int i = 8; i > 0; i--) {
Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/FCS16.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

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

    static boolean getNumDataBytesAndNumECBytesForBlockID(int numTotalBytes, int numDataBytes, int numRSBlocks,
            int blockID, int[] numDataBytesInBlock, int[] numECBytesInBlock) {
        if (blockID >= numRSBlocks) {
            return false; /* "Block ID too large"; */
        }
Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/qr/QRTokener.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

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

    protected String getId(SendableEntityCreator creator, MapEntity map, Object entity, String className) {
        String id = null;
        Object temp = null;
        if (creator instanceof SendableEntityCreatorIndexId) {
            temp = creator.getValue(entity, IdMap.ID);
Severity: Minor
Found in src/main/java/de/uniks/networkparser/IdMap.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

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

    @Override
    public boolean update(Object value) {
        if (value instanceof SimpleEvent == false) {
            return false;
        }
Severity: Minor
Found in src/main/java/de/uniks/networkparser/logic/MapCondition.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

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

    @Override
    public Object getValue(LocalisationInterface value) {
        if (value instanceof SendableEntityCreator) {
            SendableEntityCreator variables = (SendableEntityCreator) value;
            Object object = variables.getValue(variables, this.key);
Severity: Minor
Found in src/main/java/de/uniks/networkparser/logic/Equals.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

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

    private void perform() {
        for (int t = 16; t < 80; t++) {
            int x = w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16];
            w[t] = ((x << 1) | (x >>> 31));
        }
Severity: Minor
Found in src/main/java/de/uniks/networkparser/bytes/SHA1.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

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

    public boolean log(String type, Object... args) {
        if (type == null || condition == null || args == null) {
            return false;
        }
        if (args.length == 1) {
Severity: Minor
Found in src/main/java/de/uniks/networkparser/NetworkParserLog.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

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

    public boolean updateSet(Object evt) {
        Set<ObjectCondition> list = getList();
        boolean result = true;
        for (ObjectCondition item : list) {
            if (item.update(evt) == false) {
Severity: Minor
Found in src/main/java/de/uniks/networkparser/logic/ListCondition.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

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

    public SimpleKeyValueList<K, V> addToKeyValue(Object key, Number value) {
        int pos = hasKeyAndPos(key);
        if (pos < 0) {
            return this;
        }
Severity: Minor
Found in src/main/java/de/uniks/networkparser/list/SimpleKeyValueList.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

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

    @Override
    public void publish(LogRecord record) {
        if (global != null && global != this) {
            global.publish(record);
            return;
Severity: Minor
Found in src/main/java/de/uniks/networkparser/NetworkParserLog.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

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

  private int retransformIndex(int index, int size) {
    if (elements[DELETED] != null) {
      Object[] items = (Object[]) elements[DELETED];
      for (int i = 0; i < items.length; i++) {
        if (((Integer) items[i]) > index) {
Severity: Minor
Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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

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

    public int convert(Object entity, String property, Object value, IdMap map, int deep) {
        if (this.convertable == null && this.property == null) {
            return 1;
        }
        SimpleEvent event = new SimpleEvent(this.strategy, map, property, deep, null, entity, value, null);
Severity: Minor
Found in src/main/java/de/uniks/networkparser/Filter.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

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

  public void pack() {
    if (elements == null) {
      return;
    }
    boolean complex = isComplex(size);
Severity: Minor
Found in src/main/java/de/uniks/networkparser/list/AbstractArray.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

Severity
Category
Status
Source
Language