Showing 835 of 1,558 total issues
Function add
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
DataSet.prototype.add = function (data, senderId) {
var addedIds = [],
id,
me = this;
- 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 too many return
statements within this function. Open
Open
return new Date(object);
Avoid too many return
statements within this function. Open
Open
return 'String';
Avoid too many return
statements within this function. Open
Open
return object.toDate().toISOString();
Avoid too many return
statements within this function. Open
Open
return '/Date(' + object + ')/';
Avoid too many return
statements within this function. Open
Open
return type;
Avoid too many return
statements within this function. Open
Open
return 'Array';
Avoid too many return
statements within this function. Open
Open
return Number(object.valueOf());
Avoid too many return
statements within this function. Open
Open
return moment(new Date(object)).toDate(); // parse string
Avoid too many return
statements within this function. Open
Open
return moment(object); // parse string
Avoid too many return
statements within this function. Open
Open
return 'Boolean';
Avoid too many return
statements within this function. Open
Open
return moment(Number(match[1])); // parse number
Avoid too many return
statements within this function. Open
Open
return 'Date';
Avoid too many return
statements within this function. Open
Open
return 'Object';
Avoid too many return
statements within this function. Open
Open
return 'undefined';
Avoid too many return
statements within this function. Open
Open
return time;
Avoid too many return
statements within this function. Open
Open
return '/Date(' + value + ')/';
Avoid too many return
statements within this function. Open
Open
return 'Number';
Avoid too many return
statements within this function. Open
Open
return '/Date(' + object.valueOf() + ')/';
Avoid too many return
statements within this function. Open
Open
return new Date(object);