Showing 605 of 958 total issues
Function getC40Words
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
getC40Words(c40: boolean, fnc1: number): Uint8Array {
const c40Values = [];
for (let i = 0; i < this.characterLength; i++) {
const ci = this.input.charAt(this.fromPosition + i);
if (
- 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 lookup
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static lookup(
dataCodewords: number,
shape = SymbolShapeHint.FORCE_NONE,
minSize: Dimension = null,
maxSize: Dimension = null,
- 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 transitionsBetween
has a Cognitive Complexity of 17 (exceeds 5 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());
- 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 adjustRowNumbersFromBothRI
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private adjustRowNumbersFromBothRI(): void {
if (this.detectionResultColumns[0] == null || this.detectionResultColumns[this.barcodeColumnCount + 1] == null) {
return;
}
let LRIcodewords: Codeword[] = this.detectionResultColumns[0].getCodewords();
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
static findGuardPattern(row: BitArray, rowOffset: number, whiteFirst: boolean, pattern: Int32Array, counters: Int32Array): Int32Array {
let width = row.getSize();
rowOffset = whiteFirst ? row.getNextUnset(rowOffset) : row.getNextSet(rowOffset);
let counterPosition = 0;
let patternStart = rowOffset;
- 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 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
readCodewords(): Int8Array {
const result = new Int8Array(this.version.getTotalCodewords());
let resultOffset = 0;
Function find
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public find(): AlignmentPattern /*throws NotFoundException*/ {
const startX = this.startX;
const height = this.height;
const width = this.width;
const maxJ = startX + width;
Function crossCheckDiagonal
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
private crossCheckDiagonal(startI: number /*int*/, centerJ: number /*int*/, maxCount: number /*int*/, originalStateCountTotal: number /*int*/): boolean {
const stateCount: Int32Array = this.getCrossCheckStateCount();
// Start counting up, left from center finding black center mass
let i = 0;
Function correctBits
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
private correctBits(rawbits: boolean[]): boolean[] {
let gf: GenericGF;
let codewordSize: number;
if (this.ddata.getNbLayers() <= 2) {
RSSExpandedReader
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
export default class RSSExpandedReader extends AbstractRSSReader {
private static readonly SYMBOL_WIDEST = [7, 5, 4, 3, 1];
private static readonly EVEN_TOTAL_SUBSET = [4, 20, 52, 104, 204];
private static readonly GSUM = [0, 348, 1388, 2948, 3988];
Function selectBestPatterns
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
private selectBestPatterns(): FinderPattern[] /*throws NotFoundException */ {
const startSize = this.possibleCenters.length;
if (startSize < 3) {
// Couldn't find enough finder patterns
Function getC40Words
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
getC40Words(c40: boolean, fnc1: number): Uint8Array {
const c40Values = [];
for (let i = 0; i < this.characterLength; i++) {
const ci = this.input.charAt(this.fromPosition + i);
if (
Function encode
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public encode(context: EncoderContext) {
// step B
const n = HighLevelEncoder.determineConsecutiveDigitCount(
context.getMessage(),
context.pos
Function encodeHighLevel
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static encodeHighLevel(
msg: string,
shape = SymbolShapeHint.FORCE_NONE,
minSize: Dimension = null,
maxSize: Dimension = null,
Function crossCheckVertical
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private crossCheckVertical(startI: number /*int*/, centerJ: number /*int*/, maxCount: number /*int*/,
originalStateCountTotal: number /*int*/): number/*float*/ {
const image: BitMatrix = this.image;
const maxI = image.getHeight();
Function decode
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
static decode(codewords: Int32Array, ecLevel: string): DecoderResult {
// pass encoding to result (will be used for decode symbols in byte mode)
let result: StringBuilder = new StringBuilder('');
// let encoding: Charset = StandardCharsets.ISO_8859_1;
let encoding = CharacterSetECI.ISO8859_1;
Function crossCheckHorizontal
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private crossCheckHorizontal(startJ: number /*int*/, centerI: number /*int*/, maxCount: number /*int*/,
originalStateCountTotal: number /*int*/): number/*float*/ {
const image: BitMatrix = this.image;
const maxJ = image.getWidth();
File Encoder.ts
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
import BitArray from '../../common/BitArray';
import IllegalArgumentException from '../../IllegalArgumentException';
import StringUtils from '../../common/StringUtils';
import BitMatrix from '../../common/BitMatrix';
import AztecCode from './AztecCode';
Function extractDataRegion
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private extractDataRegion(bitMatrix: BitMatrix): BitMatrix {
const symbolSizeRows = this.version.getSymbolSizeRows();
const symbolSizeColumns = this.version.getSymbolSizeColumns();
if (bitMatrix.getHeight() !== symbolSizeRows) {
- 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 interleaveWithECBytes
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static interleaveWithECBytes(bits: BitArray,
numTotalBytes: number /*int*/,
numDataBytes: number /*int*/,
numRSBlocks: number /*int*/): BitArray /*throws WriterException*/ {
- 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"