File timers.js
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
Function listOnTimeout
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function listOnTimeout() {
var msecs = this.msecs;
var list = this;
debug('timeout callback %d', msecs);
- 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 processImmediate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function processImmediate() {
var queue = immediateQueue;
var domain, immediate;
immediateQueue = {};
- 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 listOnTimeout
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function listOnTimeout() {
var msecs = this.msecs;
var list = this;
debug('timeout callback %d', msecs);
Function unrefTimeout
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function unrefTimeout() {
var now = Timer.now();
debug('unrefTimer fired');
Function unrefTimeout
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function unrefTimeout() {
var now = Timer.now();
debug('unrefTimer fired');
- 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 processImmediate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processImmediate() {
var queue = immediateQueue;
var domain, immediate;
immediateQueue = {};
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 _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 unref
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Timeout.prototype.unref = function() {
if (!this._handle) {
var now = Timer.now();
if (!this._idleStart) this._idleStart = now;
var delay = this._idleStart + this._idleTimeout - now;
- 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"