Showing 605 of 958 total issues
Function listVideoInputDevices
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public async listVideoInputDevices(): Promise<MediaDeviceInfo[]> {
if (!this.hasNavigator) {
throw new Error("Can't enumerate devices, navigator is not present.");
}
- 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 renderResult
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static renderResult(code: QRCode, width: number /*int*/, height: number /*int*/, quietZone: number /*int*/): BitMatrix {
const input = code.getMatrix();
if (input === null) {
throw new IllegalStateException();
}
- 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 a Cognitive Complexity of 7 (exceeds 5 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;
- 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 readFormatInformation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public readFormatInformation(): FormatInformation /*throws FormatException*/ {
if (this.parsedFormatInfo !== null && this.parsedFormatInfo !== undefined) {
return this.parsedFormatInfo;
}
- 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 applyMaskPenaltyRule2
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static applyMaskPenaltyRule2(matrix: ByteMatrix): number /*int*/ {
let penalty = 0;
const array: Array<Uint8Array> = matrix.getArray();
const width: number /*int*/ = matrix.getWidth();
const height: number /*int*/ = matrix.getHeight();
- 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 getRowHeights
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getRowHeights(): Int32Array {
let barcodeMetadata: BarcodeMetadata = this.getBarcodeMetadata();
if (barcodeMetadata == null) {
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 appendKanjiBytes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static appendKanjiBytes(content: string, bits: BitArray): void /*throws */ {
let bytes: Uint8Array;
try {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
public static toString(barcodeMatrix: BarcodeValue[][]): String {
let formatter = new Formatter();
// try (let formatter = new Formatter()) {
for (let row /*int*/ = 0; row < barcodeMatrix.length; row++) {
formatter.format('Row %2d: ', 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 getBarcodeMetadata
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static getBarcodeMetadata(leftRowIndicatorColumn: DetectionResultRowIndicatorColumn,
rightRowIndicatorColumn: DetectionResultRowIndicatorColumn): BarcodeMetadata {
let leftBarcodeMetadata: BarcodeMetadata;
if (leftRowIndicatorColumn == null ||
(leftBarcodeMetadata = leftRowIndicatorColumn.getBarcodeMetadata()) == 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 patternMatchVariance
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static patternMatchVariance( counters: Int32Array, pattern: Int32Array, maxIndividualVariance: float): float {
let numCounters = counters.length;
let total = 0;
let patternLength = 0;
for (let i = 0; i < numCounters; 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 decode
has a Cognitive Complexity of 7 (exceeds 5 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;
- 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 detectCodeword
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static detectCodeword(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 decodeInternal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private decodeInternal(image: BinaryBitmap): Result {
if (this.readers === null) {
throw new ReaderException('No readers where selected, nothing can be read.');
}
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
constructor(stringToEncode: string, priorityCharset: Charset, fnc1: number) {
this.fnc1 = fnc1;
const encoderSet = new ECIEncoderSet(stringToEncode, priorityCharset, fnc1);
if (encoderSet.length() === 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 patternMatchVariance
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected static patternMatchVariance(counters: Int32Array, pattern: Int32Array, maxIndividualVariance: number): number {
const numCounters = counters.length;
let total = 0;
let patternLength = 0;
for (let i = 0; i < numCounters; 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 codaBarDecodeRow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private codaBarDecodeRow(row: Array<number>): string {
const code = [];
const barThreshold = Math.ceil(
row.reduce((pre, item) => (pre + item) / 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 static_CHAR_MAP
has a Cognitive Complexity of 7 (exceeds 5 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(',');
- 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 addBinaryShiftChar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
addBinaryShiftChar(index: int): State {
let token: Token = this.token;
let mode: int = this.mode;
let bitCount: int = this.bitCount;
if (this.mode === C.MODE_PUNCT || this.mode === C.MODE_DIGIT) {
- 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 encodeWithHints
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public encodeWithHints(contents: string, format: BarcodeFormat, width: int, height: int, hints: Map<EncodeHintType, any>): BitMatrix {
let charset: Charset = StandardCharsets.ISO_8859_1;
let eccPercent: int = Encoder.DEFAULT_EC_PERCENT;
let layers: int = Encoder.DEFAULT_AZTEC_LAYERS;
if (hints != 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 renderResult
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static renderResult(code: AztecCode, width: int, height: int): BitMatrix {
let input: BitMatrix = code.getMatrix();
if (input == null) {
throw new IllegalStateException();
}
- 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"