zxing-js/library

View on GitHub

Showing 958 of 958 total issues

Function decodeOnce has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  public decodeOnce(
    element: HTMLVisualMediaElement,
    retryIfNotFound = true,
    retryIfChecksumOrFormatError = true
  ): Promise<Result> {
Severity: Minor
Found in src/browser/BrowserCodeReader.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function adjustIncompleteIndicatorColumnRowNumbers has a Cognitive Complexity of 10 (exceeds 5 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

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function terminateBits has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static terminateBits(numDataBytes: number /*int*/, bits: BitArray): void /*throws WriterException*/ {
        const capacity = numDataBytes * 8;
        if (bits.getSize() > capacity) {
            throw new WriterException('data bits cannot fit in the QR Code' + bits.getSize() + ' > ' +
                capacity);
Severity: Minor
Found in src/core/qrcode/encoder/Encoder.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function buildFunctionPattern has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public buildFunctionPattern(): BitMatrix {
        const dimension = this.getDimensionForVersion();
        const bitMatrix = new BitMatrix(dimension);

        // Top left finder pattern + separator + format
Severity: Minor
Found in src/core/qrcode/decoder/Version.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function readVersion has a Cognitive Complexity of 10 (exceeds 5 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

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function constructor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public constructor(field: AbstractGenericGF, coefficients: Int32Array) {
        if (coefficients.length === 0) {
            throw new IllegalArgumentException();
        }
        this.field = field;
Severity: Minor
Found in src/core/common/reedsolomon/GenericGFPoly.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function toString has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  public toString(): String {
    let rowIndicatorColumn: DetectionResultColumn = this.detectionResultColumns[0];
    if (rowIndicatorColumn == null) {
      rowIndicatorColumn = this.detectionResultColumns[this.barcodeColumnCount + 1];
    }
Severity: Minor
Found in src/core/pdf417/decoder/DetectionResult.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function adjustCodewordStartColumn has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  private static adjustCodewordStartColumn(image: BitMatrix,
    minColumn: int,
    maxColumn: int,
    leftToRight: boolean,
    codewordStartColumn: int,
Severity: Minor
Found in src/core/pdf417/decoder/PDF417ScanningDecoder.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function constructor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(field: ModulusBase, coefficients: Int32Array) {
    if (coefficients.length === 0) {
      throw new IllegalArgumentException();
    }
    this.field = field;
Severity: Minor
Found in src/core/pdf417/decoder/ec/ModulusPoly.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function adjustBoundingBox has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  private static adjustBoundingBox(rowIndicatorColumn: DetectionResultRowIndicatorColumn): BoundingBox {
    if (rowIndicatorColumn == null) {
      return null;
    }
    let rowHeights: Int32Array = rowIndicatorColumn.getRowHeights();
Severity: Minor
Found in src/core/pdf417/decoder/PDF417ScanningDecoder.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function constructor has a Cognitive Complexity of 10 (exceeds 5 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

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function adjustRowNumbersAndGetCount has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  private adjustRowNumbersAndGetCount(): int {
    let unadjustedCount: int = this.adjustRowNumbersByRow();
    if (unadjustedCount === 0) {
      return 0;
    }
Severity: Minor
Found in src/core/pdf417/decoder/DetectionResult.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function runEuclideanAlgorithm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private runEuclideanAlgorithm(a: GenericGFPoly, b: GenericGFPoly, R: number /*int*/): GenericGFPoly[] {
        // Assume a's degree is >= b's
        if (a.getDegree() < b.getDegree()) {
            const temp = a;
            a = b;
Severity: Minor
Found in src/core/common/reedsolomon/ReedSolomonDecoder.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function decode has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  public decode(received: Int32Array,
    numECCodewords: int,
    erasures: Int32Array): int {

    let poly: ModulusPoly = new ModulusPoly(this.field, received);
Severity: Minor
Found in src/core/pdf417/decoder/ec/ErrorCorrection.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function decodeMiddle has a Cognitive Complexity of 10 (exceeds 5 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

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function isFinderPattern has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  protected static isFinderPattern(counters: Int32Array): boolean {
    let firstTwoSum = counters[0] + counters[1];
    let sum = firstTwoSum + counters[2] + counters[3];
    let ratio = firstTwoSum / sum;
    if (ratio >= AbstractRSSReader.MIN_FINDER_PATTERN_RATIO && ratio <= AbstractRSSReader.MAX_FINDER_PATTERN_RATIO) {
Severity: Minor
Found in src/core/oned/rss/AbstractRSSReader.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function decodeMiddle has a Cognitive Complexity of 10 (exceeds 5 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

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function checkRows has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  private checkRows(
    collectedRows: any,
    currentRow: number
  ): Array<ExpandedPair> {
    for (let i = currentRow; i < this.rows.length; i++) {
Severity: Minor
Found in src/core/oned/rss/expanded/RSSExpandedReader.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function parseNumericBlock has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  private parseNumericBlock(): BlockParsedResult {
    while (this.isStillNumeric(this.current.getPosition())) {
      let numeric: DecodedNumeric = this.decodeNumeric(this.current.getPosition());
      this.current.setPosition(numeric.getNewPosition());

Severity: Minor
Found in src/core/oned/rss/expanded/decoders/GeneralAppIdDecoder.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function decodeRow has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  public decodeRow(rowNumber: number, row: BitArray, hints?: Map<DecodeHintType, any>): Result {

    // Find out where the Middle section (payload) starts & ends
    let startRange: number[] = this.decodeStart(row);
    let endRange: number[] = this.decodeEnd(row);
Severity: Minor
Found in src/core/oned/ITFReader.ts - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language