Showing 7 of 7 total issues
Function parse
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
Expression.parse = function (s, a) {
var e;
var isArray = (a && a.constructor === Array);
var args = (a && isArray ? a : []);
var vars = (a && isArray ? {} : a);
- 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 parse
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Expression.parse = function (s, a) {
var e;
var isArray = (a && a.constructor === Array);
var args = (a && isArray ? a : []);
var vars = (a && isArray ? {} : a);
Function parseArgs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function parseArgs (argsString) {
var args = [];
var i = 0;
var l = argsString.length;
- 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 parse
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
FunctionExpression.parse = function (s) {
s = s.trim();
var e = null;
var fun = s.substr(0, 8);
Avoid deeply nested control flow statements. Open
if (s.match(/[\+\-\/\*]/) || s.match(/\s?.*?\s?\(.*?\)/)) {
e = FunctionExpression.parse(s);
}
else {
// e=s; // keypath?
Function parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
FunctionExpression.parse = function (s) {
s = s.trim();
var e = null;
var fun = s.substr(0, 8);
- 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 variance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function variance (a) {
var average = avg(a);
var i = a.length;
var v = 0;
var 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"