Showing 605 of 958 total issues
Function decodeAlphanumeric
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private decodeAlphanumeric(pos: number): DecodedChar {
let fiveBitValue = this.extractNumericValueFromBitArray(pos, 5);
if (fiveBitValue === 15) {
return new DecodedChar(pos + 5, DecodedChar.FNC1);
}
Function createDecoder
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createDecoder(information: BitArray): AbstractExpandedDecoder {
try {
if (information.get(1)) {
return new AI01AndOtherAIs(information);
Function drawModeMessage
has 32 lines of code (exceeds 25 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;
Function encodeHighLevel
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static encodeHighLevel(
msg: string,
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 getEDFBytes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getEDFBytes(): Uint8Array {
const numberOfThirds = Math.ceil(this.characterLength / 4.0);
const result = new Uint8Array(numberOfThirds * 3);
let pos = this.fromPosition;
const endPos = Math.min(
- 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 encodeMaximal
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
encodeMaximal(context: EncoderContext): void {
const buffer = new StringBuilder();
let lastCharSize = 0;
let backtrackStartPosition = context.pos;
let backtrackBufferLength = 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 maybeEmbedPositionAdjustmentPatterns
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static maybeEmbedPositionAdjustmentPatterns(version: Version, matrix: ByteMatrix): void {
if (version.getVersionNumber() < 2) { // The patterns appear if version >= 2
return;
}
const index = version.getVersionNumber() - 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 calculateThresholdForBlock
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static calculateThresholdForBlock(luminances: Uint8ClampedArray,
subWidth: number /*int*/,
subHeight: number /*int*/,
width: number /*int*/,
height: number /*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 constructor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public constructor(hints?: Map<DecodeHintType, any>) {
super();
let possibleFormats = hints == null ? null : <BarcodeFormat[]>hints.get(DecodeHintType.POSSIBLE_FORMATS);
let readers: Collection<UPCEANReader> = [];
if (possibleFormats != 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 stuffBits
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
static stuffBits(bits: BitArray, wordSize: int): BitArray {
let out: BitArray = new BitArray();
let n: int = bits.getSize();
let mask: int = (1 << wordSize) - 2;
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public decodeRow(rowNumber: number, row: BitArray, hints?: Map<DecodeHintType, any>): Result {
const leftPair = this.decodePair(row, false, rowNumber, hints);
RSS14Reader.addOrTally(this.possibleLeftPairs, leftPair);
row.reverse();
let rightPair = this.decodePair(row, true, rowNumber, hints);
- 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 toPattern
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private toPattern(counters: Int32Array): number {
let sum = 0;
for (const counter of counters) {
sum += counter;
}
- 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 simplifyStates
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static simplifyStates(states: State[]): Collection<State> {
let result: Collection<State> = [];
for (const newState of states) {
let add: boolean = true;
for (const oldState of result) {
- 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 detectSolid1
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private detectSolid1(cornerPoints: ResultPoint[]): ResultPoint[] {
// 0 2
// 1 3
let pointA = cornerPoints[0];
let pointB = cornerPoints[1];
Function detect
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public detect(): DetectorResult {
const cornerPoints = this.rectangleDetector.detect();
Function getNumDataBytesAndNumECBytesForBlockID
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static getNumDataBytesAndNumECBytesForBlockID(numTotalBytes: number /*int*/,
numDataBytes: number /*int*/,
numRSBlocks: number /*int*/,
blockID: number /*int*/,
numDataBytesInBlock: Int32Array,
Function getStartColumn
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static getStartColumn(detectionResult: DetectionResult,
barcodeColumn: int,
imageRow: int,
leftToRight: boolean): int {
let offset: int = leftToRight ? 1 : -1;
Function addMissingRows
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
addMissingRows(missingStartRows: int, missingEndRows: int, isLeft: boolean): BoundingBox {
let newTopLeft: ResultPoint = this.topLeft;
let newBottomLeft: ResultPoint = this.bottomLeft;
let newTopRight: ResultPoint = this.topRight;
let newBottomRight: ResultPoint = this.bottomRight;
Function extractParameters
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private extractParameters(bullsEyeCorners: ResultPoint[]): void {
if (!this.isValidPoint(bullsEyeCorners[0]) || !this.isValidPoint(bullsEyeCorners[1]) ||
!this.isValidPoint(bullsEyeCorners[2]) || !this.isValidPoint(bullsEyeCorners[3])) {
throw new NotFoundException();
}
Function extractDataRegion
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private extractDataRegion(bitMatrix: BitMatrix): BitMatrix {
const symbolSizeRows = this.version.getSymbolSizeRows();
const symbolSizeColumns = this.version.getSymbolSizeColumns();
if (bitMatrix.getHeight() !== symbolSizeRows) {