zxing-js/library

View on GitHub

Showing 605 of 958 total issues

Function numericCompaction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
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);
Severity: Minor
Found in src/core/pdf417/decoder/DecodedBitStreamParser.ts - About 1 hr to fix

    Function decode has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    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());
    Severity: Minor
    Found in src/core/qrcode/QRCodeReader.ts - About 1 hr to fix

      Function applyMaskPenaltyRule3 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      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();
      Severity: Minor
      Found in src/core/qrcode/encoder/MaskUtil.ts - About 1 hr to fix

        Function decodeMiddle has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public decodeMiddle(row: BitArray, startRange: Int32Array, resultString: string) {
                let counters = this.decodeMiddleCounters;
                counters[0] = 0;
                counters[1] = 0;
                counters[2] = 0;
        Severity: Minor
        Found in src/core/oned/UPCEANExtension5Support.ts - About 1 hr to fix

          Function parseFoundFinderPattern has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            private parseFoundFinderPattern(
              row: BitArray,
              rowNumber: number,
              oddPattern: boolean
            ): FinderPattern {
          Severity: Minor
          Found in src/core/oned/rss/expanded/RSSExpandedReader.ts - About 1 hr to fix

            Function findGuardPattern has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            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;
            Severity: Minor
            Found in src/core/oned/AbstractUPCEANReader.ts - About 1 hr to fix

              Function decode has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              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)) {
              Severity: Minor
              Found in src/core/datamatrix/DataMatrixReader.ts - About 1 hr to fix

                Function constructor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public constructor(luminances: Uint8ClampedArray | Int32Array,
                        width: number /*int*/,
                        height: number /*int*/,
                        private dataWidth?: number /*int*/,
                        private dataHeight?: number /*int*/,
                Severity: Minor
                Found in src/core/RGBLuminanceSource.ts - About 1 hr to fix

                  Function decodeMiddle has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public decodeMiddle(row: BitArray, startRange: Int32Array, resultString: string) {
                          let counters = this.decodeMiddleCounters;
                          counters[0] = 0;
                          counters[1] = 0;
                          counters[2] = 0;
                  Severity: Minor
                  Found in src/core/oned/EAN13Reader.ts - About 1 hr to fix

                    Function decodeMiddle has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public decodeMiddle(row: BitArray, startRange: Int32Array, resultString: string) {
                            let counters = this.decodeMiddleCounters;
                            counters[0] = 0;
                            counters[1] = 0;
                            counters[2] = 0;
                    Severity: Minor
                    Found in src/core/oned/UPCEANExtension2Support.ts - About 1 hr to fix

                      Function findAsteriskPattern has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        private findAsteriskPattern(row: BitArray): Int32Array {
                          let width = row.getSize();
                          let rowOffset = row.getNextSet(0);
                      
                          this.counters.fill(0);
                      Severity: Minor
                      Found in src/core/oned/Code93Reader.ts - About 1 hr to fix

                        Function loop has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            const loop = (
                              resolve: (value?: Result | PromiseLike<Result>) => void,
                              reject: (reason?: any) => void
                            ) => {
                              if (this._stopAsyncDecode) {
                        Severity: Minor
                        Found in src/browser/BrowserCodeReader.ts - About 1 hr to fix

                          Function extractPureBits has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            private static extractPureBits(image: BitMatrix): BitMatrix {
                          
                              const leftTopBlack = image.getTopLeftOnBit();
                              const rightBottomBlack = image.getBottomRightOnBit();
                              if (leftTopBlack == null || rightBottomBlack == null) {
                          Severity: Minor
                          Found in src/core/datamatrix/DataMatrixReader.ts - About 1 hr to fix

                            Function createTransform has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              private static createTransform(topLeft: ResultPoint,
                                topRight: ResultPoint,
                                bottomLeft: ResultPoint,
                                alignmentPattern: ResultPoint,
                                dimension: number /*int*/): PerspectiveTransform {
                            Severity: Minor
                            Found in src/core/qrcode/detector/Detector.ts - About 1 hr to fix

                              Function findCorners has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private findCorners(right: number, left: number, down: number, up: number): ResultPoint[] {
                                      //
                                      //      A------------              ------------B
                                      //      |           |      up      |           |
                                      //      |    -------|--------------|-------    |
                              Severity: Minor
                              Found in src/core/common/detector/CornerDetector.ts - About 1 hr to fix

                                Function adjustIncompleteIndicatorColumnRowNumbers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                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()));
                                Severity: Minor
                                Found in src/core/pdf417/decoder/DetectionResultRowIndicatorColumn.ts - About 1 hr to fix

                                  Function findAsteriskPattern has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    private static findAsteriskPattern(row: BitArray, counters: Int32Array): number[] {
                                      let width = row.getSize();
                                      let rowOffset = row.getNextSet(0);
                                  
                                      let counterPosition = 0;
                                  Severity: Minor
                                  Found in src/core/oned/Code39Reader.ts - About 1 hr to fix

                                    Function createDecoderResultFromAmbiguousValues has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      private static createDecoderResultFromAmbiguousValues(ecLevel: int,
                                        codewords: Int32Array,
                                        erasureArray: Int32Array,
                                        ambiguousIndexes: Int32Array,
                                        ambiguousIndexValues: Int32Array[]): DecoderResult {
                                    Severity: Minor
                                    Found in src/core/pdf417/decoder/PDF417ScanningDecoder.ts - About 1 hr to fix

                                      Function getRSSvalue has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        public static getRSSvalue(widths: number[], maxWidth: number, noNarrow: boolean): number {
                                          let n = 0;
                                          for (let width of widths) {
                                            n += width;
                                          }
                                      Severity: Minor
                                      Found in src/core/oned/rss/RSSUtils.ts - About 1 hr to fix

                                        Function findGuardPattern has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private static findGuardPattern(
                                                row: BitArray,
                                                rowOffset: number,
                                                pattern: Int32Array
                                            ): number[] {
                                        Severity: Minor
                                        Found in src/core/oned/ITFReader.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language