Showing 1,896 of 2,859 total issues

Function parserOnIncoming has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function parserOnIncoming(req, shouldKeepAlive) {
    incoming.push(req);

    // If the writable end isn't consuming, then stop reading
    // so that we don't become overwhelmed by a flood of
Severity: Minor
Found in lib/_http_server.js - About 1 hr to fix

    Method call has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def call(env)
        path = env['PATH_INFO'] || env['REQUEST_URI']
        commands = path.split('/')
    
        @count += 1
    Severity: Minor
    Found in benchmark/http_simple.rb - About 1 hr to fix

      Function __init__ has 15 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def __init__(self, arch, mode, shell_dir, mode_flags, verbose, timeout,
      Severity: Major
      Found in deps/v8/tools/testrunner/objects/context.py - About 1 hr to fix

        Function list has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Interface.prototype.list = function(delta) {
          if (!this.requireConnection()) return;
        
          delta || (delta = 5);
        
        
        Severity: Minor
        Found in lib/_debugger.js - About 1 hr to fix

          Function _createServerHandle has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function(address, port, addressType, fd) {
            var err = 0;
            // assign handle in listen, and clean up if bind or listen fails
            var handle;
          
          
          Severity: Minor
          Found in lib/net.js - About 1 hr to fix

            Function fromList has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function fromList(n, state) {
              var list = state.buffer;
              var length = state.length;
              var stringMode = !!state.decoder;
              var objectMode = !!state.objectMode;
            Severity: Minor
            Found in lib/_stream_readable.js - About 1 hr to fix

              Function breakCommandToJSONRequest_ has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              DebugRequest.prototype.breakCommandToJSONRequest_ = function(args) {
                // Build a evaluate request from the text command.
                // Process arguments if any.
                if (args && args.length > 0) {
                  var target = args;
              Severity: Minor
              Found in deps/v8/src/d8.js - About 1 hr to fix

                Function end has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                OutgoingMessage.prototype.end = function(data, encoding, callback) {
                  if (util.isFunction(data)) {
                    callback = data;
                    data = null;
                  } else if (util.isFunction(encoding)) {
                Severity: Minor
                Found in lib/_http_outgoing.js - About 1 hr to fix

                  Function stepCommandToJSONRequest_ has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  DebugRequest.prototype.stepCommandToJSONRequest_ = function(args, type) {
                    // Requesting a step is through the continue command with additional
                    // arguments.
                    var request = this.createRequest('continue');
                    request.arguments = {};
                  Severity: Minor
                  Found in deps/v8/src/d8.js - About 1 hr to fix

                    Function bnpDivRemTo has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function bnpDivRemTo(m,q,r) {
                      var pm = m.abs();
                      if(pm.t <= 0) return;
                      var pt = this.abs();
                      if(pt.t < pm.t) {
                    Severity: Minor
                    Found in deps/v8/benchmarks/crypto.js - About 1 hr to fix

                      Function lookup has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      exports.lookup = function lookup(hostname, options, callback) {
                        var hints = 0;
                        var family = -1;
                      
                        // Parse arguments
                      Severity: Minor
                      Found in lib/dns.js - About 1 hr to fix

                        Function wrap has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Readable.prototype.wrap = function(stream) {
                          var state = this._readableState;
                          var paused = false;
                        
                          var self = this;
                        Severity: Minor
                        Found in lib/_stream_readable.js - About 1 hr to fix

                          Function cb has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function cb (er, data) {
                              var s = npm.config.get('save')
                                , d = npm.config.get('save-dev')
                                , o = npm.config.get('save-optional')
                              if (er || !(s || d || o)) return cb_(er, data)
                          Severity: Minor
                          Found in deps/npm/lib/uninstall.js - About 1 hr to fix

                            Function edit has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function edit (cb) {
                              var e = npm.config.get("editor")
                                , which = npm.config.get("global") ? "global" : "user"
                                , f = npm.config.get(which + "config")
                              if (!e) return cb(new Error("No EDITOR config or environ set."))
                            Severity: Minor
                            Found in deps/npm/lib/config.js - About 1 hr to fix

                              Function GetLdflags has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def GetLdflags(self, config, gyp_to_build_path, expand_special,
                                               manifest_base_name, output_name, is_executable, build_dir):
                                  """Returns the flags that need to be added to link commands, and the
                                  manifest files."""
                                  config = self._TargetConfig(config)
                              Severity: Minor
                              Found in tools/gyp/pylib/gyp/msvs_emulation.py - About 1 hr to fix

                                Function spawnSync has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function spawnSync(/*file, args, options*/) {
                                  var opts = normalizeSpawnArguments.apply(null, arguments);
                                
                                  var options = opts.options;
                                
                                
                                Severity: Minor
                                Found in lib/child_process.js - About 1 hr to fix

                                  Function setupMaster has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    cluster.setupMaster = function(options) {
                                      var settings = {
                                        args: process.argv.slice(2),
                                        exec: process.argv[1],
                                        execArgv: process.execArgv,
                                  Severity: Minor
                                  Found in lib/cluster.js - About 1 hr to fix

                                    Function readSharp has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function readSharp() {
                                        var c = port.readChar();
                                        if (isWhitespace(c))
                                            return new sc_Token(13/*ERROR*/, "bad #-pattern0.");
                                    
                                    
                                    Severity: Minor
                                    Found in deps/v8/benchmarks/earley-boyer.js - About 1 hr to fix

                                      Function help has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function help (args, cb) {
                                        npm.spinner.stop()
                                        var argv = npm.config.get("argv").cooked
                                      
                                        var argnum = 0
                                      Severity: Minor
                                      Found in deps/npm/lib/help.js - About 1 hr to fix

                                        Function _onResponse has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        Client.prototype._onResponse = function(res) {
                                          var cb,
                                              index = -1;
                                        
                                          this._reqCallbacks.some(function(fn, i) {
                                        Severity: Minor
                                        Found in lib/_debugger.js - About 1 hr 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