zxing-js/library

View on GitHub

Showing 958 of 958 total issues

Avoid too many return statements within this function.
Open

      return StringUtils.ISO88591;
Severity: Major
Found in src/core/common/StringUtils.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return StringUtils.UTF8;
    Severity: Major
    Found in src/core/common/StringUtils.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return leftToRight ? detectionResult.getBoundingBox().getMinX() : detectionResult.getBoundingBox().getMaxX();
      Severity: Major
      Found in src/core/pdf417/decoder/PDF417ScanningDecoder.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return StringUtils.PLATFORM_DEFAULT_ENCODING;
        Severity: Major
        Found in src/core/common/StringUtils.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return StringUtils.SHIFT_JIS;
          Severity: Major
          Found in src/core/common/StringUtils.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return FieldParser.processFixedAI(4, <number>dataLength[1], rawInformation);
            Severity: Major
            Found in src/core/oned/rss/expanded/decoders/FieldParser.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return FieldParser.processFixedAI(3, <number>dataLength[1], rawInformation);
              Severity: Major
              Found in src/core/oned/rss/expanded/decoders/FieldParser.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                          return FieldParser.processVariableAI(4, <number>dataLength[2], rawInformation);
                Severity: Major
                Found in src/core/oned/rss/expanded/decoders/FieldParser.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return new DecodedChar(pos + 8, c);
                  Severity: Major
                  Found in src/core/oned/rss/expanded/decoders/GeneralAppIdDecoder.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return false;
                    Severity: Major
                    Found in src/core/oned/rss/expanded/decoders/GeneralAppIdDecoder.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                return FieldParser.processVariableAI(4, <number>dataLength[2], rawInformation);
                      Severity: Major
                      Found in src/core/oned/rss/expanded/decoders/FieldParser.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return FieldParser.processFixedAI(4, <number>dataLength[1], rawInformation);
                        Severity: Major
                        Found in src/core/oned/rss/expanded/decoders/FieldParser.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return eightBitValue >= 232 && eightBitValue < 253;
                          Severity: Major
                          Found in src/core/oned/rss/expanded/decoders/GeneralAppIdDecoder.ts - About 30 mins to fix

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

                                        this.a12 * other.a21 + this.a22 * other.a22 + this.a32 * other.a23,
                            Severity: Major
                            Found in src/core/common/PerspectiveTransform.ts and 8 other locations - About 30 mins to fix
                            src/core/common/PerspectiveTransform.ts on lines 157..157
                            src/core/common/PerspectiveTransform.ts on lines 158..158
                            src/core/common/PerspectiveTransform.ts on lines 159..159
                            src/core/common/PerspectiveTransform.ts on lines 160..160
                            src/core/common/PerspectiveTransform.ts on lines 162..162
                            src/core/common/PerspectiveTransform.ts on lines 163..163
                            src/core/common/PerspectiveTransform.ts on lines 164..164
                            src/core/common/PerspectiveTransform.ts on lines 165..165

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

                            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

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

                                for (let i = 0; i < numCounters; i++) {
                                  total += counters[i];
                                  patternLength += pattern[i];
                                }
                            Severity: Minor
                            Found in src/core/pdf417/detector/Detector.ts and 1 other location - About 30 mins to fix
                            src/core/oned/OneDReader.ts on lines 248..251

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

                            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

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

                                    const multiple = Math.min(Math.floor(outputWidth / qrWidth), Math.floor(outputHeight / qrHeight));
                            Severity: Minor
                            Found in src/core/qrcode/QRCodeWriter.ts and 2 other locations - About 30 mins to fix
                            src/browser/BrowserQRCodeSvgWriter.ts on lines 106..106
                            src/browser/BrowserSvgCodeWriter.ts on lines 106..106

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

                            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

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

                                    const multiple = Math.min(Math.floor(outputWidth / qrWidth), Math.floor(outputHeight / qrHeight));
                            Severity: Minor
                            Found in src/browser/BrowserSvgCodeWriter.ts and 2 other locations - About 30 mins to fix
                            src/browser/BrowserQRCodeSvgWriter.ts on lines 106..106
                            src/core/qrcode/QRCodeWriter.ts on lines 96..96

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

                            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

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

                                public encode(contents: string,
                                    format: BarcodeFormat,
                                    width: number /*int*/,
                                    height: number /*int*/,
                                    hints: Map<EncodeHintType, any>): BitMatrix /*throws WriterException */ {
                            Severity: Minor
                            Found in src/core/qrcode/QRCodeWriter.ts and 1 other location - About 30 mins to fix
                            src/core/MultiFormatWriter.ts on lines 57..107

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

                            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

                                  if (possibleFormats.includes(BarcodeFormat.EAN_13) ||
                                    possibleFormats.includes(BarcodeFormat.UPC_A) ||
                                    possibleFormats.includes(BarcodeFormat.EAN_8) ||
                            Severity: Minor
                            Found in src/core/oned/MultiFormatOneDReader.ts and 1 other location - About 30 mins to fix
                            src/core/util/StringEncoding.ts on lines 128..130

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

                            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

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

                                public encode(contents: string,
                                    format: BarcodeFormat,
                                    width: number /*int*/, height: number /*int*/,
                                    hints: Map<EncodeHintType, any>): BitMatrix /*throws WriterException */ {
                            
                            
                            Severity: Minor
                            Found in src/core/MultiFormatWriter.ts and 1 other location - About 30 mins to fix
                            src/core/qrcode/QRCodeWriter.ts on lines 49..80

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

                            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