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,
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

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

                    function am2(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 (value.isString()) {
                                      result += '"';
                                    }
                      Severity: Major
                      Found in deps/v8/src/d8.js - About 45 mins to fix

                        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];
                        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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                initialize : function(colorEven, colorOdd, reflection, transparency, gloss, density) {
                        Severity: Minor
                        Found in deps/v8/benchmarks/raytrace.js - About 45 mins to fix

                          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;
                          
                          
                          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

                                      for (var i = 0; i < args.length; i++) {
                                        var arg = args[i];
                                        result += arg.name + ' = ';
                                        result += refObjectToString_(response, arg.value.ref);
                                        result += '\n';
                          Severity: Major
                          Found in deps/v8/src/d8.js - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language