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) {
- Read upRead up
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];
- Read upRead up
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;
}
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);
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;
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;
}
- Read upRead up
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;
}
- Read upRead up
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;
- Read upRead up
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/]
- Read upRead up
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);
- Read upRead up
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);
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;
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 = '';
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) {
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);
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/]
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;
}
- Read upRead up
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++) {
- Read upRead up
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 = '';
- Read upRead up
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;
}
- Read upRead up
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"