gardejo/js-kancolle-logistics-visualizer

View on GitHub
lib/polyfill.js

Summary

Maintainability
D
1 day
Test Coverage

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 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 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 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 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 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 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 fill has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        Array.prototype.fill = function(value) {
      
          var radix = 10;
      
          // Steps 1-2.
      Severity: Minor
      Found in lib/polyfill.js - About 55 mins 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 bind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        Function.prototype.bind = function (thisObject) {
          if (typeof this !== "function") {
            // closest thing possible to the ECMAScript 5
            // internal IsCallable function
            throw new TypeError(
      Severity: Minor
      Found in lib/polyfill.js - About 25 mins 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

      There are no issues that match your filters.

      Category
      Status