Showing 605 of 958 total issues
Function findRowsWithPattern
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private static findRowsWithPattern( matrix: BitMatrix,
height: /*int*/ number,
width: /*int*/ number,
startRow: /*int*/ number,
startColumn: /*int*/ number,
- 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 decodeDataCharacter
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
decodeDataCharacter(
row: BitArray,
pattern: FinderPattern,
isOddPattern: boolean,
leftChar: boolean
Function constructor
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
constructor(
public readonly input: Input,
public readonly mode: Mode,
public readonly fromPosition: number,
public readonly characterLength: number,
- 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 readCodewords
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
readCodewords(): Int8Array {
const result = new Int8Array(this.version.getTotalCodewords());
let resultOffset = 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 embedDataBits
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public static embedDataBits(dataBits: BitArray, maskPattern: number /*int*/, matrix: ByteMatrix): void {
let bitIndex = 0;
let direction = -1;
// Start from the right bottom cell.
let x = matrix.getWidth() - 1;
- 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 createBarcodeMatrix
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private static createBarcodeMatrix(detectionResult: DetectionResult): BarcodeValue[][] {
// let barcodeMatrix: BarcodeValue[][] =
// new BarcodeValue[detectionResult.getBarcodeRowCount()][detectionResult.getBarcodeColumnCount() + 2];
let barcodeMatrix: BarcodeValue[][] =
Array.from({ length: detectionResult.getBarcodeRowCount() }, () => new Array(detectionResult.getBarcodeColumnCount() + 2));
- 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 setHints
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public setHints(hints?: Map<DecodeHintType, any> | null): void {
this.hints = hints;
const tryHarder: boolean = hints !== null && hints !== undefined && undefined !== hints.get(DecodeHintType.TRY_HARDER);
/*@SuppressWarnings("unchecked")*/
- 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 find
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public find(hints: Map<DecodeHintType, any>): FinderPatternInfo /*throws NotFoundException */ {
const tryHarder: boolean = (hints !== null && hints !== undefined) && undefined !== hints.get(DecodeHintType.TRY_HARDER);
const pureBarcode: boolean = (hints !== null && hints !== undefined) && undefined !== hints.get(DecodeHintType.PURE_BARCODE);
const image = this.image;
const maxI = image.getHeight();
Function decodeIsoIec646
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeIsoIec646(pos: number): DecodedChar {
let fiveBitValue = this.extractNumericValueFromBitArray(pos, 5);
if (fiveBitValue === 15) {
return new DecodedChar(pos + 5, DecodedChar.FNC1);
}
Function constructor
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
public readonly input: Input,
public readonly mode: Mode,
public readonly fromPosition: number,
public readonly characterLength: number,
Function detect
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
public detect(): ResultPoint[] {
let left = this.leftInit;
let right = this.rightInit;
let up = this.upInit;
File BitMatrixParser.ts
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
import BitMatrix from '../../common/BitMatrix';
import Version from './Version';
import FormatException from '../../FormatException';
import IllegalArgumentException from '../../IllegalArgumentException';
Function place
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public place(): void {
let pos = 0;
let row = 4;
let col = 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 adjustCompleteIndicatorColumnRowNumbers
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
adjustCompleteIndicatorColumnRowNumbers(barcodeMetadata: BarcodeMetadata): void {
let codewords: Codeword[] = this.getCodewords();
this.setRowNumbers();
this.removeIncorrectCodewords(codewords, barcodeMetadata);
let boundingBox: BoundingBox = this.getBoundingBox();
- 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 getStartColumn
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private static getStartColumn(detectionResult: DetectionResult,
barcodeColumn: int,
imageRow: int,
leftToRight: boolean): int {
let offset: int = leftToRight ? 1 : -1;
- 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 detect
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private static detect( multiple: boolean, bitMatrix: BitMatrix): Array<ResultPoint[]> {
const barcodeCoordinates = new Array<ResultPoint[]>();
let row = 0;
let column = 0;
let foundBarcodeInRow = false;
- 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 decodeTextSegment
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static decodeTextSegment(bits: BitSource, result: StringBuilder): void {
// Three Text values are encoded in a 16-bit value as
// (1600 * C1) + (40 * C2) + C3 + 1
// TODO(bbrown): The Upper Shift with Text doesn't work in the 4 value scenario all the time
let upperShift = false;
Function encode
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public encode(
contents: string,
format: BarcodeFormat,
width: number,
height: number,
Function decodeDataCharacter
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeDataCharacter(row: BitArray, pattern: FinderPattern, outsideChar: boolean): DataCharacter {
let counters = this.getDataCharacterCounters();
for (let x = 0; x < counters.length; x++) {
counters[x] = 0;
Function constructor
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
constructor(solution: Edge) {
const input = solution.input;
let size = 0;
let bytesAL: number[] = [];
const randomizePostfixLength = [];
- 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"