zxing-js/library

View on GitHub

Showing 958 of 958 total issues

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

        const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4];
Severity: Minor
Found in src/core/qrcode/detector/FinderPatternFinder.ts and 2 other locations - About 35 mins to fix
src/core/qrcode/detector/FinderPatternFinder.ts on lines 394..395
src/core/qrcode/detector/FinderPatternFinder.ts on lines 463..464

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

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

  public getCharset(index: number): Charset {
    if (!(index < this.length())) {
      throw new Error('index must be less than length');
    }
    return this.encoders[index].charset;
Severity: Minor
Found in src/core/common/ECIEncoderSet.ts and 1 other location - About 35 mins to fix
src/core/common/ECIEncoderSet.ts on lines 154..159

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

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

        const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] +
            stateCount[4];
Severity: Minor
Found in src/core/qrcode/detector/FinderPatternFinder.ts and 2 other locations - About 35 mins to fix
src/core/qrcode/detector/FinderPatternFinder.ts on lines 320..320
src/core/qrcode/detector/FinderPatternFinder.ts on lines 463..464

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

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

                            points[0] = new ResultPoint(width - points[0].getX() - 1, points[0].getY());
Severity: Minor
Found in src/core/oned/OneDReader.ts and 1 other location - About 35 mins to fix
src/core/oned/OneDReader.ts on lines 157..157

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

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

  public getCharsetName(index: number): string {
    if (!(index < this.length())) {
      throw new Error('index must be less than length');
    }
    return this.encoders[index].name;
Severity: Minor
Found in src/core/common/ECIEncoderSet.ts and 1 other location - About 35 mins to fix
src/core/common/ECIEncoderSet.ts on lines 161..166

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

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

                            points[1] = new ResultPoint(width - points[1].getX() - 1, points[1].getY());
Severity: Minor
Found in src/core/oned/OneDReader.ts and 1 other location - About 35 mins to fix
src/core/oned/OneDReader.ts on lines 156..156

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

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 4 locations. Consider refactoring.
Open

        if (incrementEven) {
            if (decrementEven) {
                throw new NotFoundException();
            }
            AbstractRSSReader.increment(this.getEvenCounts(), this.getOddRoundingErrors());
Severity: Major
Found in src/core/oned/rss/RSS14Reader.ts and 3 other locations - About 35 mins to fix
src/core/oned/rss/RSS14Reader.ts on lines 404..409
src/core/oned/rss/expanded/RSSExpandedReader.ts on lines 887..895
src/core/oned/rss/expanded/RSSExpandedReader.ts on lines 902..910

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

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

        const stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] +
            stateCount[4];
Severity: Minor
Found in src/core/qrcode/detector/FinderPatternFinder.ts and 2 other locations - About 35 mins to fix
src/core/qrcode/detector/FinderPatternFinder.ts on lines 320..320
src/core/qrcode/detector/FinderPatternFinder.ts on lines 394..395

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

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 4 locations. Consider refactoring.
Open

    if (incrementEven) {
      if (decrementEven) {
        throw new NotFoundException();
      }
      RSSExpandedReader.increment(
Severity: Major
Found in src/core/oned/rss/expanded/RSSExpandedReader.ts and 3 other locations - About 35 mins to fix
src/core/oned/rss/RSS14Reader.ts on lines 404..409
src/core/oned/rss/RSS14Reader.ts on lines 413..418
src/core/oned/rss/expanded/RSSExpandedReader.ts on lines 887..895

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

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

Avoid too many return statements within this function.
Open

      return 2;
Severity: Major
Found in src/core/datamatrix/encoder/TextEncoder.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return len;
    Severity: Major
    Found in src/core/datamatrix/encoder/C40Encoder.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return 2;
      Severity: Major
      Found in src/core/datamatrix/encoder/MinimalEncoder.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return 2;
        Severity: Major
        Found in src/core/datamatrix/encoder/TextEncoder.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return 2;
          Severity: Major
          Found in src/core/datamatrix/encoder/MinimalEncoder.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return X12_ENCODATION;
            Severity: Major
            Found in src/core/datamatrix/encoder/HighLevelEncoder.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                        return EDIFACT_ENCODATION;
              Severity: Major
              Found in src/core/datamatrix/encoder/HighLevelEncoder.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return 2;
                Severity: Major
                Found in src/core/datamatrix/encoder/C40Encoder.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return 1;
                  Severity: Major
                  Found in src/core/datamatrix/encoder/MinimalEncoder.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return 2;
                    Severity: Major
                    Found in src/core/datamatrix/encoder/MinimalEncoder.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return 0;
                      Severity: Major
                      Found in src/core/datamatrix/encoder/MinimalEncoder.ts - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language