Strilanc/Quirk

View on GitHub

Showing 241 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

        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

                        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

                            Rect has 42 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Rect {
                                /**
                                 * @param {!number} x
                                 * @param {!number} y
                                 * @param {!number} w
                            Severity: Minor
                            Found in src/math/Rect.js - About 5 hrs to fix

                              Function parseFormula has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function parseFormula(text, tokenMap) {
                                  let tokens = _tokenize(text).map(e => _translate_token(e, tokenMap));
                              
                                  // Cut off trailing operation, so parse fails less often as users are typing.
                                  if (tokens.length > 0 && tokens[tokens.length - 1].priority !== undefined) {
                              Severity: Minor
                              Found in src/math/FormulaParser.js - About 5 hrs 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

                              File GatePainting.js has 365 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/GatePainting.js - About 4 hrs to fix

                                Function initExports has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function initExports(revision, mostRecentStats, obsIsAnyOverlayShowing) {
                                    // Show/hide exports overlay.
                                    (() => {
                                        const exportButton = /** @type {!HTMLButtonElement} */ document.getElementById('export-button');
                                        const exportOverlay = /** @type {!HTMLDivElement} */ document.getElementById('export-overlay');
                                Severity: Major
                                Found in src/ui/exports.js - About 4 hrs to fix

                                  File forge.js has 344 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/forge.js - About 4 hrs to fix

                                    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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language