hackedteam/vector-edk

View on GitHub
vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java

Summary

Maintainability
D
1 day
Test Coverage

File LzmaBench.java has 349 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package SevenZip;

import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
Severity: Minor
Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java - About 4 hrs to fix

    Method LzmaBenchmark has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static public int LzmaBenchmark(int numIterations, int dictionarySize) throws Exception
        {
            if (numIterations <= 0)
                return 0;
            if (dictionarySize < (1 << 18))
    Severity: Major
    Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java - About 3 hrs to fix

      Method LzmaBenchmark has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          static public int LzmaBenchmark(int numIterations, int dictionarySize) throws Exception
          {
              if (numIterations <= 0)
                  return 0;
              if (dictionarySize < (1 << 18))
      Severity: Minor
      Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java - About 2 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 Generate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

              public void Generate()
              {
                  RG.Init();
                  Rep0 = 1;
                  while (Pos < BufferSize)
      Severity: Minor
      Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java - About 2 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 GetTotalRating has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                  int dictionarySize,
                  long elapsedTimeEn, long sizeEn,
                  long elapsedTimeDe,
                  long inSizeDe, long outSizeDe)
      Severity: Minor
      Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java - About 45 mins to fix

        Method PrintResults has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                    int dictionarySize,
                    long elapsedTime,
                    long size,
                    boolean decompressMode, long secondSize)
        Severity: Minor
        Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.java - About 35 mins to fix

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

              static int GetLogSize(int size)
              {
                  for (int i = kSubBits; i < 32; i++)
                      for (int j = 0; j < (1 << kSubBits); j++)
                          if (size <= ((1) << i) + (j << (i - kSubBits)))
          Severity: Minor
          Found in vector-uefi/insyde/7zip/Java/SevenZip/LzmaBench.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