Showing 605 of 958 total issues
Function createECCBlock
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static createECCBlock(codewords: string, numECWords: number): string {
let table = -1;
for (let i = 0; i < FACTOR_SETS.length; i++) {
if (FACTOR_SETS[i] === numECWords) {
table = i;
Function readCodewords
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public readCodewords(): Uint8Array /*throws FormatException*/ {
const formatInfo = this.readFormatInformation();
const version = this.readVersion();
Function detect
has 37 lines of code (exceeds 25 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;
Function runEuclideanAlgorithm
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private runEuclideanAlgorithm(a: ModulusPoly, b: ModulusPoly, R: int): ModulusPoly[] {
// Assume a's degree is >= b's
if (a.getDegree() < b.getDegree()) {
let temp: ModulusPoly = a;
a = b;
Function adjustRowNumbers
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private adjustRowNumbers(barcodeColumn: int, codewordsRow: int, codewords: Codeword[]): void {
if (this.detectionResultColumns[barcodeColumn - 1] == null) {
return;
}
Function getDataBytes
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
getDataBytes(): Uint8Array {
switch (this.mode) {
case Mode.ASCII:
if (this.input.isECI(this.fromPosition)) {
return Edge.getBytes(
Function transitionsBetween
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private transitionsBetween(from: ResultPoint, to: ResultPoint): int {
// See QR Code Detector, sizeOfBlackWhiteBlackRun()
let fromX = Math.trunc(from.getX());
let fromY = Math.trunc(from.getY());
let toX = Math.trunc(to.getX());
Function readBits
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public readBits(numBits: number /*int*/): number /*int*/ {
if (numBits < 1 || numBits > 32 || numBits > this.available()) {
throw new IllegalArgumentException('' + numBits);
}
Function toNarrowWidePattern
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static toNarrowWidePattern(counters: Int32Array): number {
let numCounters = counters.length;
let maxNarrowCounter = 0;
let wideCounters: number;
do {
Function lookAheadTest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static lookAheadTest(
msg: string,
startpos: number,
currentMode: number
): 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 decodeMacroBlock
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static decodeMacroBlock(codewords: Int32Array, codeIndex: int, resultMetadata: PDF417ResultMetadata): int {
if (codeIndex + DecodedBitStreamParser.NUMBER_OF_SEQUENCE_CODEWORDS > codewords[0]) {
// we must have at least two bytes left for the segment index
throw FormatException.getFormatInstance();
}
- 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 getEndMode
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
getEndMode(): Mode {
if (this.mode === Mode.EDF) {
if (this.characterLength < 4) {
return Mode.ASCII;
}
- 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 selectBestPatterns
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private selectBestPatterns(): FinderPattern[] /*throws NotFoundException */ {
const startSize = this.possibleCenters.length;
if (startSize < 3) {
// Couldn't find enough finder patterns
- 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 doDecodeFormatInformation
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static doDecodeFormatInformation(maskedFormatInfo1: number /*int*/, maskedFormatInfo2: number /*int*/): FormatInformation {
// Find the int in FORMAT_INFO_DECODE_LOOKUP with fewest bits differing
let bestDifference = Number.MAX_SAFE_INTEGER;
let bestFormatInfo = 0;
for (const decodeInfo of FormatInformation.FORMAT_INFO_DECODE_LOOKUP) {
- 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 getClosestDecodedValue
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static getClosestDecodedValue(moduleBitCount: Int32Array): int {
let bitCountSum: int = MathUtils.sum(moduleBitCount);
let bitCountRatios: float[] = new Array(PDF417Common.BARS_IN_MODULE);
if (bitCountSum > 1) {
for (let /*int*/ i = 0; i < bitCountRatios.length; i++) {
- 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 getCodewordNearby
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
/*final*/ getCodewordNearby(imageRow: int): Codeword {
let codeword = this.getCodeword(imageRow);
if (codeword != null) {
return codeword;
}
- 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 containsBlackPoint
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private containsBlackPoint(a: number, b: number, fixed: number, horizontal: boolean): boolean {
if (horizontal) {
for (let x = a; x <= b; x++) {
if (this.image.get(x, fixed)) {
- 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 sampleGridWithTransform
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public sampleGridWithTransform(image: BitMatrix,
dimensionX: number /*int*/,
dimensionY: number /*int*/,
transform: PerspectiveTransform): BitMatrix /*throws NotFoundException*/ {
if (dimensionX <= 0 || dimensionY <= 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 containsBlackPoint
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private containsBlackPoint(a: number /*int*/, b: number /*int*/, fixed: number /*int*/, horizontal: boolean): boolean {
const image = this.image;
if (horizontal) {
- 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 readBits
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public readBits(numBits: number /*int*/): number /*int*/ {
if (numBits < 1 || numBits > 32 || numBits > this.available()) {
throw new IllegalArgumentException('' + numBits);
}
- 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"