gardejo/js-kancolle-logistics-visualizer

View on GitHub

Showing 33 of 113 total issues

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

module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        // http://stackoverflow.com/questions/90002/
        // "What is a reasonable code coverage for unit tests (and why)?"
Severity: Major
Found in Gruntfile.js - About 1 day to fix

    Function indexOf has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

      Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
    
        if (this === null) {
          throw new TypeError();
        }
    Severity: Minor
    Found in lib/polyfill.js - About 3 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

    Function Ships has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    kclv.Game.Ships = ( function() {
        return {
            /**
             * Array of abbreviations for ship classification.
             *     Caveat: WSH's Active Script engine requires us to append
    Severity: Major
    Found in lib/game.js - About 2 hrs to fix

      File tokenizer.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * @fileOverview A partical object for tokenizers.
       * @author kclv@ermitejo.com (MORIYA Masaki, alias Gardejo)
       * @license The MIT license (See LICENSE file)
       */
      Severity: Minor
      Found in lib/tokenizer.js - About 2 hrs to fix

        Function reduce has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

          Array.prototype.reduce = function reduce(accumulator){
            if (this===null || this===undefined) {
              throw new TypeError("Object is null or undefined");
            }
        
        Severity: Minor
        Found in lib/polyfill.js - 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 Array has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

        kclv.Array = ( function() {
            return {
                /**
                 * Get a subset of specified array by specified indices.
                 *     It is similar to a slice access to array in Perl
        Severity: Minor
        Found in lib/array.js - 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 filter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

          Array.prototype.filter = function(fun /*, thisArg */)
          {
        
            if (this === void 0 || this === null) {
              throw new TypeError();
        Severity: Minor
        Found in lib/polyfill.js - 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 Array has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        kclv.Array = ( function() {
            return {
                /**
                 * Get a subset of specified array by specified indices.
                 *     It is similar to a slice access to array in Perl
        Severity: Minor
        Found in lib/array.js - About 1 hr to fix

          Function map has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            Array.prototype.map = function(fun /*, thisArg */)
            {
          
              if (this === void 0 || this === null) {
                throw new TypeError();
          Severity: Minor
          Found in lib/polyfill.js - 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 buildOption has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          kclv.Chart.Line.prototype.buildOption = function() {
              var material = this.table.kind,
                  kind = kclv.Game.Materials.getKindOf(material),
                  configuration = this.cascadeHorizontalConfiguration(kind, 'Materials'),
                  option =
          Severity: Minor
          Found in lib/chart.material.js - About 1 hr to fix

            Function Configuration has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            kclv.Configuration = ( function() {
                /**
                 * The configuration structure as a Flyweight object.
                 * @private {Object.<string, *>}
                 */
            Severity: Minor
            Found in lib/configuration.js - About 1 hr to fix

              Function visualize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              kclv.Visualizer.prototype.visualize = function(directive) {
                  if (! directive) {
                      throw new Error('Visualizer requires some directive.');
                  }
              
              Severity: Minor
              Found in lib/visualizer.js - About 1 hr to fix

                Function buildRows has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                kclv.Table.Ships.Base.prototype.buildRows = function() {
                    var indexOf = this.getClassificationDictionary_(),
                        attributeOf = this.relation.getAttributes(),
                        relation = this.canonizeRelation_(attributeOf),
                        mothballLevel =
                Severity: Minor
                Found in lib/table.ship.js - About 1 hr to fix

                  Function keys has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Object.keys = (function () {
                      var hasOwnProperty = Object.prototype.hasOwnProperty,
                          hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
                          dontEnums = [
                            'toString',
                  Severity: Minor
                  Found in lib/polyfill.js - About 1 hr to fix

                    Function Materials has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    kclv.Game.Materials = ( function() {
                        /**
                         * (Reserved) The maximum value of supplies of materials.
                         * @private {Object.<string, number>}
                         * @const
                    Severity: Minor
                    Found in lib/game.js - About 1 hr to fix

                      Function forEach has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                       Array.prototype.forEach = function( callback, thisArg ) {
                      
                         var T, k;
                      
                         if ( this === null ) {
                      Severity: Minor
                      Found in lib/polyfill.js - 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 buildRows has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      kclv.Table.Ships.Bubble.prototype.buildRows = function() {
                          var roster = this.buildRoster_(),
                              threshold =
                                  kclv.Configuration.get('chart.Ships.vertical.level', true) || 0,
                              label = kclv.Configuration.get([
                      Severity: Minor
                      Found in lib/table.ship.js - About 1 hr to fix

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

                        kclv.Game.Materials = ( function() {
                            /**
                             * (Reserved) The maximum value of supplies of materials.
                             * @private {Object.<string, number>}
                             * @const
                        Severity: Minor
                        Found in lib/game.js - 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 indexOf has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
                        
                            if (this === null) {
                              throw new TypeError();
                            }
                        Severity: Minor
                        Found in lib/polyfill.js - About 1 hr to fix

                          Function toPeriod has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          kclv.Date.prototype.toPeriod = function(frequency) {
                              switch (frequency) {
                                  case 'Yearly':
                                      return {
                                          v : this.toNewYearsDay(),
                          Severity: Minor
                          Found in lib/date.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language