Strilanc/Quirk

View on GitHub

Showing 478 of 478 total issues

File AllGates.js has 327 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Copyright 2017 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
Severity: Minor
Found in src/gates/AllGates.js - About 3 hrs to fix

    File ParametrizedRotationGates.js has 326 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Copyright 2017 Google Inc.
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
    Severity: Minor
    Found in src/gates/ParametrizedRotationGates.js - About 3 hrs to fix

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

      function unspreadFloatVec2(pixelData) {
          let result = new Float32Array(pixelData.length >> 1);
          for (let i = 0; i*2 < result.length; i++) {
              result[2*i] = pixelData[4*i];
              result[2*i+1] = pixelData[4*i+1];
      Severity: Major
      Found in src/webgl/ShaderCoders_intoFloats.js and 1 other location - About 3 hrs to fix
      src/webgl/ShaderCoders_intoFloats.js on lines 109..116

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

      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

      ComparisonGates.AGreaterThanB = new GateBuilder().
          setAlternate(ComparisonGates.ALessThanOrEqualToB).
          setSerializedId("^A>B").
          setSymbol("⊕A>B").
          setTitle("Greater-Than Gate").
      Severity: Major
      Found in src/gates/ComparisonGates.js and 2 other locations - About 3 hrs to fix
      src/gates/ComparisonGates.js on lines 72..81
      src/gates/ComparisonGates.js on lines 93..102

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

      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

      ComparisonGates.ANotEqualToB = new GateBuilder().
          setAlternate(ComparisonGates.AEqualToB).
          setSerializedId("^A!=B").
          setSymbol("⊕A≠B").
          setTitle("Inequality Gate").
      Severity: Major
      Found in src/gates/ComparisonGates.js and 2 other locations - About 3 hrs to fix
      src/gates/ComparisonGates.js on lines 61..70
      src/gates/ComparisonGates.js on lines 72..81

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

      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

      ComparisonGates.AGreaterThanOrEqualToB = new GateBuilder().
          setAlternate(ComparisonGates.ALessThanB).
          setSerializedId("^A>=B").
          setSymbol("⊕A≥B").
          setTitle("At-Least Gate").
      Severity: Major
      Found in src/gates/ComparisonGates.js and 2 other locations - About 3 hrs to fix
      src/gates/ComparisonGates.js on lines 61..70
      src/gates/ComparisonGates.js on lines 93..102

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

      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

      function spreadFloatVec2(vec2Data) {
          let result = new Float32Array(vec2Data.length << 1);
          for (let i = 0; i*2 < vec2Data.length; i++) {
              result[4*i] = vec2Data[2*i];
              result[4*i+1] = vec2Data[2*i+1];
      Severity: Major
      Found in src/webgl/ShaderCoders_intoFloats.js and 1 other location - About 3 hrs to fix
      src/webgl/ShaderCoders_intoFloats.js on lines 134..141

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

      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

      module.exports = function(config) {
          config.set({
              basePath: '',
              frameworks: [],
              files: ['out/test_perf.js'],
      Severity: Major
      Found in karma.test_perf.conf.js and 1 other location - About 3 hrs to fix
      karma.test.conf.js on lines 17..33

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

      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

      module.exports = function(config) {
          config.set({
              basePath: '',
              frameworks: [],
              files: ['out/test.js'],
      Severity: Major
      Found in karma.test.conf.js and 1 other location - About 3 hrs to fix
      karma.test_perf.conf.js on lines 17..33

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

      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

      File Painter.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * Copyright 2017 Google Inc.
       *
       * Licensed under the Apache License, Version 2.0 (the "License");
       * you may not use this file except in compliance with the License.
      Severity: Minor
      Found in src/draw/Painter.js - About 3 hrs to fix

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

                    for (let c = 0; c < r && c < this._width; c++) {
                        let k = (r*this._width + c)*2;
                        let v1 = this._buffer[k];
                        let v2 = this._buffer[k+1];
                        if (isNaN(v1) || isNaN(v2) || v1*v1 + v2*v2 > epsilon*epsilon) {
        Severity: Major
        Found in src/math/Matrix.js and 1 other location - About 3 hrs to fix
        src/math/Matrix.js on lines 329..336

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

        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 c = r + 1; c < this._width; c++) {
                        let k = (r*this._width + c)*2;
                        let v1 = this._buffer[k];
                        let v2 = this._buffer[k+1];
                        if (isNaN(v1) || isNaN(v2) || v1*v1 + v2*v2 > epsilon*epsilon) {
        Severity: Major
        Found in src/math/Matrix.js and 1 other location - About 3 hrs to fix
        src/math/Matrix.js on lines 347..354

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

        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

        File Detector.js has 316 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Copyright 2017 Google Inc.
         *
         * Licensed under the Apache License, Version 2.0 (the "License");
         * you may not use this file except in compliance with the License.
        Severity: Minor
        Found in src/gates/Detector.js - About 3 hrs to fix

          File GateColumn.js has 315 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * Copyright 2017 Google Inc.
           *
           * Licensed under the Apache License, Version 2.0 (the "License");
           * you may not use this file except in compliance with the License.
          Severity: Minor
          Found in src/circuit/GateColumn.js - About 3 hrs to fix

            Complex has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Complex {
                /**
                 * @param {!number} real The real part of the Complex number. The 'a' in a + bi.
                 * @param {!number} imag The imaginary part of the Complex number. The 'b' in a + bi.
                 */
            Severity: Minor
            Found in src/math/Complex.js - About 3 hrs to fix

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

              ArithmeticGates.MinusAFamily = Gate.buildFamily(1, 16, (span, builder) => builder.
                  setAlternateFromFamily(ArithmeticGates.PlusAFamily).
                  setSerializedId("-=A" + span).
                  setSymbol("−A").
                  setTitle("Subtraction Gate [input A]").
              Severity: Major
              Found in src/gates/ArithmeticGates.js and 1 other location - About 3 hrs to fix
              src/gates/BitCountGates.js on lines 51..61

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

              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

              BitCountGates.MinusBitCountAFamily = Gate.buildFamily(1, 16, (span, builder) => builder.
                  setAlternateFromFamily(BitCountGates.PlusBitCountAFamily).
                  setSerializedIdAndSymbol("-cntA" + span).
                  setSymbol("-1s(A)").
                  setTitle("Bit Un-Count Gate").
              Severity: Major
              Found in src/gates/BitCountGates.js and 1 other location - About 3 hrs to fix
              src/gates/ArithmeticGates.js on lines 81..91

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

              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

                  getRow(rowIndex) {
                      Util.need(rowIndex >= 0 && rowIndex <= this.height(), "rowIndex >= 0 && rowIndex <= this.height()");
                      let row = [];
                      for (let c = 0; c < this._width; c++) {
                          row.push(this.cell(c, rowIndex));
              Severity: Major
              Found in src/math/Matrix.js and 1 other location - About 3 hrs to fix
              src/math/Matrix.js on lines 1382..1389

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

              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

                  getColumn(colIndex) {
                      Util.need(colIndex >= 0 && colIndex <= this.width(), "colIndex >= 0 && colIndex <= this.width()");
                      let col = [];
                      for (let r = 0; r < this._height; r++) {
                          col.push(this.cell(colIndex, r));
              Severity: Major
              Found in src/math/Matrix.js and 1 other location - About 3 hrs to fix
              src/math/Matrix.js on lines 1395..1402

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

              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

              File DisplayedInspector.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * Copyright 2017 Google Inc.
               *
               * Licensed under the Apache License, Version 2.0 (the "License");
               * you may not use this file except in compliance with the License.
              Severity: Minor
              Found in src/ui/DisplayedInspector.js - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language