zxing-js/library

View on GitHub

Showing 605 of 958 total issues

Function readUtah has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private readUtah(row: number, column: number, numRows: number, numColumns: number): number {
    let currentByte = 0;
    if (this.readModule(row - 2, column - 2, numRows, numColumns)) {
      currentByte |= 1;
    }
Severity: Minor
Found in src/core/datamatrix/decoder/BitMatrixParser.ts - About 1 hr to fix

    Function readCorner1 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private readCorner1(numRows: number, numColumns: number): number {
        let currentByte = 0;
        if (this.readModule(numRows - 1, 0, numRows, numColumns)) {
          currentByte |= 1;
        }
    Severity: Minor
    Found in src/core/datamatrix/decoder/BitMatrixParser.ts - About 1 hr to fix

      Function readCorner4 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        private readCorner4(numRows: number, numColumns: number): number {
          let currentByte = 0;
          if (this.readModule(numRows - 3, 0, numRows, numColumns)) {
            currentByte |= 1;
          }
      Severity: Minor
      Found in src/core/datamatrix/decoder/BitMatrixParser.ts - About 1 hr to fix

        Function readCorner2 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          private readCorner2(numRows: number, numColumns: number): number {
            let currentByte = 0;
            if (this.readModule(numRows - 3, 0, numRows, numColumns)) {
              currentByte |= 1;
            }
        Severity: Minor
        Found in src/core/datamatrix/decoder/BitMatrixParser.ts - About 1 hr to fix

          Function decodeNumericSegment has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            private static decodeNumericSegment(bits: BitSource,
              result: StringBuilder,
              count: number /*int*/): void /*throws FormatException*/ {
              // Read three digits at a time
              while (count >= 3) {
          Severity: Minor
          Found in src/core/qrcode/decoder/DecodedBitStreamParser.ts - About 1 hr to fix

            Function handleEOD has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              handleEOD(context: EncoderContext, buffer: StringBuilder): void {
                const unwritten = Math.floor((buffer.length() / 3) * 2);
                const rest = buffer.length() % 3;
            
                const curCodewordCount = context.getCodewordCount() + unwritten;
            Severity: Minor
            Found in src/core/datamatrix/encoder/C40Encoder.ts - About 1 hr to fix

              Function getEndMode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                getEndMode(): Mode {
                  if (this.mode === Mode.EDF) {
                    if (this.characterLength < 4) {
                      return Mode.ASCII;
                    }
              Severity: Minor
              Found in src/core/datamatrix/encoder/MinimalEncoder.ts - About 1 hr to fix

                Function encodeMaximal has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  encodeMaximal(context: EncoderContext): void {
                    const buffer = new StringBuilder();
                    let lastCharSize = 0;
                    let backtrackStartPosition = context.pos;
                    let backtrackBufferLength = 0;
                Severity: Minor
                Found in src/core/datamatrix/encoder/C40Encoder.ts - About 1 hr to fix

                  Function shiftToModuleCenter has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    private shiftToModuleCenter(points: ResultPoint[]): ResultPoint[] {
                      // A..D
                      // |  :
                      // B--C
                      let pointA = points[0];
                  Severity: Minor
                  Found in src/core/datamatrix/detector/Detector.ts - About 1 hr to fix

                    Function getBlackRow has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public getBlackRow(y: number /*int*/, row: BitArray): BitArray /*throws NotFoundException*/ {
                            const source = this.getLuminanceSource();
                            const width = source.getWidth();
                            if (row === undefined || row === null || row.getSize() < width) {
                                row = new BitArray(width);
                    Severity: Minor
                    Found in src/core/common/GlobalHistogramBinarizer.ts - About 1 hr to fix

                      Function getCornerFromArea has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private getCornerFromArea(left: number, right: number, top: number, bottom: number, maximizeX: boolean, maximizeY: boolean): ResultPoint {
                              let resX = maximizeX ? 0 : Number.MAX_VALUE;
                              let resY = maximizeY ? 0 : Number.MAX_VALUE;
                              for (let x = left; x < right; x++) {
                                  for (let y = top; y < bottom; y++) {
                      Severity: Minor
                      Found in src/core/common/detector/CornerDetector.ts - About 1 hr to fix

                        Function getBullsEyeCorners has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private getBullsEyeCorners(pCenter: Point): ResultPoint[] {
                        
                        
                                let pina = pCenter;
                                let pinb = pCenter;
                        Severity: Minor
                        Found in src/core/aztec/detector/Detector.ts - About 1 hr to fix

                          Function encodeMinimally has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            static encodeMinimally(input: Input): Result {
                              /* The minimal encoding is computed by Dijkstra. The acyclic graph is modeled as follows:
                               * A vertex represents a combination of a position in the input and an encoding mode where position 0
                               * denotes the position left of the first character, 1 the position left of the second character and so on.
                               * Likewise the end vertices are located after the last character at position input.length().
                          Severity: Minor
                          Found in src/core/datamatrix/encoder/MinimalEncoder.ts - About 1 hr to fix

                            Function lookup has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              public static lookup(
                                dataCodewords: number,
                                shape = SymbolShapeHint.FORCE_NONE,
                                minSize: Dimension = null,
                                maxSize: Dimension = null,
                            Severity: Minor
                            Found in src/core/datamatrix/encoder/SymbolInfo.ts - About 1 hr to fix

                              Function getDataMaskBit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static getDataMaskBit(maskPattern: number /*int*/, x: number /*int*/, y: number /*int*/): boolean {
                                      let intermediate: number; /*int*/
                                      let temp: number; /*int*/
                                      switch (maskPattern) {
                                          case 0:
                              Severity: Minor
                              Found in src/core/qrcode/encoder/MaskUtil.ts - About 1 hr to fix

                                Function correctTopRight has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  private correctTopRight(points: ResultPoint[]): ResultPoint {
                                    // A..D
                                    // |  :
                                    // B--C
                                    let pointA = points[0];
                                Severity: Minor
                                Found in src/core/datamatrix/detector/Detector.ts - About 1 hr to fix

                                  Function readVersion has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public readVersion(): Version /*throws FormatException*/ {
                                  
                                          if (this.parsedVersion !== null && this.parsedVersion !== undefined) {
                                              return this.parsedVersion;
                                          }
                                  Severity: Minor
                                  Found in src/core/qrcode/decoder/BitMatrixParser.ts - About 1 hr to fix

                                    Function removeIncorrectCodewords has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      private removeIncorrectCodewords(codewords: Codeword[], barcodeMetadata: BarcodeMetadata): void {
                                        // Remove codewords which do not match the metadata
                                        // TODO Maybe we should keep the incorrect codewords for the start and end positions?
                                        for (let codewordRow /*int*/ = 0; codewordRow < codewords.length; codewordRow++) {
                                          let codeword: Codeword = codewords[codewordRow];
                                    Severity: Minor
                                    Found in src/core/pdf417/decoder/DetectionResultRowIndicatorColumn.ts - About 1 hr to fix

                                      Function convertUPCEtoUPCA has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        public static convertUPCEtoUPCA(upce: string): string {
                                          // the following line is equivalent to upce.getChars(1, 7, upceChars, 0);
                                          const upceChars = upce.slice(1, 7).split('').map(x => x.charCodeAt(0));
                                          const result: StringBuilder = new StringBuilder(/*12*/);
                                          result.append(upce.charAt(0));
                                      Severity: Minor
                                      Found in src/core/oned/UPCEReader.ts - About 1 hr to fix

                                        Function createDecoder has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function createDecoder(information: BitArray): AbstractExpandedDecoder {
                                          try {
                                            if (information.get(1)) {
                                              return new AI01AndOtherAIs(information);
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language