Showing 605 of 958 total issues
Function guessEncoding
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static guessEncoding(bytes: Uint8Array, hints: Map<DecodeHintType, any>): string {
if (hints !== null && hints !== undefined && undefined !== hints.get(DecodeHintType.CHARACTER_SET)) {
return hints.get(DecodeHintType.CHARACTER_SET).toString();
}
// For now, merely tries to distinguish ISO-8859-1, UTF-8 and Shift_JIS,
Function doDecode
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private doDecode(image: BinaryBitmap, hints?: Map<DecodeHintType, any>): Result {
const width = image.getWidth();
const height = image.getHeight();
let row = new BitArray(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
File Detector.ts
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2010 ZXing authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Function detect
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
public detect(): Array<ResultPoint> /*throws NotFoundException*/ {
let left = this.leftInit;
let right = this.rightInit;
let up = this.upInit;
let down = this.downInit;
Function constructor
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
constructor(stringToEncode: string, priorityCharset: Charset, fnc1: number) {
const neededEncoders: CharsetEncoder[] = [];
// we always need the ISO-8859-1 encoder. It is the default encoding
neededEncoders.push(new CharsetEncoder(StandardCharsets.ISO_8859_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 drawModeMessage
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private static drawModeMessage(matrix: BitMatrix, compact: boolean, matrixSize: int, modeMessage: BitArray): void {
let center: int = Integer.truncDivision(matrixSize, 2);
if (compact) {
for (let i /*int*/ = 0; i < 7; i++) {
let offset: int = center - 3 + 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 encode
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static encode(data: Uint8Array, minECCPercent: int, userSpecifiedLayers: int): AztecCode {
// High-level encode
let bits: BitArray = new HighLevelEncoder(data).encode();
// stuff bits and choose symbol size
Function toString
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public toString(): string {
let result = '';
for (let degree = this.getDegree(); degree >= 0; degree--) {
let coefficient = this.getCoefficient(degree);
if (coefficient !== 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 toString
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public toString(): string {
let result = '';
for (let degree = this.getDegree(); degree >= 0; degree--) {
let coefficient = this.getCoefficient(degree);
if (coefficient !== 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 decodeDataCharacter
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
decodeDataCharacter(
row: BitArray,
pattern: FinderPattern,
isOddPattern: boolean,
leftChar: boolean
- 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 encodeMinimally
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
encodeMinimally(
stringToEncode: string,
encoderSet: ECIEncoderSet,
fnc1: 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 parseFieldsInGeneralPurpose
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
static parseFieldsInGeneralPurpose(rawInformation: string): string {
if (!rawInformation) {
return 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 adjustOddEvenCounts
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
private adjustOddEvenCounts(outsideChar: boolean, numModules: number) {
let oddSum = MathUtils.sum(new Int32Array(this.getOddCounts()));
let evenSum = MathUtils.sum(new Int32Array(this.getEvenCounts()));
Function findNextPair
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private findNextPair(
row: BitArray,
previousPairs: Array<ExpandedPair>,
forcedOffset: number
): void {
- 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 static_CHAR_MAP
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function static_CHAR_MAP(CHAR_MAP: Int32Array[]): Int32Array[] {
const spaceCharCode = StringUtils.getCharCode(' ');
const pointCharCode = StringUtils.getCharCode('.');
const commaCharCode = StringUtils.getCharCode(',');
Function readCodewords
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public readCodewords(): Uint8Array /*throws FormatException*/ {
const formatInfo = this.readFormatInformation();
const version = this.readVersion();
- 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 form
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private static form(str: string, arr: any[]) {
let i = -1;
function callback(exp: string | number, p0: any, p1: any, p2: any, p3: any, p4: any) {
- 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 format
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public static format(append: string, ...args: any[]) {
let i = -1;
function callback(exp: string | number, p0: any, p1: any, p2: any, p3: any, p4: any) {
- 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 adjustOddEvenCounts
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
private adjustOddEvenCounts(numModules) {
let oddSum = MathUtils.sum(new Int32Array(this.getOddCounts()));
let evenSum = MathUtils.sum(new Int32Array(this.getEvenCounts()));
let incrementOdd = false;
Function toNarrowWidePattern
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private static toNarrowWidePattern(counters: Int32Array): number {
let numCounters = counters.length;
let maxNarrowCounter = 0;
let wideCounters: number;
do {
- 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"