Showing 2,859 of 2,859 total issues
Function _makeTimerTimeout
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function _makeTimerTimeout(timer) {
var domain = timer.domain;
var msecs = timer._idleTimeout;
// Timer has been unenrolled by another timer that fired at the same time,
- 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 ReadableState
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function ReadableState(options, stream) {
options = options || {};
// object stream flag. Used to make read(n) ignore n and to
// make all the buffer merging and length checks go away
- 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 detectIncompleteChar
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
StringDecoder.prototype.detectIncompleteChar = function(buffer) {
// determine how many bytes we have to check at the end of this buffer
var i = (buffer.length >= 3) ? 3 : buffer.length;
// Figure out if one of the last i bytes of our buffer announces an
- 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 read
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
fs.read = function(fd, buffer, offset, length, position, callback) {
Function writeAll
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function writeAll(fd, buffer, offset, length, position, callback) {
Avoid deeply nested control flow statements. Open
if (isNaN(stepcount) || stepcount <= 0) {
throw new Error('Invalid step count argument "' + args[0] + '".');
}
Avoid deeply nested control flow statements. Open
if (value.isString()) {
result += '"';
}
Function iteratePauses
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
PausePlot.prototype.iteratePauses = function (f) {
if (this.start < this.idx) {
for (var i = this.start; i < this.idx; i++) {
f.call(this, i - this.start, this.pauses[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
Function am1
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function am1(i,x,w,j,c,n) {
Avoid deeply nested control flow statements. Open
if (!current.right) {
break;
}
Avoid deeply nested control flow statements. Open
if (!current.right) {
break;
}
Function writeOrBuffer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function writeOrBuffer(stream, state, chunk, encoding, cb) {
chunk = decodeChunk(state, chunk, encoding);
if (util.isBuffer(chunk))
encoding = 'buffer';
var len = state.objectMode ? 1 : chunk.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
Avoid deeply nested control flow statements. Open
if (excType == 'unc') {
excType = 'uncaught';
}
Function am3
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function am3(i,x,w,j,c,n) {
Function am2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function am2(i,x,w,j,c,n) {
Avoid deeply nested control flow statements. Open
if (value.isString()) {
result += '"';
}
Function Server
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function Server(/* [options], listener */) {
var options, listener;
if (util.isObject(arguments[0])) {
options = arguments[0];
listener = arguments[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
Function initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
initialize : function(colorEven, colorOdd, reflection, transparency, gloss, density) {
Function onwrite
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function onwrite(stream, er) {
var state = stream._writableState;
var sync = state.sync;
var cb = state.writecb;
- 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
for (var i = 0; i < args.length; i++) {
var arg = args[i];
result += arg.name + ' = ';
result += refObjectToString_(response, arg.value.ref);
result += '\n';