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;
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))
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))
- Read upRead up
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)
- Read upRead up
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)
Method PrintResults
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
int dictionarySize,
long elapsedTime,
long size,
boolean decompressMode, long secondSize)
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)))
- Read upRead up
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"