Strilanc/Quirk

View on GitHub

Showing 478 of 478 total issues

File DisplayedCircuit.js has 1126 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: Major
Found in src/ui/DisplayedCircuit.js - About 2 days to fix

    File Matrix.js has 891 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: Major
    Found in src/math/Matrix.js - About 2 days to fix

      File CircuitDefinition.js has 738 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: Major
      Found in src/circuit/CircuitDefinition.js - About 1 day to fix

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

            _inline_rowMix_preMultiply(row1, row2, op) {
                let [a, b, c, d] = op._2x2Breakdown();
                for (let col = 0; col < this._width; col++) {
                    let x = this.cell(col, row1);
                    let y = this.cell(col, row2);
        Severity: Major
        Found in src/math/Matrix.js and 1 other location - About 1 day to fix
        src/math/Matrix.js on lines 975..989

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

        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

            _inline_colMix_postMultiply(col1, col2, op) {
                let [a, b, c, d] = op._2x2Breakdown();
                for (let row = 0; row < this._width; row++) {
                    let x = this.cell(col1, row);
                    let y = this.cell(col2, row);
        Severity: Major
        Found in src/math/Matrix.js and 1 other location - About 1 day to fix
        src/math/Matrix.js on lines 953..967

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

        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 Seq.js has 629 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: Major
        Found in src/base/Seq.js - About 1 day to fix

          Matrix has 70 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Matrix {
              /**
               * @param {int} width
               * @param {int} height
               * @param {!Float64Array|!Float32Array} buffer Complex value data, packed row-wise with real and imaginary
          Severity: Major
          Found in src/math/Matrix.js - About 1 day to fix

            DisplayedCircuit has 61 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class DisplayedCircuit {
                /**
                 *
                 * @param {!number} top
                 * @param {!CircuitDefinition} circuitDefinition
            Severity: Major
            Found in src/ui/DisplayedCircuit.js - About 1 day to fix

              Seq has 59 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Seq {
                  /**
                   * Wraps the given array, collection, or other iterable.
                   * Use fromGenerator for wrapping generator functions.
                   *
              Severity: Major
              Found in src/base/Seq.js - About 1 day to fix

                CircuitDefinition has 59 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class CircuitDefinition {
                    /**
                     * @param {!int} numWires
                     * @param {!Array.<!GateColumn>} columns
                     * @param {undefined|!int=} outerRowOffset
                Severity: Major
                Found in src/circuit/CircuitDefinition.js - About 1 day to fix

                  Function initForge has 202 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function initForge(revision, obsIsAnyOverlayShowing) {
                      const obsOnShown = obsForgeIsShowing.filter(e => e === true);
                      /** @type {!String} */
                      let latestInspectorText;
                      revision.latestActiveCommit().subscribe(e => { latestInspectorText = e; });
                  Severity: Major
                  Found in src/ui/forge.js - About 1 day to fix

                    Function exports has 192 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function(grunt) {
                        //noinspection JSUnresolvedFunction
                        grunt.initConfig({
                            pkg: grunt.file.readJSON('package.json'),
                            traceur: {
                    Severity: Major
                    Found in GruntFile.js - About 7 hrs to fix

                      File Gate.js has 478 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/Gate.js - About 7 hrs to fix

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

                            static decohereMeasuredBitsInDensityMatrix(densityMatrix, isMeasuredMask) {
                                if (isMeasuredMask === 0) {
                                    return densityMatrix;
                                }
                        
                        
                        Severity: Major
                        Found in src/circuit/CircuitStats.js and 1 other location - About 6 hrs to fix
                        src/gates/DensityMatrixDisplay.js on lines 107..124

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

                        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 decohereMeasuredBitsInDensityMatrix(densityMatrix, isMeasuredMask) {
                            if (isMeasuredMask === 0) {
                                return densityMatrix;
                            }
                        
                        
                        Severity: Major
                        Found in src/gates/DensityMatrixDisplay.js and 1 other location - About 6 hrs to fix
                        src/circuit/CircuitStats.js on lines 247..264

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

                        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 MathPainter.js has 442 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/MathPainter.js - About 6 hrs to fix

                          GateBuilder has 45 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class GateBuilder {
                              constructor() {
                                  this.gate = new Gate();
                              }
                          
                          
                          Severity: Minor
                          Found in src/circuit/Gate.js - About 6 hrs to fix

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

                                plus(other) {
                                    let {_width: w, _height: h, _buffer: b1} = this;
                                    let b2 = other._buffer;
                                    Util.need(other._width === w && other._height === h, "Matrix.plus: compatible sizes");
                            
                            
                            Severity: Major
                            Found in src/math/Matrix.js and 1 other location - About 6 hrs to fix
                            src/math/Matrix.js on lines 589..599

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

                            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

                                minus(other) {
                                    let {_width: w, _height: h, _buffer: b1} = this;
                                    let b2 = other._buffer;
                                    Util.need(other._width === w && other._height === h, "Matrix.minus: compatible sizes");
                            
                            
                            Severity: Major
                            Found in src/math/Matrix.js and 1 other location - About 6 hrs to fix
                            src/math/Matrix.js on lines 572..582

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

                            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

                            ParametrizedRotationGates.FormulaicRotationRz = new GateBuilder().
                                setSerializedIdAndSymbol("Rzft").
                                setTitle("Formula Rz Gate").
                                setBlurb("Rotates around Z by an angle in radians determined by a formula.").
                                setDrawer(configurableRotationDrawer('Rz(f(t))', 2, 1)).
                            Severity: Major
                            Found in src/gates/ParametrizedRotationGates.js and 2 other locations - About 5 hrs to fix
                            src/gates/ParametrizedRotationGates.js on lines 342..353
                            src/gates/ParametrizedRotationGates.js on lines 355..366

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

                            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