gardejo/js-kancolle-logistics-visualizer

View on GitHub

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

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

        var material = this.table.kind,
            kind = kclv.Game.Materials.getKindOf(material),
            configuration = this.cascadeHorizontalConfiguration(kind, 'Materials'),
            option =
                kclv.Chart.Base.prototype.buildOption.call(this, configuration);
    Severity: Major
    Found in lib/chart.material.js and 1 other location - About 2 hrs to fix
    lib/chart.material.js on lines 38..42

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

    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

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

        var material = this.table.kind,
            kind = kclv.Game.Materials.getKindOf(material),
            configuration = this.cascadeHorizontalConfiguration(kind, 'Materials'),
            option =
                kclv.Chart.Base.prototype.buildOption.call(this, configuration);
    Severity: Major
    Found in lib/chart.material.js and 1 other location - About 2 hrs to fix
    lib/chart.material.js on lines 123..127

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

    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

    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

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

                      kclv.Formatter.prototype.quote = function(target, opt_indices) {
                          return this.format_(
                              function(string) { return '"' + string + '"'; },
                              target,
                              opt_indices
                      Severity: Major
                      Found in lib/formatter.js and 1 other location - About 1 hr to fix
                      lib/formatter.js on lines 95..101

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

                      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

                      kclv.Formatter.prototype.parenthesize = function(target, opt_indices) {
                          return this.format_(
                              function(string) { return '(' + string + ')'; },
                              target,
                              opt_indices
                      Severity: Major
                      Found in lib/formatter.js and 1 other location - About 1 hr to fix
                      lib/formatter.js on lines 51..57

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

                      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

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language