Showing 958 of 958 total issues
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"
Further reading
Function findErrorMagnitudes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private findErrorMagnitudes(errorEvaluator: GenericGFPoly, errorLocations: Int32Array): Int32Array {
// This is directly applying Forney's Formula
const s = errorLocations.length;
const result = new Int32Array(s);
const field = this.field;
- 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 getModuleBitCount
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static getModuleBitCount(image: BitMatrix,
minColumn: int,
maxColumn: int,
leftToRight: boolean,
startColumn: 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 isRange
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public isRange(start: number /*int*/, end: number /*int*/, value: boolean): boolean {
if (end < start || start < 0 || end > this.size) {
throw new IllegalArgumentException();
}
if (end === start) {
- 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 findGuardPattern
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static findGuardPattern(
row: BitArray,
rowOffset: number,
pattern: Int32Array
): 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 findAsteriskPattern
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private findAsteriskPattern(row: BitArray): Int32Array {
let width = row.getSize();
let rowOffset = row.getNextSet(0);
this.counters.fill(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 decode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
static decode(bytes: Uint8Array): DecoderResult {
const bits = new BitSource(bytes);
const result = new StringBuilder();
const resultTrailer = new StringBuilder();
const byteSegments = new Array<Uint8Array>();
Function decodeOnce
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public decodeOnce(
element: HTMLVisualMediaElement,
retryIfNotFound = true,
retryIfChecksumOrFormatError = true
): Promise<Result> {
Function convertByteMatrixToBitMatrix
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private convertByteMatrixToBitMatrix(
matrix: ByteMatrix,
reqWidth: number,
reqHeight: number
): BitMatrix {