handsontable/formula.js

View on GitHub

Showing 506 of 506 total issues

Avoid too many return statements within this function.
Open

    return 0;
Severity: Major
Found in lib/financial.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return error.num;
    Severity: Major
    Found in lib/financial.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return value;
      Severity: Major
      Found in lib/information.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return 100 * (1 - discount * dateTime.DAYS360(settlement, maturity, false) / 360);
        Severity: Major
        Found in lib/financial.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            return (100 - price) * 360 / (price * dateTime.DAYS360(settlement, maturity, false));
          Severity: Major
          Found in lib/financial.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return par * rate * dateTime.YEARFRAC(issue, settlement, basis);
            Severity: Major
            Found in lib/financial.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return initial;
              Severity: Major
              Found in lib/financial.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  return 0;
                Severity: Major
                Found in lib/information.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return (cost - total) * rate;
                  Severity: Major
                  Found in lib/financial.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return current;
                    Severity: Major
                    Found in lib/financial.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        return error.value;
                      Severity: Major
                      Found in lib/utils/common.js - About 30 mins to fix

                        Function BITRSHIFT has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.BITRSHIFT = function(number, shift) {
                          number = utils.parseNumber(number);
                          shift = utils.parseNumber(shift);
                          if (utils.anyIsError(number, shift)) {
                            return error.value;
                        Severity: Minor
                        Found in lib/engineering.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function BITLSHIFT has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.BITLSHIFT = function(number, shift) {
                          number = utils.parseNumber(number);
                          shift = utils.parseNumber(shift);
                          if (utils.anyIsError(number, shift)) {
                            return error.value;
                        Severity: Minor
                        Found in lib/engineering.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function FLOOR has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.FLOOR = function(number, significance) {
                          number = utils.parseNumber(number);
                          significance = utils.parseNumber(significance);
                          if (utils.anyIsError(number, significance)) {
                            return error.value;
                        Severity: Minor
                        Found in lib/math-trig.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function PROPER has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.PROPER = function(text) {
                          if (text === undefined || text.length === 0) {
                            return error.value;
                          }
                          if (text === true) {
                        Severity: Minor
                        Found in lib/text.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function REFERENCE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.REFERENCE = function (context, reference) {
                          if (!arguments.length) {
                            return error.error;
                          }
                          try {
                        Severity: Minor
                        Found in lib/miscellaneous.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function DDB has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.DDB = function(cost, salvage, life, period, factor) {
                          // Initialize factor
                          factor = (factor === undefined) ? 2 : factor;
                        
                          cost = utils.parseNumber(cost);
                        Severity: Minor
                        Found in lib/financial.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function ACCRINT has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.ACCRINT = function(issue, first, settlement, rate, par, frequency, basis) {
                          // Return error if either date is invalid
                          issue      = ensureDate(issue);
                          first      = ensureDate(first);
                          settlement = ensureDate(settlement);
                        Severity: Minor
                        Found in lib/financial.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function PMT has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.PMT = function(rate, periods, present, future, type) {
                          // Credits: algorithm inspired by Apache OpenOffice
                        
                          future = future || 0;
                          type = type || 0;
                        Severity: Minor
                        Found in lib/financial.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function FV has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.FV = function(rate, periods, payment, value, type) {
                          // Credits: algorithm inspired by Apache OpenOffice
                        
                          value = value || 0;
                          type = type || 0;
                        Severity: Minor
                        Found in lib/financial.js - About 25 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Severity
                        Category
                        Status
                        Source
                        Language