Showing 605 of 958 total issues
Avoid too many return
statements within this function. Open
return FieldParser.processVariableAI(4, <number>dataLength[2], rawInformation);
Avoid too many return
statements within this function. Open
return FieldParser.processVariableAI(4, <number>dataLength[2], rawInformation);
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return FieldParser.processFixedAI(4, <number>dataLength[1], rawInformation);
Function encode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public encode(context: EncoderContext) {
// step C
const buffer = new StringBuilder();
while (context.hasMoreCharacters()) {
const c = context.getCurrentChar();
- 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 encodeToCodewords
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private encodeToCodewords(sb: string): string {
const len = sb.length;
if (len === 0) {
throw new Error('StringBuilder must not be empty');
}
- 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 getVersionForDimensions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static getVersionForDimensions(numRows: number, numColumns: number): Version {
if ((numRows & 0x01) !== 0 || (numColumns & 0x01) !== 0) {
throw new FormatException();
}
- 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 getRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public getRow(y: number /*int*/, row: Uint8ClampedArray): Uint8ClampedArray {
if (y < 0 || y >= this.getHeight()) {
throw new IllegalArgumentException('Requested row is outside the image: ' + y);
}
const width: number /*int*/ = this.getWidth();
- 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 getBitValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static getBitValue(moduleBitCount: Int32Array): int {
let result: /*long*/ number = 0;
for (let /*int*/ i = 0; i < moduleBitCount.length; i++) {
for (/*int*/ let bit = 0; bit < moduleBitCount[i]; bit++) {
result = (result << 1) | (i % 2 === 0 ? 1 : 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 encode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public encode(context: EncoderContext) {
// step F
const buffer = new StringBuilder();
while (context.hasMoreCharacters()) {
const c = context.getCurrentChar();
- 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 decodeKanjiSegment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static decodeKanjiSegment(bits: BitSource,
result: StringBuilder,
count: number /*int*/): void /*throws FormatException*/ {
// Don't crash trying to read more bits than we have available.
if (count * 13 > bits.available()) {
- 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 unmaskBitMatrix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public unmaskBitMatrix(bits: BitMatrix, dimension: number /*int*/): void {
for (let i = 0; i < dimension; i++) {
for (let j = 0; j < dimension; j++) {
if (this.isMasked(i, j)) {
bits.flip(j, 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 decodeHanziSegment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static decodeHanziSegment(bits: BitSource,
result: StringBuilder,
count: number /*int*/): void /*throws FormatException*/ {
// Don't crash trying to read more bits than we have available.
if (count * 13 > bits.available()) {
- 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 applyMaskPenaltyRule4
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static applyMaskPenaltyRule4(matrix: ByteMatrix): number /*int*/ {
let numDarkCells = 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 decodeVersionInformation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static decodeVersionInformation(versionBits: number /*int*/): Version {
let bestDifference = Number.MAX_SAFE_INTEGER;
let bestVersion = 0;
for (let i = 0; i < Version.VERSION_DECODE_INFO.length; i++) {
const targetVersion = Version.VERSION_DECODE_INFO[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 binarySearch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static binarySearch(ar: Int32Array, el: number, comparator?: (a: number, b: number) => number): number {
if (undefined === comparator) {
comparator = Arrays.numberComparator;
}
let m = 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 6 (exceeds 5 allowed). Consider refactoring. Open
public toString(): string {
const result = new StringBuilder(); // (2 * width * height + 2)
for (let y = 0, height = this.height; y < height; ++y) {
const bytesY = this.bytes[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 mirror
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public mirror(): void {
const bitMatrix = this.bitMatrix;
for (let x = 0, width = bitMatrix.getWidth(); x < width; x++) {
for (let y = x + 1, height = bitMatrix.getHeight(); y < height; y++) {
if (bitMatrix.get(x, y) !== bitMatrix.get(y, 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 correctTopRight
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private correctTopRight(points: ResultPoint[]): ResultPoint {
// A..D
// | :
// B--C
let pointA = points[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 getNumDataBytesAndNumECBytesForBlockID
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static getNumDataBytesAndNumECBytesForBlockID(numTotalBytes: number /*int*/,
numDataBytes: number /*int*/,
numRSBlocks: number /*int*/,
blockID: number /*int*/,
numDataBytesInBlock: Int32Array,
- 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"