Showing 605 of 958 total issues
Function applyMaskPenaltyRule3
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static applyMaskPenaltyRule3(matrix: ByteMatrix): number /*int*/ {
let numPenalties = 0;
const array: Array<Uint8Array> = matrix.getArray();
const width: number /*int*/ = matrix.getWidth();
const height: number /*int*/ = matrix.getHeight();
Function numericCompaction
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static numericCompaction(codewords: Int32Array, codeIndex: number /*int*/, result: StringBuilder): int {
let count: int = 0;
let end: boolean = false;
let numericCodewords: Int32Array = new Int32Array(DecodedBitStreamParser.MAX_NUMERIC_CODEWORDS);
Function decode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public decode(image: BinaryBitmap, hints?: Map<DecodeHintType, any>): Result {
let decoderResult: DecoderResult;
let points: Array<ResultPoint>;
if (hints !== undefined && hints !== null && undefined !== hints.get(DecodeHintType.PURE_BARCODE)) {
const bits = QRCodeReader.extractPureBits(image.getBlackMatrix());
Function findGuardPattern
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function parseFoundFinderPattern
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private parseFoundFinderPattern(
row: BitArray,
rowNumber: number,
oddPattern: boolean
): FinderPattern {
Function decodeMiddle
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public decodeMiddle(row: BitArray, startRange: Int32Array, resultString: string) {
let counters = this.decodeMiddleCounters;
counters[0] = 0;
counters[1] = 0;
counters[2] = 0;
Function decode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public decode(image: BinaryBitmap, hints: Map<DecodeHintType, any> | null = null): Result {
let decoderResult: DecoderResult;
let points: ResultPoint[];
if (hints != null && hints.has(DecodeHintType.PURE_BARCODE)) {
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public constructor(luminances: Uint8ClampedArray | Int32Array,
width: number /*int*/,
height: number /*int*/,
private dataWidth?: number /*int*/,
private dataHeight?: number /*int*/,
Function findAsteriskPattern
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private findAsteriskPattern(row: BitArray): Int32Array {
let width = row.getSize();
let rowOffset = row.getNextSet(0);
this.counters.fill(0);
Function decodeMiddle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public decodeMiddle(row: BitArray, startRange: Int32Array, resultString: string) {
let counters = this.decodeMiddleCounters;
counters[0] = 0;
counters[1] = 0;
counters[2] = 0;
Function decodeMiddle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public decodeMiddle(row: BitArray, startRange: Int32Array, resultString: string) {
let counters = this.decodeMiddleCounters;
counters[0] = 0;
counters[1] = 0;
counters[2] = 0;
Function loop
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const loop = (
resolve: (value?: Result | PromiseLike<Result>) => void,
reject: (reason?: any) => void
) => {
if (this._stopAsyncDecode) {
Function extractPureBits
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static extractPureBits(image: BitMatrix): BitMatrix {
const leftTopBlack = image.getTopLeftOnBit();
const rightBottomBlack = image.getBottomRightOnBit();
if (leftTopBlack == null || rightBottomBlack == null) {
Function createTransform
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static createTransform(topLeft: ResultPoint,
topRight: ResultPoint,
bottomLeft: ResultPoint,
alignmentPattern: ResultPoint,
dimension: number /*int*/): PerspectiveTransform {
Function adjustIncompleteIndicatorColumnRowNumbers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private adjustIncompleteIndicatorColumnRowNumbers(barcodeMetadata: BarcodeMetadata): void {
let boundingBox: BoundingBox = this.getBoundingBox();
let top: ResultPoint = this._isLeft ? boundingBox.getTopLeft() : boundingBox.getTopRight();
let bottom: ResultPoint = this._isLeft ? boundingBox.getBottomLeft() : boundingBox.getBottomRight();
let firstRow: int = this.imageRowToCodewordIndex(<int> Math.trunc(top.getY()));
Function findCorners
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private findCorners(right: number, left: number, down: number, up: number): ResultPoint[] {
//
// A------------ ------------B
// | | up | |
// | -------|--------------|------- |
Function findAsteriskPattern
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static findAsteriskPattern(row: BitArray, counters: Int32Array): number[] {
let width = row.getSize();
let rowOffset = row.getNextSet(0);
let counterPosition = 0;
Function createDecoderResultFromAmbiguousValues
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static createDecoderResultFromAmbiguousValues(ecLevel: int,
codewords: Int32Array,
erasureArray: Int32Array,
ambiguousIndexes: Int32Array,
ambiguousIndexValues: Int32Array[]): DecoderResult {
Function getRSSvalue
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static getRSSvalue(widths: number[], maxWidth: number, noNarrow: boolean): number {
let n = 0;
for (let width of widths) {
n += width;
}
Function findGuardPattern
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static findGuardPattern(
row: BitArray,
rowOffset: number,
pattern: Int32Array
): number[] {