Showing 605 of 958 total issues
Function thresholdBlock
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static thresholdBlock(luminances: Uint8ClampedArray,
xoffset: number /*int*/,
yoffset: number /*int*/,
threshold: number /*int*/,
stride: number /*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 addEdges
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
addEdges(
stringToEncode: string,
encoderSet: ECIEncoderSet,
edges: InputEdge[][],
from: 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 parseFromBooleanArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static parseFromBooleanArray(image: boolean[][]): BitMatrix {
const height = image.length;
const width = image[0].length;
const bits = new BitMatrix(width, height);
for (let i = 0; i < height; 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 multiply
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public multiply(other: GenericGFPoly): GenericGFPoly {
if (!this.field.equals(other.field)) {
throw new IllegalArgumentException('GenericGFPolys do not have same GenericGF field');
}
if (this.isZero() || other.isZero()) {
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public constructor(private image: BitMatrix, initSize?: number /*int*/, x?: number /*int*/, y?: number /*int*/) /*throws NotFoundException*/ {
this.height = image.getHeight();
this.width = image.getWidth();
if (undefined === initSize || null === initSize) {
initSize = WhiteRectangleDetector.INIT_SIZE;
- 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 toBytes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public toBytes(bitOffset: number /*int*/, array: Uint8Array, offset: number /*int*/, numBytes: number /*int*/): void {
for (let i = 0; i < numBytes; i++) {
let theByte = 0;
for (let j = 0; j < 8; j++) {
if (this.get(bitOffset)) {
- 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 constructor_1
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private constructor_1( image: BitMatrix,
topLeft: ResultPoint,
bottomLeft: ResultPoint,
topRight: ResultPoint,
bottomRight: ResultPoint) {
- 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 findErrorLocations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private findErrorLocations(errorLocator: GenericGFPoly): Int32Array /*throws ReedSolomonException*/ {
// This is a direct application of Chien's search
const numErrors = errorLocator.getDegree();
if (numErrors === 1) { // shortcut
return Int32Array.from([errorLocator.getCoefficient(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 setRegion
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public setRegion(left: number /*int*/, top: number /*int*/, width: number /*int*/, height: number /*int*/): void {
if (top < 0 || left < 0) {
throw new IllegalArgumentException('Left and top must be nonnegative');
}
if (height < 1 || width < 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 buildToString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private buildToString(setString: string, unsetString: string, lineSeparator: string) {
let result = new StringBuilder();
// result.append(lineSeparator);
for (let y = 0, height = this.height; y < height; y++) {
for (let x = 0, width = this.width; x < width; x++) {
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public constructor(size?: number /*int*/, bits?: Int32Array) {
if (undefined === size) {
this.size = 0;
this.bits = new Int32Array(1);
} else {
- 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 verifyCodewordCount
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static verifyCodewordCount(codewords: Int32Array, numECCodewords: int): void {
if (codewords.length < 4) {
// Codeword array size should be at least 4 allowing for
// Count CW, At least one Data CW, Error Correction CW, Error Correction CW
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 multiplyOther
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
multiplyOther(other: ModulusPoly): ModulusPoly {
if (!this.field.equals(other.field)) {
throw new IllegalArgumentException('ModulusPolys do not have same ModulusGF field');
}
if (this.isZero() || other.isZero()) {
- 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 getBitCountForCodeword
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static getBitCountForCodeword(codeword: int): Int32Array {
let result: Int32Array = new Int32Array(8);
let previousValue: int = 0;
let i: int = result.length - 1;
while (true) {
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public constructor(private width: number /*int*/, private height?: number /*int*/,
private rowSize?: number /*int*/, private bits?: Int32Array) {
if (undefined === height || null === height) {
height = width;
}
- 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 bitsToWords
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static bitsToWords(stuffedBits: BitArray, wordSize: int, totalWords: int): Int32Array {
let message: Int32Array = new Int32Array(totalWords);
let i: int;
let n: int;
for (i = 0, n = stuffedBits.getSize() / wordSize; i < n; 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 createDecoder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function createDecoder(information: BitArray): AbstractExpandedDecoder {
try {
if (information.get(1)) {
return new AI01AndOtherAIs(information);
- 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 storeRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private storeRow(rowNumber: number, wasReversed: boolean): void {
// Discard if duplicate above or below; otherwise insert in order by row number.
let insertPos = 0;
let prevIsSame = false;
let nextIsSame = 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 decodeDigit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static decodeDigit(counters: Int32Array): number {
let bestVariance: number = ITFReader.MAX_AVG_VARIANCE; // worst variance we'll accept
let bestMatch: number = -1;
let max: number = ITFReader.PATTERNS.length;
- 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 decodeMiddle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public decodeMiddle(row: BitArray, startRange: Int32Array, result: string) {
const counters: Int32Array = this.decodeMiddleCounters.map(x => x);
counters[0] = 0;
counters[1] = 0;
counters[2] = 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"