handsontable/formula.js

View on GitHub
lib/statistical.js

Summary

Maintainability
F
3 wks
Test Coverage

File statistical.js has 1548 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var mathTrig = require('./math-trig');
var text = require('./text');
var jStat = require('jstat');
var utils = require('./utils/common');
var evalExpression = require('./utils/criteria-eval');
Severity: Major
Found in lib/statistical.js - About 4 days to fix

    Function has too many statements (45). Maximum allowed is 30.
    Open

    exports.GROWTH = function(known_y, known_x, new_x, use_const) {
    Severity: Minor
    Found in lib/statistical.js by eslint

    enforce a maximum number of statements allowed in function blocks (max-statements)

    The max-statements rule allows you to specify the maximum number of statements allowed in a function.

    function foo() {
      var bar = 1; // one statement
      var baz = 2; // two statements
      var qux = 3; // three statements
    }

    Rule Details

    This rule enforces a maximum number of statements allowed in function blocks.

    Options

    This rule has a number or object option:

    • "max" (default 10) enforces a maximum number of statements allows in function blocks

    Deprecated: The object property maximum is deprecated; please use the object property max instead.

    This rule has an object option:

    • "ignoreTopLevelFunctions": true ignores top-level functions

    max

    Examples of incorrect code for this rule with the default { "max": 10 } option:

    /*eslint max-statements: ["error", 10]*/
    /*eslint-env es6*/
    
    function foo() {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
    
      var foo11 = 11; // Too many.
    }
    
    let foo = () => {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
    
      var foo11 = 11; // Too many.
    };

    Examples of correct code for this rule with the default { "max": 10 } option:

    /*eslint max-statements: ["error", 10]*/
    /*eslint-env es6*/
    
    function foo() {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
      return function () {
    
        // The number of statements in the inner function does not count toward the
        // statement maximum.
    
        return 42;
      };
    }
    
    let foo = () => {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
      return function () {
    
        // The number of statements in the inner function does not count toward the
        // statement maximum.
    
        return 42;
      };
    }

    ignoreTopLevelFunctions

    Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

    /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
    
    function foo() {
      var foo1 = 1;
      var foo2 = 2;
      var foo3 = 3;
      var foo4 = 4;
      var foo5 = 5;
      var foo6 = 6;
      var foo7 = 7;
      var foo8 = 8;
      var foo9 = 9;
      var foo10 = 10;
      var foo11 = 11;
    }

    Related Rules

    • [complexity](complexity.md)
    • [max-depth](max-depth.md)
    • [max-len](max-len.md)
    • [max-nested-callbacks](max-nested-callbacks.md)
    • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

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

    exports.FREQUENCY = function(data, bins) {
      data = utils.parseNumberArray(utils.flatten(data));
      bins = utils.parseNumberArray(utils.flatten(bins));
      if (utils.anyIsError(data, bins)) {
        return error.value;
    Severity: Minor
    Found in lib/statistical.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 TEST has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.CHISQ.TEST = function(observed, expected) {
      if (arguments.length !== 2) {
        return error.na;
      }
    
    
    Severity: Minor
    Found in lib/statistical.js - About 2 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 has a complexity of 12.
    Open

    exports.CHISQ.TEST = function(observed, expected) {
    Severity: Minor
    Found in lib/statistical.js by eslint

    Limit Cyclomatic Complexity (complexity)

    Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

    function a(x) {
        if (true) {
            return x; // 1st path
        } else if (false) {
            return x+1; // 2nd path
        } else {
            return 4; // 3rd path
        }
    }

    Rule Details

    This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

    Examples of incorrect code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else if (false) {
            return x+1;
        } else {
            return 4; // 3rd path
        }
    }

    Examples of correct code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else {
            return 4;
        }
    }

    Options

    Optionally, you may specify a max object property:

    "complexity": ["error", 2]

    is equivalent to

    "complexity": ["error", { "max": 2 }]

    Deprecated: the object property maximum is deprecated. Please use the property max instead.

    When Not To Use It

    If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

    Further Reading

    Related Rules

    • [max-depth](max-depth.md)
    • [max-len](max-len.md)
    • [max-nested-callbacks](max-nested-callbacks.md)
    • [max-params](max-params.md)
    • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

    Function has a complexity of 11.
    Open

    exports.F.INV.RT = function(p, d1, d2) {
    Severity: Minor
    Found in lib/statistical.js by eslint

    Limit Cyclomatic Complexity (complexity)

    Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

    function a(x) {
        if (true) {
            return x; // 1st path
        } else if (false) {
            return x+1; // 2nd path
        } else {
            return 4; // 3rd path
        }
    }

    Rule Details

    This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

    Examples of incorrect code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else if (false) {
            return x+1;
        } else {
            return 4; // 3rd path
        }
    }

    Examples of correct code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else {
            return 4;
        }
    }

    Options

    Optionally, you may specify a max object property:

    "complexity": ["error", 2]

    is equivalent to

    "complexity": ["error", { "max": 2 }]

    Deprecated: the object property maximum is deprecated. Please use the property max instead.

    When Not To Use It

    If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

    Further Reading

    Related Rules

    • [max-depth](max-depth.md)
    • [max-len](max-len.md)
    • [max-nested-callbacks](max-nested-callbacks.md)
    • [max-params](max-params.md)
    • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

    Function has a complexity of 11.
    Open

    exports.GROWTH = function(known_y, known_x, new_x, use_const) {
    Severity: Minor
    Found in lib/statistical.js by eslint

    Limit Cyclomatic Complexity (complexity)

    Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

    function a(x) {
        if (true) {
            return x; // 1st path
        } else if (false) {
            return x+1; // 2nd path
        } else {
            return 4; // 3rd path
        }
    }

    Rule Details

    This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

    Examples of incorrect code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else if (false) {
            return x+1;
        } else {
            return 4; // 3rd path
        }
    }

    Examples of correct code for a maximum of 2:

    /*eslint complexity: ["error", 2]*/
    
    function a(x) {
        if (true) {
            return x;
        } else {
            return 4;
        }
    }

    Options

    Optionally, you may specify a max object property:

    "complexity": ["error", 2]

    is equivalent to

    "complexity": ["error", { "max": 2 }]

    Deprecated: the object property maximum is deprecated. Please use the property max instead.

    When Not To Use It

    If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

    Further Reading

    Related Rules

    • [max-depth](max-depth.md)
    • [max-len](max-len.md)
    • [max-nested-callbacks](max-nested-callbacks.md)
    • [max-params](max-params.md)
    • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

    Function TEST has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.CHISQ.TEST = function(observed, expected) {
      if (arguments.length !== 2) {
        return error.na;
      }
    
    
    Severity: Major
    Found in lib/statistical.js - About 2 hrs to fix

      Function GROWTH has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.GROWTH = function(known_y, known_x, new_x, use_const) {
        // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)
      
        known_y = utils.parseNumberArray(known_y);
        if (known_y instanceof Error) {
      Severity: Major
      Found in lib/statistical.js - About 2 hrs to fix

        Function has a complexity of 10.
        Open

        exports.FREQUENCY = function(data, bins) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 9.
        Open

        exports.GAMMA.INV = function(probability, alpha, beta) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 9.
        Open

        exports.GAMMA.DIST = function(value, alpha, beta, cumulative) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 9.
        Open

        exports.AVERAGEIF = function(range, criteria, average_range) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 8.
        Open

        exports.F.DIST.RT = function(x, d1, d2) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 8.
        Open

        exports.AVERAGEIFS = function() {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 8.
        Open

        exports.COUNTIFS = function() {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 8.
        Open

        exports.CHISQ.INV.RT = function(p, k) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 8.
        Open

        exports.PROB = function(range, probability, lower, upper) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 7.
        Open

        exports.RANK.AVG = function(number, range, order) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 7.
        Open

        exports.PERCENTRANK.INC = function(array, x, significance) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 7.
        Open

        exports.F.TEST = function(array1, array2) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 7.
        Open

        exports.PERCENTRANK.EXC = function(array, x, significance) {
        Severity: Minor
        Found in lib/statistical.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function AVERAGEIFS has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.AVERAGEIFS = function() {
          // Does not work with multi dimensional ranges yet!
          //http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx
          var args = utils.argsToArray(arguments);
          var criteriaLength = (args.length - 1) / 2;
        Severity: Minor
        Found in lib/statistical.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 GROWTH has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.GROWTH = function(known_y, known_x, new_x, use_const) {
          // Credits: Ilmari Karonen (http://stackoverflow.com/questions/14161990/how-to-implement-growth-function-in-javascript)
        
          known_y = utils.parseNumberArray(known_y);
          if (known_y instanceof Error) {
        Severity: Minor
        Found in lib/statistical.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 AVERAGEIFS has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.AVERAGEIFS = function() {
          // Does not work with multi dimensional ranges yet!
          //http://office.microsoft.com/en-001/excel-help/averageifs-function-HA010047493.aspx
          var args = utils.argsToArray(arguments);
          var criteriaLength = (args.length - 1) / 2;
        Severity: Minor
        Found in lib/statistical.js - About 1 hr to fix

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

          exports.AVERAGEIF = function(range, criteria, average_range) {
            if (arguments.length <= 1) {
              return error.na;
            }
            average_range = average_range || range;
          Severity: Minor
          Found in lib/statistical.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 COUNTIFS has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          exports.COUNTIFS = function() {
            var args = utils.argsToArray(arguments);
            var results = new Array(utils.flatten(args[0]).length);
          
            for (var i = 0; i < results.length; i++) {
          Severity: Minor
          Found in lib/statistical.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 INC has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.PERCENTRANK.INC = function(array, x, significance) {
            significance = (significance === undefined) ? 3 : significance;
            array = utils.parseNumberArray(utils.flatten(array));
            x = utils.parseNumber(x);
            significance = utils.parseNumber(significance);
          Severity: Minor
          Found in lib/statistical.js - About 1 hr to fix

            Function EXC has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            exports.PERCENTRANK.EXC = function(array, x, significance) {
              significance = (significance === undefined) ? 3 : significance;
              array = utils.parseNumberArray(utils.flatten(array));
              x = utils.parseNumber(x);
              significance = utils.parseNumber(significance);
            Severity: Minor
            Found in lib/statistical.js - About 1 hr to fix

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

              exports.PROB = function(range, probability, lower, upper) {
                if (lower === undefined) {
                  return 0;
                }
                upper = (upper === undefined) ? lower : upper;
              Severity: Minor
              Found in lib/statistical.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 AVERAGEIF has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              exports.AVERAGEIF = function(range, criteria, average_range) {
                if (arguments.length <= 1) {
                  return error.na;
                }
                average_range = average_range || range;
              Severity: Minor
              Found in lib/statistical.js - About 1 hr to fix

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

                exports.FREQUENCY = function(data, bins) {
                  data = utils.parseNumberArray(utils.flatten(data));
                  bins = utils.parseNumberArray(utils.flatten(bins));
                  if (utils.anyIsError(data, bins)) {
                    return error.value;
                Severity: Minor
                Found in lib/statistical.js - About 1 hr to fix

                  Function VARPA has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  exports.VARPA = function() {
                    var range = utils.flatten(arguments);
                    var n = range.length;
                    var sigma = 0;
                    var count = 0;
                  Severity: Minor
                  Found in lib/statistical.js - About 45 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

                  Avoid deeply nested control flow statements.
                  Open

                          if (data[j] > bins[i - 1] && data[j] <= bins[i]) {
                            r[i] += 1;
                          }
                  Severity: Major
                  Found in lib/statistical.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                          } else if (i === b) {
                            if (data[j] > bins[b - 1]) {
                              r[b] += 1;
                            }
                          }
                    Severity: Major
                    Found in lib/statistical.js - About 45 mins to fix

                      Function MULT has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      exports.MODE.MULT = function() {
                        // Credits: Roönaän
                        var range = utils.parseNumberArray(utils.flatten(arguments));
                        if (range instanceof Error) {
                          return range;
                      Severity: Minor
                      Found in lib/statistical.js - About 45 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 AVERAGEA has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      exports.AVERAGEA = function() {
                        var range = utils.flatten(arguments);
                        var n = range.length;
                        var sum = 0;
                        var count = 0;
                      Severity: Minor
                      Found in lib/statistical.js - About 45 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 INC has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      exports.PERCENTRANK.INC = function(array, x, significance) {
                        significance = (significance === undefined) ? 3 : significance;
                        array = utils.parseNumberArray(utils.flatten(array));
                        x = utils.parseNumber(x);
                        significance = utils.parseNumber(significance);
                      Severity: Minor
                      Found in lib/statistical.js - About 45 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 DIST has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      exports.BETA.DIST = function(x, alpha, beta, cumulative, A, B) {
                      Severity: Minor
                      Found in lib/statistical.js - About 45 mins to fix

                        Function EXC has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.PERCENTRANK.EXC = function(array, x, significance) {
                          significance = (significance === undefined) ? 3 : significance;
                          array = utils.parseNumberArray(utils.flatten(array));
                          x = utils.parseNumber(x);
                          significance = utils.parseNumber(significance);
                        Severity: Minor
                        Found in lib/statistical.js - About 45 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

                        Consider simplifying this complex logical expression.
                        Open

                          if (p < 0 || p > 1 || d1 < 1 || d1 > Math.pow(10, 10) || d2 < 1 || d2 > Math.pow(10, 10)) {
                            return error.num;
                          }
                        Severity: Major
                        Found in lib/statistical.js - About 40 mins to fix

                          Function DIST has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          exports.HYPGEOM.DIST = function(x, n, M, N, cumulative) {
                          Severity: Minor
                          Found in lib/statistical.js - About 35 mins to fix

                            Function INV has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            exports.BETA.INV = function(probability, alpha, beta, A, B) {
                            Severity: Minor
                            Found in lib/statistical.js - About 35 mins to fix

                              Function AVG has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              exports.RANK.AVG = function(number, range, order) {
                                number = utils.parseNumber(number);
                                range = utils.parseNumberArray(utils.flatten(range));
                                if (utils.anyIsError(number, range)) {
                                  return error.value;
                              Severity: Minor
                              Found in lib/statistical.js - About 35 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 VARA has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              exports.VARA = function() {
                                var range = utils.flatten(arguments);
                                var n = range.length;
                                var sigma = 0;
                                var count = 0;
                              Severity: Minor
                              Found in lib/statistical.js - About 35 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

                              Avoid too many return statements within this function.
                              Open

                                return Math.round(ChiSq(xsqr, dof) * 1000000) / 1000000;
                              Severity: Major
                              Found in lib/statistical.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                  return jStat.col(matrix, index);
                                Severity: Major
                                Found in lib/statistical.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                    return jStat.row(matrix, index);
                                  Severity: Major
                                  Found in lib/statistical.js - About 30 mins to fix

                                    Expected 'undefined' and instead saw 'void'.
                                    Open

                                      var isWildcard = criteria === void 0 || criteria === '*';
                                    Severity: Minor
                                    Found in lib/statistical.js by eslint

                                    Disallow use of the void operator. (no-void)

                                    The void operator takes an operand and returns undefined: void expression will evaluate expression and return undefined. It can be used to ignore any side effects expression may produce:

                                    The common case of using void operator is to get a "pure" undefined value as prior to ES5 the undefined variable was mutable:

                                    // will always return undefined
                                    (function(){
                                        return void 0;
                                    })();
                                    
                                    // will return 1 in ES3 and undefined in ES5+
                                    (function(){
                                        undefined = 1;
                                        return undefined;
                                    })();
                                    
                                    // will throw TypeError in ES5+
                                    (function(){
                                        'use strict';
                                        undefined = 1;
                                    })();

                                    Another common case is to minify code as void 0 is shorter than undefined:

                                    foo = void 0;
                                    foo = undefined;

                                    When used with IIFE (immediately-invoked function expression), void can be used to force the function keyword to be treated as an expression instead of a declaration:

                                    var foo = 1;
                                    void function(){ foo = 1; }() // will assign foo a value of 1
                                    +function(){ foo = 1; }() // same as above
                                    function(){ foo = 1; }() // will throw SyntaxError

                                    Some code styles prohibit void operator, marking it as non-obvious and hard to read.

                                    Rule Details

                                    This rule aims to eliminate use of void operator.

                                    Examples of incorrect code for this rule:

                                    /*eslint no-void: "error"*/
                                    
                                    void foo
                                    
                                    var foo = void bar();

                                    When Not To Use It

                                    If you intentionally use the void operator then you can disable this rule.

                                    Further Reading

                                    Related Rules

                                    Expected 'undefined' and instead saw 'void'.
                                    Open

                                        var isWildcard = criteria === void 0 || criteria === '*';
                                    Severity: Minor
                                    Found in lib/statistical.js by eslint

                                    Disallow use of the void operator. (no-void)

                                    The void operator takes an operand and returns undefined: void expression will evaluate expression and return undefined. It can be used to ignore any side effects expression may produce:

                                    The common case of using void operator is to get a "pure" undefined value as prior to ES5 the undefined variable was mutable:

                                    // will always return undefined
                                    (function(){
                                        return void 0;
                                    })();
                                    
                                    // will return 1 in ES3 and undefined in ES5+
                                    (function(){
                                        undefined = 1;
                                        return undefined;
                                    })();
                                    
                                    // will throw TypeError in ES5+
                                    (function(){
                                        'use strict';
                                        undefined = 1;
                                    })();

                                    Another common case is to minify code as void 0 is shorter than undefined:

                                    foo = void 0;
                                    foo = undefined;

                                    When used with IIFE (immediately-invoked function expression), void can be used to force the function keyword to be treated as an expression instead of a declaration:

                                    var foo = 1;
                                    void function(){ foo = 1; }() // will assign foo a value of 1
                                    +function(){ foo = 1; }() // same as above
                                    function(){ foo = 1; }() // will throw SyntaxError

                                    Some code styles prohibit void operator, marking it as non-obvious and hard to read.

                                    Rule Details

                                    This rule aims to eliminate use of void operator.

                                    Examples of incorrect code for this rule:

                                    /*eslint no-void: "error"*/
                                    
                                    void foo
                                    
                                    var foo = void bar();

                                    When Not To Use It

                                    If you intentionally use the void operator then you can disable this rule.

                                    Further Reading

                                    Related Rules

                                    Expected 'undefined' and instead saw 'void'.
                                    Open

                                          var isWildcard = criteria === void 0 || criteria === '*';
                                    Severity: Minor
                                    Found in lib/statistical.js by eslint

                                    Disallow use of the void operator. (no-void)

                                    The void operator takes an operand and returns undefined: void expression will evaluate expression and return undefined. It can be used to ignore any side effects expression may produce:

                                    The common case of using void operator is to get a "pure" undefined value as prior to ES5 the undefined variable was mutable:

                                    // will always return undefined
                                    (function(){
                                        return void 0;
                                    })();
                                    
                                    // will return 1 in ES3 and undefined in ES5+
                                    (function(){
                                        undefined = 1;
                                        return undefined;
                                    })();
                                    
                                    // will throw TypeError in ES5+
                                    (function(){
                                        'use strict';
                                        undefined = 1;
                                    })();

                                    Another common case is to minify code as void 0 is shorter than undefined:

                                    foo = void 0;
                                    foo = undefined;

                                    When used with IIFE (immediately-invoked function expression), void can be used to force the function keyword to be treated as an expression instead of a declaration:

                                    var foo = 1;
                                    void function(){ foo = 1; }() // will assign foo a value of 1
                                    +function(){ foo = 1; }() // same as above
                                    function(){ foo = 1; }() // will throw SyntaxError

                                    Some code styles prohibit void operator, marking it as non-obvious and hard to read.

                                    Rule Details

                                    This rule aims to eliminate use of void operator.

                                    Examples of incorrect code for this rule:

                                    /*eslint no-void: "error"*/
                                    
                                    void foo
                                    
                                    var foo = void bar();

                                    When Not To Use It

                                    If you intentionally use the void operator then you can disable this rule.

                                    Further Reading

                                    Related Rules

                                    Expected 'undefined' and instead saw 'void'.
                                    Open

                                      var isWildcard = criteria === void 0 || criteria === '*';
                                    Severity: Minor
                                    Found in lib/statistical.js by eslint

                                    Disallow use of the void operator. (no-void)

                                    The void operator takes an operand and returns undefined: void expression will evaluate expression and return undefined. It can be used to ignore any side effects expression may produce:

                                    The common case of using void operator is to get a "pure" undefined value as prior to ES5 the undefined variable was mutable:

                                    // will always return undefined
                                    (function(){
                                        return void 0;
                                    })();
                                    
                                    // will return 1 in ES3 and undefined in ES5+
                                    (function(){
                                        undefined = 1;
                                        return undefined;
                                    })();
                                    
                                    // will throw TypeError in ES5+
                                    (function(){
                                        'use strict';
                                        undefined = 1;
                                    })();

                                    Another common case is to minify code as void 0 is shorter than undefined:

                                    foo = void 0;
                                    foo = undefined;

                                    When used with IIFE (immediately-invoked function expression), void can be used to force the function keyword to be treated as an expression instead of a declaration:

                                    var foo = 1;
                                    void function(){ foo = 1; }() // will assign foo a value of 1
                                    +function(){ foo = 1; }() // same as above
                                    function(){ foo = 1; }() // will throw SyntaxError

                                    Some code styles prohibit void operator, marking it as non-obvious and hard to read.

                                    Rule Details

                                    This rule aims to eliminate use of void operator.

                                    Examples of incorrect code for this rule:

                                    /*eslint no-void: "error"*/
                                    
                                    void foo
                                    
                                    var foo = void bar();

                                    When Not To Use It

                                    If you intentionally use the void operator then you can disable this rule.

                                    Further Reading

                                    Related Rules

                                    Nested block is redundant.
                                    Open

                                        {
                                    Severity: Minor
                                    Found in lib/statistical.js by eslint

                                    Disallow Unnecessary Nested Blocks (no-lone-blocks)

                                    In JavaScript, prior to ES6, standalone code blocks delimited by curly braces do not create a new scope and have no use. For example, these curly braces do nothing to foo:

                                    {
                                        var foo = bar();
                                    }

                                    In ES6, code blocks may create a new scope if a block-level binding (let and const), a class declaration or a function declaration (in strict mode) are present. A block is not considered redundant in these cases.

                                    Rule Details

                                    This rule aims to eliminate unnecessary and potentially confusing blocks at the top level of a script or within other blocks.

                                    Examples of incorrect code for this rule:

                                    /*eslint no-lone-blocks: "error"*/
                                    
                                    {}
                                    
                                    if (foo) {
                                        bar();
                                        {
                                            baz();
                                        }
                                    }
                                    
                                    function bar() {
                                        {
                                            baz();
                                        }
                                    }
                                    
                                    {
                                        function foo() {}
                                    }
                                    
                                    {
                                        aLabel: {
                                        }
                                    }

                                    Examples of correct code for this rule with es6 environment:

                                    /*eslint no-lone-blocks: "error"*/
                                    /*eslint-env es6*/
                                    
                                    while (foo) {
                                        bar();
                                    }
                                    
                                    if (foo) {
                                        if (bar) {
                                            baz();
                                        }
                                    }
                                    
                                    function bar() {
                                        baz();
                                    }
                                    
                                    {
                                        let x = 1;
                                    }
                                    
                                    {
                                        const y = 1;
                                    }
                                    
                                    {
                                        class Foo {}
                                    }
                                    
                                    aLabel: {
                                    }

                                    Examples of correct code for this rule with es6 environment and strict mode via "parserOptions": { "sourceType": "module" } in the ESLint configuration or "use strict" directive in the code:

                                    /*eslint no-lone-blocks: "error"*/
                                    /*eslint-env es6*/
                                    
                                    "use strict";
                                    
                                    {
                                        function foo() {}
                                    }

                                    Source: http://eslint.org/docs/rules/

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

                                    exports.QUARTILE.EXC = function(range, quart) {
                                      range = utils.parseNumberArray(utils.flatten(range));
                                      quart = utils.parseNumber(quart);
                                      if (utils.anyIsError(range, quart)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 6 hrs to fix
                                    lib/statistical.js on lines 1368..1384

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

                                    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

                                    exports.QUARTILE.INC = function(range, quart) {
                                      range = utils.parseNumberArray(utils.flatten(range));
                                      quart = utils.parseNumber(quart);
                                      if (utils.anyIsError(range, quart)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 6 hrs to fix
                                    lib/statistical.js on lines 1350..1366

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

                                    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

                                      for (var i = 0; i < n; i++) {
                                        var el = range[i];
                                        if (typeof el === 'number') {
                                          sigma += Math.pow(el - mean, 2);
                                        } else if (el === true) {
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 5 hrs to fix
                                    lib/statistical.js on lines 1798..1811

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

                                    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

                                      for (var i = 0; i < n; i++) {
                                        var el = range[i];
                                        if (typeof el === 'number') {
                                          sigma += Math.pow(el - mean, 2);
                                        } else if (el === true) {
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 5 hrs to fix
                                    lib/statistical.js on lines 1774..1787

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

                                    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

                                    exports.LOGNORM.DIST = function(x, mean, sd, cumulative) {
                                      x = utils.parseNumber(x);
                                      mean = utils.parseNumber(mean);
                                      sd = utils.parseNumber(sd);
                                      if (utils.anyIsError(x, mean, sd)) {
                                    Severity: Major
                                    Found in lib/statistical.js and 2 other locations - About 4 hrs to fix
                                    lib/statistical.js on lines 579..587
                                    lib/statistical.js on lines 1104..1112

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

                                    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

                                    exports.NEGBINOM.DIST = function(k, r, p, cumulative) {
                                      k = utils.parseNumber(k);
                                      r = utils.parseNumber(r);
                                      p = utils.parseNumber(p);
                                      if (utils.anyIsError(k, r, p)) {
                                    Severity: Major
                                    Found in lib/statistical.js and 2 other locations - About 4 hrs to fix
                                    lib/statistical.js on lines 579..587
                                    lib/statistical.js on lines 1013..1021

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

                                    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

                                    exports.F.DIST = function(x, d1, d2, cumulative) {
                                      x = utils.parseNumber(x);
                                      d1 = utils.parseNumber(d1);
                                      d2 = utils.parseNumber(d2);
                                      if (utils.anyIsError(x, d1, d2)) {
                                    Severity: Major
                                    Found in lib/statistical.js and 2 other locations - About 4 hrs to fix
                                    lib/statistical.js on lines 1013..1021
                                    lib/statistical.js on lines 1104..1112

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

                                    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

                                    exports.COLUMN = function(matrix, index) {
                                      if (arguments.length !== 2) {
                                        return error.na;
                                      }
                                    
                                    
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 4 hrs to fix
                                    lib/statistical.js on lines 1430..1448

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

                                    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

                                    exports.ROW = function(matrix, index) {
                                      if (arguments.length !== 2) {
                                        return error.na;
                                      }
                                    
                                    
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 4 hrs to fix
                                    lib/statistical.js on lines 362..380

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

                                    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

                                    exports.CONFIDENCE.T = function(alpha, sd, n) {
                                      alpha = utils.parseNumber(alpha);
                                      sd = utils.parseNumber(sd);
                                      n = utils.parseNumber(n);
                                      if (utils.anyIsError(alpha, sd, n)) {
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 3 hrs to fix
                                    lib/statistical.js on lines 400..408

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

                                    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

                                    exports.CONFIDENCE.NORM = function(alpha, sd, n) {
                                      alpha = utils.parseNumber(alpha);
                                      sd = utils.parseNumber(sd);
                                      n = utils.parseNumber(n);
                                      if (utils.anyIsError(alpha, sd, n)) {
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 3 hrs to fix
                                    lib/statistical.js on lines 410..418

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                    exports.T.DIST = function(x, df, cumulative) {
                                      x = utils.parseNumber(x);
                                      df = utils.parseNumber(df);
                                      if (utils.anyIsError(x, df)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 3 hrs to fix
                                    lib/statistical.js on lines 241..249
                                    lib/statistical.js on lines 568..575
                                    lib/statistical.js on lines 1308..1315

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                    exports.POISSON.DIST = function(x, mean, cumulative) {
                                      x = utils.parseNumber(x);
                                      mean = utils.parseNumber(mean);
                                      if (utils.anyIsError(x, mean)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 3 hrs to fix
                                    lib/statistical.js on lines 241..249
                                    lib/statistical.js on lines 568..575
                                    lib/statistical.js on lines 1614..1621

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                    exports.EXPON.DIST = function(x, lambda, cumulative) {
                                      x = utils.parseNumber(x);
                                      lambda = utils.parseNumber(lambda);
                                      if (utils.anyIsError(x, lambda)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 3 hrs to fix
                                    lib/statistical.js on lines 241..249
                                    lib/statistical.js on lines 1308..1315
                                    lib/statistical.js on lines 1614..1621

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                    exports.CHISQ.DIST = function(x, k, cumulative) {
                                      x = utils.parseNumber(x);
                                      k = utils.parseNumber(k);
                                      if (utils.anyIsError(x, k)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 3 hrs to fix
                                    lib/statistical.js on lines 568..575
                                    lib/statistical.js on lines 1308..1315
                                    lib/statistical.js on lines 1614..1621

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

                                    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

                                    exports.NORM.INV = function(probability, mean, sd) {
                                      probability = utils.parseNumber(probability);
                                      mean = utils.parseNumber(mean);
                                      sd = utils.parseNumber(sd);
                                      if (utils.anyIsError(probability, mean, sd)) {
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 3 hrs to fix
                                    lib/statistical.js on lines 1023..1031

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

                                    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

                                    exports.LOGNORM.INV = function(probability, mean, sd) {
                                      probability = utils.parseNumber(probability);
                                      mean = utils.parseNumber(mean);
                                      sd = utils.parseNumber(sd);
                                      if (utils.anyIsError(probability, mean, sd)) {
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 3 hrs to fix
                                    lib/statistical.js on lines 1131..1139

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

                                    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

                                    exports.LARGE = function(range, k) {
                                      range = utils.parseNumberArray(utils.flatten(range));
                                      k = utils.parseNumber(k);
                                      if (utils.anyIsError(range, k)) {
                                        return range;
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 3 hrs to fix
                                    lib/statistical.js on lines 1525..1534

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

                                    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

                                    exports.SMALL = function(range, k) {
                                      range = utils.parseNumberArray(utils.flatten(range));
                                      k = utils.parseNumber(k);
                                      if (utils.anyIsError(range, k)) {
                                        return range;
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 3 hrs to fix
                                    lib/statistical.js on lines 960..969

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

                                    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

                                    exports.T.INV = function(probability, df) {
                                      probability = utils.parseNumber(probability);
                                      df = utils.parseNumber(df);
                                      if (utils.anyIsError(probability, df)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 2 hrs to fix
                                    lib/statistical.js on lines 267..274

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

                                    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

                                    exports.CHISQ.INV = function(probability, k) {
                                      probability = utils.parseNumber(probability);
                                      k = utils.parseNumber(k);
                                      if (utils.anyIsError(probability, k)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 2 hrs to fix
                                    lib/statistical.js on lines 1655..1662

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

                                    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

                                    exports.CORREL = function(array1, array2) {
                                      array1 = utils.parseNumberArray(utils.flatten(array1));
                                      array2 = utils.parseNumberArray(utils.flatten(array2));
                                      if (utils.anyIsError(array1, array2)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 2 hrs to fix
                                    lib/statistical.js on lines 544..551

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

                                    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

                                    exports.COVARIANCE.S = function(array1, array2) {
                                      array1 = utils.parseNumberArray(utils.flatten(array1));
                                      array2 = utils.parseNumberArray(utils.flatten(array2));
                                      if (utils.anyIsError(array1, array2)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 2 hrs to fix
                                    lib/statistical.js on lines 420..427

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

                                    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

                                    exports.COLUMNS = function(matrix) {
                                      if (arguments.length !== 1) {
                                        return error.na;
                                      }
                                    
                                    
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 2 hrs to fix
                                    lib/statistical.js on lines 1450..1464

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

                                    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

                                    exports.ROWS = function(matrix) {
                                      if (arguments.length !== 1) {
                                        return error.na;
                                      }
                                    
                                    
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 2 hrs to fix
                                    lib/statistical.js on lines 382..396

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

                                    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

                                          if (isWildcard) {
                                            computedResult = true;
                                          } else {
                                            var tokenizedCriteria = evalExpression.parse(criteria + '');
                                            var tokens = [evalExpression.createToken(value, evalExpression.TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 2 hrs to fix
                                    lib/math-trig.js on lines 1036..1043

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

                                    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 6 locations. Consider refactoring.
                                    Open

                                    exports.PERMUTATIONA = function(number, number_chosen) {
                                      number = utils.parseNumber(number);
                                      number_chosen = utils.parseNumber(number_chosen);
                                      if (utils.anyIsError(number, number_chosen)) {
                                        return error.value;
                                    Severity: Major
                                    Found in lib/statistical.js and 5 other locations - About 2 hrs to fix
                                    lib/engineering.js on lines 11..19
                                    lib/engineering.js on lines 21..29
                                    lib/engineering.js on lines 31..39
                                    lib/engineering.js on lines 41..49
                                    lib/math-trig.js on lines 174..181

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

                                    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

                                    exports.FISHERINV = function(y) {
                                      y = utils.parseNumber(y);
                                      if (y instanceof Error) {
                                        return y;
                                      }
                                    Severity: Major
                                    Found in lib/statistical.js and 2 other locations - About 2 hrs to fix
                                    lib/math-trig.js on lines 282..289
                                    lib/math-trig.js on lines 1164..1171

                                    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

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

                                      for (var i = 0; i < n; i++) {
                                        num += (data_x[i] - xmean) * (data_y[i] - ymean);
                                        den += Math.pow(data_x[i] - xmean, 2);
                                      }
                                    Severity: Major
                                    Found in lib/statistical.js and 2 other locations - About 1 hr to fix
                                    lib/statistical.js on lines 982..985
                                    lib/statistical.js on lines 1518..1521

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

                                    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

                                      for (var i = 0; i < n; i++) {
                                        num += (data_x[i] - xmean) * (data_y[i] - ymean);
                                        den += Math.pow(data_x[i] - xmean, 2);
                                      }
                                    Severity: Major
                                    Found in lib/statistical.js and 2 other locations - About 1 hr to fix
                                    lib/statistical.js on lines 693..696
                                    lib/statistical.js on lines 1518..1521

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

                                    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

                                      for (var i = 0; i < n; i++) {
                                        num += (data_x[i] - xmean) * (data_y[i] - ymean);
                                        den += Math.pow(data_x[i] - xmean, 2);
                                      }
                                    Severity: Major
                                    Found in lib/statistical.js and 2 other locations - About 1 hr to fix
                                    lib/statistical.js on lines 693..696
                                    lib/statistical.js on lines 982..985

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                    exports.MAXA = function() {
                                      var range = utils.arrayValuesToNumbers(utils.flatten(arguments));
                                      return (range.length === 0) ? 0 : Math.max.apply(Math, range);
                                    };
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 1 hr to fix
                                    lib/statistical.js on lines 1033..1036
                                    lib/statistical.js on lines 1054..1057
                                    lib/statistical.js on lines 1059..1062

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                    exports.MAX = function() {
                                      var range = utils.numbers(utils.flatten(arguments));
                                      return (range.length === 0) ? 0 : Math.max.apply(Math, range);
                                    };
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 1 hr to fix
                                    lib/statistical.js on lines 1038..1041
                                    lib/statistical.js on lines 1054..1057
                                    lib/statistical.js on lines 1059..1062

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                    exports.MIN = function() {
                                      var range = utils.numbers(utils.flatten(arguments));
                                      return (range.length === 0) ? 0 : Math.min.apply(Math, range);
                                    };
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 1 hr to fix
                                    lib/statistical.js on lines 1033..1036
                                    lib/statistical.js on lines 1038..1041
                                    lib/statistical.js on lines 1059..1062

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                    exports.MINA = function() {
                                      var range = utils.arrayValuesToNumbers(utils.flatten(arguments));
                                      return (range.length === 0) ? 0 : Math.min.apply(Math, range);
                                    };
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 1 hr to fix
                                    lib/statistical.js on lines 1033..1036
                                    lib/statistical.js on lines 1038..1041
                                    lib/statistical.js on lines 1054..1057

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

                                    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 7 locations. Consider refactoring.
                                    Open

                                    exports.GAMMALN = function(number) {
                                      number = utils.parseNumber(number);
                                      if (number instanceof Error) {
                                        return number;
                                      }
                                    Severity: Major
                                    Found in lib/statistical.js and 6 other locations - About 1 hr to fix
                                    lib/math-trig.js on lines 166..172
                                    lib/math-trig.js on lines 258..264
                                    lib/math-trig.js on lines 489..495
                                    lib/math-trig.js on lines 739..745
                                    lib/math-trig.js on lines 1156..1162
                                    lib/text.js on lines 14..20

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

                                    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

                                      return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 1 hr to fix
                                    lib/statistical.js on lines 1213..1213

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

                                    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

                                      return utils.cleanFloat((l === fl) ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 1 hr to fix
                                    lib/statistical.js on lines 1198..1198

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

                                    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

                                      if (known_x === undefined) {
                                        known_x = [];
                                        for (i = 1; i <= known_y.length; i++) {
                                          known_x.push(i);
                                        }
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 1 hr to fix
                                    lib/statistical.js on lines 838..843

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

                                    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

                                        if (!(expected[i] instanceof Array)) {
                                          tmp = expected[i];
                                          expected[i] = [];
                                          expected[i].push(tmp);
                                        }
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 1 hr to fix
                                    lib/statistical.js on lines 315..319

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

                                    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

                                      if (new_x === undefined) {
                                        new_x = [];
                                        for (i = 1; i <= known_y.length; i++) {
                                          new_x.push(i);
                                        }
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 1 hr to fix
                                    lib/statistical.js on lines 832..837

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

                                    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

                                        if (!(observed[i] instanceof Array)) {
                                          tmp = observed[i];
                                          observed[i] = [];
                                          observed[i].push(tmp);
                                        }
                                    Severity: Major
                                    Found in lib/statistical.js and 1 other location - About 1 hr to fix
                                    lib/statistical.js on lines 320..324

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

                                    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

                                      for (var i = 0; i < range.length; i++) {
                                        result += Math.pow((range[i] - mean), 2);
                                      }
                                    Severity: Minor
                                    Found in lib/statistical.js and 1 other location - About 50 mins to fix
                                    lib/statistical.js on lines 650..652

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

                                    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

                                        for (var i = 0; i < values.length; i++) {
                                          sum +=Math.pow((values[i] - x1), 2);
                                        }
                                    Severity: Minor
                                    Found in lib/statistical.js and 1 other location - About 50 mins to fix
                                    lib/statistical.js on lines 560..562

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

                                    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

                                      for (i = 0; i < data_x.length; i++) {
                                        s_x += Math.pow(data_x[i] - mean_x, 2);
                                      }
                                    Severity: Minor
                                    Found in lib/statistical.js and 1 other location - About 40 mins to fix
                                    lib/statistical.js on lines 1694..1696

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

                                    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

                                      for (i = 0; i < data_y.length; i++) {
                                        s_y += Math.pow(data_y[i] - mean_y, 2);
                                      }
                                    Severity: Minor
                                    Found in lib/statistical.js and 1 other location - About 40 mins to fix
                                    lib/statistical.js on lines 1691..1693

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                      for (var i = 0; i < n; i++) {
                                        sigma += Math.pow(range[i] - mean, 3);
                                      }
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 35 mins to fix
                                    lib/statistical.js on lines 953..955
                                    lib/statistical.js on lines 1745..1747
                                    lib/statistical.js on lines 1762..1764

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                      for (var i = 0; i < n; i++) {
                                        sigma += Math.pow(range[i] - mean, 4);
                                      }
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 35 mins to fix
                                    lib/statistical.js on lines 1483..1485
                                    lib/statistical.js on lines 1745..1747
                                    lib/statistical.js on lines 1762..1764

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                      for (var i = 0; i < n; i++) {
                                        sigma += Math.pow(range[i] - mean, 2);
                                      }
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 35 mins to fix
                                    lib/statistical.js on lines 953..955
                                    lib/statistical.js on lines 1483..1485
                                    lib/statistical.js on lines 1762..1764

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

                                    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 4 locations. Consider refactoring.
                                    Open

                                      for (var i = 0; i < n; i++) {
                                        sigma += Math.pow(range[i] - mean, 2);
                                      }
                                    Severity: Major
                                    Found in lib/statistical.js and 3 other locations - About 35 mins to fix
                                    lib/statistical.js on lines 953..955
                                    lib/statistical.js on lines 1483..1485
                                    lib/statistical.js on lines 1745..1747

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

                                    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

                                    There are no issues that match your filters.

                                    Category
                                    Status