Showing 1,896 of 2,859 total issues

Avoid deeply nested control flow statements.
Open

          if (r.source === '$') {
            r.exec = sh_konquerorExec;
          }
Severity: Major
Found in doc/sh_main.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

            if (s) {
              var lines = s.split(/\r\n|\n|\r/);
              for (var i = 0, len = lines.length; i < len; i++) {
                if (i > 0) {
                  this._line();
    Severity: Major
    Found in lib/readline.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (q < t) {
                                  break;
                              }
      Severity: Major
      Found in lib/punycode.js - About 45 mins to fix

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

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

          Function concat has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          Buffer.concat = function(list, length) {
            if (!util.isArray(list))
              throw new TypeError('list argument must be an Array of Buffers.');
          
            if (util.isUndefined(length)) {
          Severity: Minor
          Found in lib/buffer.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 j = 0, k = part.length; j < k; j++) {
                      if (part.charCodeAt(j) > 127) {
                        // we replace non-ASCII char with a temporary placeholder
                        // we need this to make sure size of hostname is not
                        // broken by replacing non-ASCII by nothing
          Severity: Major
          Found in lib/url.js - About 45 mins to fix

            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

                            Severity
                            Category
                            Status
                            Source
                            Language