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
Severity: Minor
Found in lib/timers.js - About 45 mins to fix

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) {
Severity: Minor
Found in lib/cluster.js - About 45 mins to fix

    Function write has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    fs.write = function(fd, buffer, offset, length, position, callback) {
    Severity: Minor
    Found in lib/fs.js - About 45 mins to fix

      Function checkInt has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function checkInt(buffer, value, offset, ext, max, min) {
      Severity: Minor
      Found in lib/buffer.js - About 45 mins to fix

        Function _getServer has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          cluster._getServer = function(obj, address, port, addressType, fd, cb) {
        Severity: Minor
        Found in lib/cluster.js - About 45 mins to fix

          Function formatProperty has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
          Severity: Minor
          Found in lib/util.js - About 45 mins to fix

            Function sendto has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            Socket.prototype.sendto = function(buffer,
                                               offset,
                                               length,
                                               port,
                                               address,
            Severity: Minor
            Found in lib/dgram.js - About 45 mins to fix

              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();
              
              
              Severity: Minor
              Found in lib/dgram.js - About 45 mins to fix

              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;
                        }
              Severity: Major
              Found in lib/_debugger.js - About 45 mins to fix

                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);
                Severity: Minor
                Found in lib/net.js - About 45 mins to fix

                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')
                Severity: Minor
                Found in lib/_tls_wrap.js - About 45 mins to fix

                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) {
                Severity: Minor
                Found in lib/net.js - About 45 mins to fix

                  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])
                  Severity: Minor
                  Found in lib/path.js - About 45 mins to fix

                  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.
                  Severity: Minor
                  Found in lib/_stream_readable.js - About 45 mins to fix

                  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) {
                  Severity: Minor
                  Found in lib/cluster.js - About 45 mins to fix

                    Function pbkdf2 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    exports.pbkdf2 = function(password,
                                              salt,
                                              iterations,
                                              keylen,
                                              digest,
                    Severity: Minor
                    Found in lib/crypto.js - About 45 mins to fix

                      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
                      Severity: Minor
                      Found in lib/domain.js - About 45 mins to fix

                      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) {
                      Severity: Major
                      Found in lib/url.js - About 45 mins to fix

                        Function pbkdf2 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function pbkdf2(password, salt, iterations, keylen, digest, callback) {
                        Severity: Minor
                        Found in lib/crypto.js - About 45 mins to fix

                          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);
                            }
                          Severity: Minor
                          Found in lib/fs.js - About 45 mins to fix

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language