handsontable/formula.js

View on GitHub

Showing 207 of 506 total issues

Function SUMIFS has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

exports.SUMIFS = function() {
  var args = utils.argsToArray(arguments);
  var range = utils.parseNumberArray(utils.flatten(args.shift()));

  if (range instanceof Error) {
Severity: Minor
Found in lib/math-trig.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 arrayValuesToNumbers has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

exports.arrayValuesToNumbers = function(arr) {
  var n = arr.length;
  var el;
  while (n--) {
    el = arr[n];
Severity: Minor
Found in lib/utils/common.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 IMREAL has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.IMREAL = function(inumber) {
  if (inumber === undefined || inumber === true || inumber === false) {
    return error.value;
  }

Severity: Minor
Found in lib/engineering.js - About 1 hr to fix

    Function DB has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.DB = function(cost, salvage, life, period, month) {
      // Initialize month
      month = (month === undefined) ? 12 : month;
    
      cost = utils.parseNumber(cost);
    Severity: Minor
    Found in lib/financial.js - About 1 hr to fix

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

        exports.HEX2OCT = function(number, places) {
          // Return error if number is not hexadecimal or contains more than ten characters (10 digits)
          if (!/^[0-9A-Fa-f]{1,10}$/.test(number)) {
            return error.num;
          }
        Severity: Minor
        Found in lib/engineering.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 GCD has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.GCD = function() {
          var range = utils.parseNumberArray(utils.flatten(arguments));
          if (range instanceof Error) {
            return range;
          }
        Severity: Minor
        Found in lib/math-trig.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 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 CUMIPMT has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.CUMIPMT = function(rate, periods, value, start, end, type) {
          // Credits: algorithm inspired by Apache OpenOffice
          // Credits: Hannes Stiebitzhofer for the translations of function and variable names
          // Requires exports.FV() and exports.PMT() from exports.js [http://stoic.com/exports/]
        
        
        Severity: Minor
        Found in lib/financial.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 DB has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        exports.DB = function(cost, salvage, life, period, month) {
          // Initialize month
          month = (month === undefined) ? 12 : month;
        
          cost = utils.parseNumber(cost);
        Severity: Minor
        Found in lib/financial.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 DAYS360 has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.DAYS360 = function(start_date, end_date, method) {
          method = utils.parseBool(method);
          start_date = utils.parseDate(start_date);
          end_date = utils.parseDate(end_date);
        
        
        Severity: Minor
        Found in lib/date-time.js - About 1 hr to fix

          Function SUMPRODUCT has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.SUMPRODUCT = function() {
            if (!arguments || arguments.length === 0) {
              return error.value;
            }
            var arrays = arguments.length + 1;
          Severity: Minor
          Found in lib/math-trig.js - About 1 hr to fix

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

            function tokenizeExpression(expression) {
              var expressionLength = expression.length;
              var tokens = [];
              var cursorIndex = 0;
              var processedValue = '';
            Severity: Minor
            Found in lib/utils/criteria-eval.js - About 1 hr to fix

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

              exports.SUMIFS = function() {
                var args = utils.argsToArray(arguments);
                var range = utils.parseNumberArray(utils.flatten(args.shift()));
              
                if (range instanceof Error) {
              Severity: Minor
              Found in lib/math-trig.js - About 1 hr to fix

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

                exports.CUMPRINC = function(rate, periods, value, start, end, type) {
                  // Credits: algorithm inspired by Apache OpenOffice
                  // Credits: Hannes Stiebitzhofer for the translations of function and variable names
                
                  rate = utils.parseNumber(rate);
                Severity: Minor
                Found in lib/financial.js - About 1 hr to fix

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

                  exports.CUMIPMT = function(rate, periods, value, start, end, type) {
                    // Credits: algorithm inspired by Apache OpenOffice
                    // Credits: Hannes Stiebitzhofer for the translations of function and variable names
                    // Requires exports.FV() and exports.PMT() from exports.js [http://stoic.com/exports/]
                  
                  
                  Severity: Minor
                  Found in lib/financial.js - About 1 hr to fix

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

                    exports.DEC2BIN = function(number, places) {
                      number = utils.parseNumber(number);
                      if (number instanceof Error) {
                        return number;
                      }
                    Severity: Minor
                    Found in lib/engineering.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 tokenizeExpression has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function tokenizeExpression(expression) {
                      var expressionLength = expression.length;
                      var tokens = [];
                      var cursorIndex = 0;
                      var processedValue = '';
                    Severity: Minor
                    Found in lib/utils/criteria-eval.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 DEC2HEX has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                    exports.DEC2HEX = function(number, places) {
                      number = utils.parseNumber(number);
                      if (number instanceof Error) {
                        return number;
                      }
                    Severity: Minor
                    Found in lib/engineering.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Severity
                    Category
                    Status
                    Source
                    Language