Showing 207 of 506 total issues
Function SWITCH
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
exports.SWITCH = function () {
var result;
if (arguments.length > 0) {
var targetValue = arguments[0];
- 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 YEARFRAC
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.YEARFRAC = function(start_date, end_date, basis) {
start_date = utils.parseDate(start_date);
if (start_date instanceof Error) {
return start_date;
}
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;
}
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) {
Function MATCH
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.MATCH = function(lookupValue, lookupArray, matchType) {
if (!lookupValue && !lookupArray) {
return error.na;
}
Function IRR
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
exports.IRR = function(values, guess) {
// Credits: algorithm inspired by Apache OpenOffice
guess = guess || 0;
- 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 INTL
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.NETWORKDAYS.INTL = function(start_date, end_date, weekend, holidays) {
start_date = utils.parseDate(start_date);
if (start_date instanceof Error) {
return start_date;
Function IRR
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.IRR = function(values, guess) {
// Credits: algorithm inspired by Apache OpenOffice
guess = guess || 0;
Function SUBTOTAL
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.SUBTOTAL = function(function_code, ref1) {
function_code = utils.parseNumber(function_code);
if (function_code instanceof Error) {
return function_code;
}
Function INTL
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.WORKDAY.INTL = function(start_date, days, weekend, holidays) {
start_date = utils.parseDate(start_date);
if (start_date instanceof Error) {
return start_date;
}
Function findResultIndex
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findResultIndex(database, criterias) {
var matches = {};
for (var i = 1; i < database[0].length; ++i) {
matches[i] = true;
}
Function HEX2BIN
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
exports.HEX2BIN = 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 OCT2BIN
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
exports.OCT2BIN = function(number, places) {
// Return error if number is not hexadecimal or contains more than ten characters (10 digits)
if (!/^[0-7]{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 AGGREGATE
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.AGGREGATE = function(function_num, options, ref1, ref2) {
function_num = utils.parseNumber(function_num);
options = utils.parseNumber(function_num);
if (utils.anyIsError(function_num, options)) {
return error.value;
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;
- 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 COMPLEX
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
exports.COMPLEX = function(real, imaginary, suffix) {
real = utils.parseNumber(real);
imaginary = utils.parseNumber(imaginary);
if (utils.anyIsError(real, imaginary)) {
return real;
- 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 CUMPRINC
has a Cognitive Complexity of 14 (exceeds 5 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);
- 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 RATE
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.RATE = function(periods, payment, present, future, type, guess) {
// Credits: rabugento
guess = (guess === undefined) ? 0.01 : guess;
future = (future === undefined) ? 0 : future;
Function IMAGINARY
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.IMAGINARY = function(inumber) {
if (inumber === undefined || inumber === true || inumber === false) {
return error.value;
}
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) {
- 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"