Showing 2,859 of 2,859 total issues
Function setInterval
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports.setInterval = function(callback, repeat) {
repeat *= 1; // coalesce to number or NaN
if (!(repeat >= 1 && repeat <= TIMEOUT_MAX)) {
repeat = 1; // schedule on next tick, follows browser behaviour
- 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 SharedHandle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function SharedHandle(key, address, port, addressType, backlog, fd) {
Function write
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
fs.write = function(fd, buffer, offset, length, position, callback) {
Function checkInt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function checkInt(buffer, value, offset, ext, max, min) {
Function _getServer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
cluster._getServer = function(obj, address, port, addressType, fd, cb) {
Function formatProperty
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
Function sendto
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Socket.prototype.sendto = function(buffer,
offset,
length,
port,
address,
Function bind
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Socket.prototype.bind = function(port /*, address, callback*/) {
var self = this;
self._healthCheck();
- 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 (scriptId) {
ambiguous = true;
}
Function Server
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function Server(options, connectionListener) {
if (!(this instanceof Server))
return new Server(options, connectionListener);
events.EventEmitter.call(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
Function renegotiate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
TLSSocket.prototype.renegotiate = function(options, callback) {
var requestCert = this._requestCert,
rejectUnauthorized = this._rejectUnauthorized;
if (typeof options.requestCert !== 'undefined')
- 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 connect
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function connect(self, address, port, addressType, localAddress, localPort) {
Function trimArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function trimArray(arr) {
var lastIndex = arr.length - 1;
var start = 0;
for (; start <= lastIndex; start++) {
if (arr[start])
- 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 on
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Readable.prototype.on = function(ev, fn) {
var res = Stream.prototype.on.call(this, ev, fn);
// If listening to data, and it has not explicitly been paused,
// then call resume to start the flow of data on the next tick.
- 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 RoundRobinHandle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function RoundRobinHandle(key, address, port, addressType, backlog, fd) {
Function pbkdf2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
exports.pbkdf2 = function(password,
salt,
iterations,
keylen,
digest,
Function errorHandler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Domain.prototype._errorHandler = function errorHandler(er) {
var caught = false;
// ignore errors on disposed domains.
//
// XXX This is a bit stupid. We should probably get rid of
- 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 (!newpart.match(hostnamePartPattern)) {
var validParts = hostparts.slice(0, i);
var notHost = hostparts.slice(i + 1);
var bit = part.match(hostnamePartStart);
if (bit) {
Function pbkdf2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function pbkdf2(password, salt, iterations, keylen, digest, callback) {
Function write
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
fs.write = function(fd, buffer, offset, length, position, callback) {
function strWrapper(err, written) {
// Retain a reference to buffer so that it can't be GC'ed too soon.
callback(err, written || 0, buffer);
}
- 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"