zxing-js/library

View on GitHub

Showing 958 of 958 total issues

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 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 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 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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  const newWidth = Math.ceil( Math.abs(Math.cos(angleRadians)) * width + Math.abs(Math.sin(angleRadians)) * height );
          Severity: Major
          Found in src/browser/HTMLCanvasElementLuminanceSource.ts and 1 other location - About 1 hr to fix
          src/browser/HTMLCanvasElementLuminanceSource.ts on lines 152..152

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                      for (let i = 1; y === null && i < maxSize; i++) {
                          y = this.getBlackPointOnSegment(right, down - i, right - i, down);
                      }
          Severity: Major
          Found in src/core/common/detector/WhiteRectangleDetector.ts and 2 other locations - About 1 hr to fix
          src/core/common/detector/WhiteRectangleDetector.ts on lines 216..218
          src/core/common/detector/WhiteRectangleDetector.ts on lines 226..228

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              for (let i /*int*/ = 0; i < size; i++) {
                product[i] = this.field.multiply(this.coefficients[i], scalar);
              }
          Severity: Major
          Found in src/core/pdf417/decoder/ec/ModulusPoly.ts and 1 other location - About 1 hr to fix
          src/core/pdf417/decoder/ec/ModulusPoly.ts on lines 211..213

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                      for (let i = 1; t === null && i < maxSize; i++) {
                          t = this.getBlackPointOnSegment(left, up + i, left + i, up);
                      }
          Severity: Major
          Found in src/core/common/detector/WhiteRectangleDetector.ts and 2 other locations - About 1 hr to fix
          src/core/common/detector/WhiteRectangleDetector.ts on lines 226..228
          src/core/common/detector/WhiteRectangleDetector.ts on lines 236..238

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                      for (let i = 1; x === null && i < maxSize; i++) {
                          x = this.getBlackPointOnSegment(right, up + i, right - i, up);
                      }
          Severity: Major
          Found in src/core/common/detector/WhiteRectangleDetector.ts and 2 other locations - About 1 hr to fix
          src/core/common/detector/WhiteRectangleDetector.ts on lines 216..218
          src/core/common/detector/WhiteRectangleDetector.ts on lines 236..238

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  const newHeight = Math.ceil( Math.abs(Math.sin(angleRadians)) * width + Math.abs(Math.cos(angleRadians)) * height );
          Severity: Major
          Found in src/browser/HTMLCanvasElementLuminanceSource.ts and 1 other location - About 1 hr to fix
          src/browser/HTMLCanvasElementLuminanceSource.ts on lines 151..151

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              for (let i /*int*/ = 0; i < size; i++) {
                product[i] = this.field.multiply(this.coefficients[i], coefficient);
              }
          Severity: Major
          Found in src/core/pdf417/decoder/ec/ModulusPoly.ts and 1 other location - About 1 hr to fix
          src/core/pdf417/decoder/ec/ModulusPoly.ts on lines 196..198

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 59.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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 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 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 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

                    Similar blocks of code found in 3 locations. Consider refactoring.
                    Open

                          for (let j = 11; j >= 0; --j) {
                            if ((leftValue & (1 << j)) !== 0) {
                              binary.set(accPos);
                            }
                            accPos++;
                    Severity: Major
                    Found in src/core/oned/rss/expanded/BitArrayBuilder.ts and 2 other locations - About 1 hr to fix
                    src/core/oned/rss/expanded/BitArrayBuilder.ts on lines 18..23
                    src/core/oned/rss/expanded/BitArrayBuilder.ts on lines 38..43

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 58.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            cy = MathUtils.round((pointA.getY() + pointD.getY() + pointB.getY() + pointC.getY()) / 4.0);
                    Severity: Major
                    Found in src/core/aztec/detector/Detector.ts and 1 other location - About 1 hr to fix
                    src/core/aztec/detector/Detector.ts on lines 383..383

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 58.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                            let cx = MathUtils.round((pointA.getX() + pointD.getX() + pointB.getX() + pointC.getX()) / 4.0);
                    Severity: Major
                    Found in src/core/aztec/detector/Detector.ts and 1 other location - About 1 hr to fix
                    src/core/aztec/detector/Detector.ts on lines 362..362

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 58.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 3 locations. Consider refactoring.
                    Open

                            for (let j = 11; j >= 0; --j) {
                              if ((rightValue & (1 << j)) !== 0) {
                                binary.set(accPos);
                              }
                              accPos++;
                    Severity: Major
                    Found in src/core/oned/rss/expanded/BitArrayBuilder.ts and 2 other locations - About 1 hr to fix
                    src/core/oned/rss/expanded/BitArrayBuilder.ts on lines 18..23
                    src/core/oned/rss/expanded/BitArrayBuilder.ts on lines 29..34

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 58.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Severity
                    Category
                    Status
                    Source
                    Language