Showing 207 of 506 total issues
File statistical.js
has 1548 lines of code (exceeds 250 allowed). Consider refactoring. Open
var mathTrig = require('./math-trig');
var text = require('./text');
var jStat = require('jstat');
var utils = require('./utils/common');
var evalExpression = require('./utils/criteria-eval');
File engineering.js
has 1054 lines of code (exceeds 250 allowed). Consider refactoring. Open
var error = require('./utils/error');
var jStat = require('jstat');
var text = require('./text');
var utils = require('./utils/common');
var bessel = require('bessel');
File math-trig.js
has 1010 lines of code (exceeds 250 allowed). Consider refactoring. Open
var utils = require('./utils/common');
var error = require('./utils/error');
var statistical = require('./statistical');
var information = require('./information');
var evalExpression = require('./utils/criteria-eval');
File financial.js
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
var error = require('./utils/error');
var dateTime = require('./date-time');
var utils = require('./utils/common');
function validDate(d) {
Function CONVERT
has 247 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.CONVERT = function(number, from_unit, to_unit) {
number = utils.parseNumber(number);
if (number instanceof Error) {
return number;
}
File date-time.js
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
var error = require('./utils/error');
var utils = require('./utils/common');
var d1900 = new Date(Date.UTC(1900, 0, 1));
var WEEK_STARTS = [
Function findResultIndex
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function findResultIndex(database, criterias) {
var matches = {};
for (var i = 1; i < database[0].length; ++i) {
matches[i] = true;
}
- 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 MATCH
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
exports.MATCH = function(lookupValue, lookupArray, matchType) {
if (!lookupValue && !lookupArray) {
return error.na;
}
- 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 CONVERT
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
exports.CONVERT = function(number, from_unit, to_unit) {
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 IMAGINARY
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
exports.IMAGINARY = function(inumber) {
if (inumber === undefined || inumber === true || inumber === false) {
return error.value;
}
- 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 a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
exports.IMREAL = function(inumber) {
if (inumber === undefined || inumber === true || inumber === false) {
return error.value;
}
- 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 SUMPRODUCT
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
exports.SUMPRODUCT = function() {
if (!arguments || arguments.length === 0) {
return error.value;
}
var arrays = arguments.length + 1;
- 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
File database.js
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
var error = require('./utils/error');
var stats = require('./statistical');
var maths = require('./math-trig');
var utils = require('./utils/common');
var evalExpression = require('./utils/criteria-eval');
Function INTL
has a Cognitive Complexity of 23 (exceeds 5 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;
- 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 a Cognitive Complexity of 23 (exceeds 5 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;
}
- 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 FREQUENCY
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
exports.FREQUENCY = function(data, bins) {
data = utils.parseNumberArray(utils.flatten(data));
bins = utils.parseNumberArray(utils.flatten(bins));
if (utils.anyIsError(data, bins)) {
return error.value;
- 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 TEST
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
exports.CHISQ.TEST = function(observed, expected) {
if (arguments.length !== 2) {
return error.na;
}
- 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 a Cognitive Complexity of 20 (exceeds 5 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;
}
- 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 LCM
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
exports.LCM = function() {
// Credits: Jonas Raoni Soares Silva
var o = utils.parseNumberArray(utils.flatten(arguments));
if (o instanceof Error) {
return o;
- 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 a Cognitive Complexity of 18 (exceeds 5 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);
- 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"