Showing 605 of 958 total issues
Function decodeMiddle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public decodeMiddle(row: BitArray, startRange: Int32Array, resultString: string) {
let counters = this.decodeMiddleCounters;
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"
Further reading
Function checkRows
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private checkRows(
collectedRows: any,
currentRow: number
): Array<ExpandedPair> {
for (let i = currentRow; i < this.rows.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 parseNumericBlock
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private parseNumericBlock(): BlockParsedResult {
while (this.isStillNumeric(this.current.getPosition())) {
let numeric: DecodedNumeric = this.decodeNumeric(this.current.getPosition());
this.current.setPosition(numeric.getNewPosition());
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public decodeRow(rowNumber: number, row: BitArray, hints?: Map<DecodeHintType, any>): Result {
// Find out where the Middle section (payload) starts & ends
let startRange: number[] = this.decodeStart(row);
let endRange: number[] = this.decodeEnd(row);
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public decodeMiddle(row: BitArray, startRange: Int32Array, resultString: string) {
let counters = this.decodeMiddleCounters;
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"
Further reading
Function isValidSequence
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static isValidSequence(pairs: Array<ExpandedPair>): boolean {
for (let sequence of RSSExpandedReader.FINDER_PATTERN_SEQUENCES) {
if (pairs.length > sequence.length) {
continue;
}
- 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 appendTo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public appendTo(bitArray: BitArray, text: /*byte[]*/ Uint8Array): void {
for (let i = 0; i < this.binaryShiftByteCount; i++) {
if (i === 0 || (i === 31 && this.binaryShiftByteCount <= 62)) {
// We need a header before the first character, and before
// character 31 when the total byte code is <= 62
- 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 decodeAlphanumericSegment
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static decodeAlphanumericSegment(bits: BitSource,
result: StringBuilder,
count: number /*int*/,
fc1InEffect: boolean): void /*throws FormatException*/ {
// Read two characters at a time
Function readFormatInformation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public readFormatInformation(): FormatInformation /*throws FormatException*/ {
if (this.parsedFormatInfo !== null && this.parsedFormatInfo !== undefined) {
return this.parsedFormatInfo;
}
Function orderBestPatterns
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static orderBestPatterns(patterns: Array<ResultPoint>): void {
// Find distances between pattern centers
const zeroOneDistance = this.distance(patterns[0], patterns[1]);
const oneTwoDistance = this.distance(patterns[1], patterns[2]);
Function getBlackMatrix
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public getBlackMatrix(): BitMatrix /*throws NotFoundException*/ {
const source = this.getLuminanceSource();
const width = source.getWidth();
const height = source.getHeight();
const matrix = new BitMatrix(width, height);
Function adjustBoundingBox
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static adjustBoundingBox(rowIndicatorColumn: DetectionResultRowIndicatorColumn): BoundingBox {
if (rowIndicatorColumn == null) {
return null;
}
let rowHeights: Int32Array = rowIndicatorColumn.getRowHeights();
Function decode
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public decode(received: Int32Array, twoS: number /*int*/): void /*throws ReedSolomonException*/ {
const field = this.field;
const poly = new GenericGFPoly(field, received);
const syndromeCoefficients = new Int32Array(twoS);
let noError: boolean = true;
Function encodeCompressedDate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private encodeCompressedDate(buf: StringBuilder, currentPos: number): void {
let numericDate = this.getGeneralDecoder().extractNumericValueFromBitArray(
currentPos,
AI013x0x1xDecoder.DATE_SIZE
);
Function decodeBase256Segment
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static decodeBase256Segment(bits: BitSource,
result: StringBuilder,
byteSegments: Uint8Array[]): void {
// Figure out how long the Base 256 Segment is.
let codewordPosition = 1 + bits.getByteOffset(); // position is 1-indexed
Function renderResult
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private renderResult(code: QRCode, width: number /*int*/, height: number /*int*/, quietZone: number /*int*/): SVGSVGElement {
// if (this.format && format != this.format) {
// throw new IllegalArgumentException("Can only encode QR_CODE, but got " + format)
// }
Function detectCodeword
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static detectCodeword(image: BitMatrix,
minColumn: int,
maxColumn: int,
leftToRight: boolean,
startColumn: int,
Function decodeRow
has 26 lines of code (exceeds 25 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);
Function recordPattern
has 26 lines of code (exceeds 25 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;
Function getCorrectedParameterData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private getCorrectedParameterData(parameterData: number, compact: boolean): number {
let numCodewords;
let numDataCodewords;
if (compact) {