Showing 207 of 506 total issues
Function parseBool
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.parseBool = function(bool) {
if (typeof bool === 'boolean') {
return bool;
}
- 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 SUBSTITUTE
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.SUBSTITUTE = function(text, old_text, new_text, occurrence) {
if (arguments.length < 2) {
return error.na;
}
if (!text || !old_text || !new_text) {
- 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 IPMT
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.IPMT = function(rate, period, periods, present, future, type) {
// Credits: algorithm inspired by Apache OpenOffice
future = future || 0;
type = type || 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 ACCRINT
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.ACCRINT = function(issue, first, settlement, rate, par, frequency, basis) {
Avoid deeply nested control flow statements. Open
if (lookupArray[idx] === lookupValue) {
return idx + 1;
}
Avoid deeply nested control flow statements. Open
if (lookupArray[idx] === lookupValue) {
return idx + 1;
} else if (lookupArray[idx] > lookupValue) {
if (!indexValue) {
index = idx + 1;
Function DIST
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.BETA.DIST = function(x, alpha, beta, cumulative, A, B) {
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;
- 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 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;
- 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 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);
- 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
Avoid deeply nested control flow statements. Open
if (_ij instanceof Error) {
return _ij;
}
Avoid deeply nested control flow statements. Open
if (!currentCriteriaResult) {
var isWildcard = criteria[p] === void 0 || criteria[p] === '*';
if (isWildcard) {
currentCriteriaResult = true;
Function MATH
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports.FLOOR.MATH = function(number, significance, mode) {
significance = (significance === undefined) ? 1 : significance;
mode = (mode === undefined) ? 0 : mode;
number = utils.parseNumber(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 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);
- 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 analyzeTokens
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function analyzeTokens(tokens) {
var literalValue = '';
var analyzedTokens = [];
for (var i = 0; i < tokens.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
Avoid deeply nested control flow statements. Open
if (lookupArray[idx].toLowerCase().match(lookupValue.toLowerCase())) {
return idx + 1;
}
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;
- 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
Avoid deeply nested control flow statements. Open
} else if (i === b) {
if (data[j] > bins[b - 1]) {
r[b] += 1;
}
}
Avoid deeply nested control flow statements. Open
if (data[j] > bins[i - 1] && data[j] <= bins[i]) {
r[i] += 1;
}
Function RATE
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.RATE = function(periods, payment, present, future, type, guess) {