Showing 958 of 958 total issues
Function adjustRowNumbersFromLRI
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private adjustRowNumbersFromLRI(): int {
if (this.detectionResultColumns[0] == null) {
return 0;
}
let unadjustedCount: int = 0;
- 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
Function getRowIndicatorColumn
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private static getRowIndicatorColumn(image: BitMatrix,
boundingBox: BoundingBox,
startPoint: ResultPoint,
leftToRight: boolean,
minCodewordWidth: int,
- 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
Function findAsteriskPattern
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private static findAsteriskPattern(row: BitArray, counters: Int32Array): number[] {
let width = row.getSize();
let rowOffset = row.getNextSet(0);
let counterPosition = 0;
- 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
Function decodeRow
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public decodeRow(rowNumber: number, row: BitArray, hints?: Map<DecodeHintType, any>): Result {
for (let reader of this.readers) {
try {
// const result: Result = reader.decodeRow(rowNumber, row, startGuardPattern, hints);
const result = reader.decodeRow(rowNumber, row, hints);
- 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
Function recordPattern
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected static recordPattern(row: BitArray, start: number, counters: Int32Array): void {
const numCounters = counters.length;
for (let index = 0; index < numCounters; index++)
counters[index] = 0;
- 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
Function place
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public place(): void {
let pos = 0;
let row = 4;
let col = 0;
Function findStartPattern
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static findStartPattern(row: BitArray): Int32Array {
const width = row.getSize();
const rowOffset = row.getNextSet(0);
let counterPosition = 0;
Function extractBits
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private extractBits(matrix: BitMatrix): boolean[] {
let compact = this.ddata.isCompact();
let layers = this.ddata.getNbLayers();
let baseMatrixSize = (compact ? 11 : 14) + layers * 4; // not including alignment lines
let alignmentMap = new Int32Array(baseMatrixSize);
Function findFinderPattern
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private findFinderPattern(row: BitArray, rightFinderPattern: boolean): number[] {
let counters = this.getDecodeFinderCounters();
counters[0] = 0;
counters[1] = 0;
Similar blocks of code found in 2 locations. Consider refactoring. Open
multiply(a: number, b: number): number {
if (a === 0 || b === 0) {
return 0;
}
return this.expTable[(this.logTable[a] + this.logTable[b]) % (this.modulus - 1)];
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 66.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for (let y = 0; y < height; y++) {
const outputOffset = y * width;
System.arraycopy(this.yuvData, inputOffset, matrix, outputOffset, width);
inputOffset += this.dataWidth;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 66.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for (let y = 0; y < height; y++) {
const outputOffset = y * width;
System.arraycopy(this.luminances, inputOffset, matrix, outputOffset, width);
inputOffset += this.dataWidth;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 66.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public multiply(a: number /*int*/, b: number /*int*/): number /*int*/ {
if (a === 0 || b === 0) {
return 0;
}
return this.expTable[
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 66.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function encodeECC200
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static encodeECC200(codewords: string, symbolInfo: SymbolInfo) {
if (codewords.length !== symbolInfo.getDataCapacity()) {
throw new Error(
'The number of codewords does not match the selected symbol'
);
Function getNumberOfC40Words
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getNumberOfC40Words(
input: Input,
from: number,
c40: boolean,
characterLength: number[]
Function toGrayscaleBuffer
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static toGrayscaleBuffer(imageBuffer: Uint8ClampedArray, width: number, height: number, doAutoInvert: boolean = false): Uint8ClampedArray {
const grayscaleBuffer = new Uint8ClampedArray(width * height);
HTMLCanvasElementLuminanceSource.FRAME_INDEX = !HTMLCanvasElementLuminanceSource.FRAME_INDEX;
if (HTMLCanvasElementLuminanceSource.FRAME_INDEX || !doAutoInvert) {
for (let i = 0, j = 0, length = imageBuffer.length; i < length; i += 4, j++) {
Function sizeOfBlackWhiteBlackRun
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private sizeOfBlackWhiteBlackRun(fromX: number /*int*/, fromY: number /*int*/, toX: number /*int*/, toY: number /*int*/): number/*float*/ {
// Mild variant of Bresenham's algorithm
// see http://en.wikipedia.org/wiki/Bresenham's_line_algorithm
const steep: boolean = Math.abs(toY - fromY) > Math.abs(toX - fromX);
if (steep) {
Function parseInformation
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public parseInformation(): string {
if (
this.getInformation().getSize() <
AI01393xDecoder.HEADER_SIZE + AI01decoder.GTIN_SIZE
) {
Function updateStateForChar
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private updateStateForChar(
state: State,
index: int,
result: Collection<State>
): void {
Function encode
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public encode(): BitArray {
const spaceCharCode = StringUtils.getCharCode(' ');
const lineBreakCharCode = StringUtils.getCharCode('\n');