Showing 1,896 of 2,859 total issues

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

          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,
          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 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
          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 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
          Severity: Minor
          Found in lib/string_decoder.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 read has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

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

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

              Avoid deeply nested control flow statements.
              Open

                        if (isNaN(stepcount) || stepcount <= 0) {
                          throw new Error('Invalid step count argument "' + args[0] + '".');
                        }
              Severity: Major
              Found in deps/v8/src/d8.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              if (value.isString()) {
                                result += '"';
                              }
                Severity: Major
                Found in deps/v8/src/d8.js - About 45 mins to fix

                  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]);
                      }
                  Severity: Minor
                  Found in deps/v8/benchmarks/spinning-balls/v.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 am1 has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function am1(i,x,w,j,c,n) {
                  Severity: Minor
                  Found in deps/v8/benchmarks/crypto.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                            if (!current.right) {
                              break;
                            }
                    Severity: Major
                    Found in deps/v8/benchmarks/spinning-balls/splay-tree.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                              if (!current.right) {
                                break;
                              }
                      Severity: Major
                      Found in deps/v8/benchmarks/splay.js - About 45 mins to fix

                        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;
                        Severity: Minor
                        Found in lib/_stream_writable.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 (excType == 'unc') {
                                  excType = 'uncaught';
                                }
                        Severity: Major
                        Found in deps/v8/src/d8.js - About 45 mins to fix

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

                          function am3(i,x,w,j,c,n) {
                          Severity: Minor
                          Found in deps/v8/benchmarks/crypto.js - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language