Showing 1,896 of 2,859 total issues

Function server has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function server() {
  var serverHandle = new TCP();
  var err = serverHandle.bind('127.0.0.1', PORT);
  if (err)
    fail(err, 'bind');
Severity: Major
Found in benchmark/net/tcp-raw-s2c.js - About 2 hrs to fix

    Function addLocalDirectory has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function addLocalDirectory (p, pkgData, shasum, cb) {
      assert(pkgData, "must pass package data")
      assert(typeof cb === "function", "must have callback")
    
      // if it's a folder, then read the package.json,
    Severity: Major
    Found in deps/npm/lib/cache/add-local.js - About 2 hrs to fix

      Function load has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function load (npm, cli, cb) {
        which(process.argv[0], function (er, node) {
          if (!er && node.toUpperCase() !== process.execPath.toUpperCase()) {
            log.verbose("node symlink", node)
            process.execPath = node
      Severity: Major
      Found in deps/npm/lib/npm.js - About 2 hrs to fix

        Function WriteTarget has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
                        options, generator_flags, all_qualified_targets, output):
        
          # The make generator does this always.
          # TODO: It would be nice to be able to tell CMake all dependencies.
        Severity: Major
        Found in tools/gyp/pylib/gyp/generator/cmake.py - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                if (is_last_code_in_line and
                    self._StatementCouldEndInContext() and
                    not is_multiline_string and
                    not is_end_of_block and
                    not is_continued_identifier and
          Severity: Critical
          Found in tools/closure_linter/closure_linter/ecmametadatapass.py - About 2 hrs to fix

            MacTool has 22 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class MacTool(object):
              """This class performs all the Mac tooling steps. The methods can either be
              executed directly, or dispatched from an argument list."""
            
              def Dispatch(self, args):
            Severity: Minor
            Found in tools/gyp/pylib/gyp/mac_tool.py - About 2 hrs to fix

              Function bind has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Socket.prototype.bind = function(port /*, address, callback*/) {
                var self = this;
              
                self._healthCheck();
              
              
              Severity: Major
              Found in lib/dgram.js - About 2 hrs to fix

                Function runBlock1 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function runBlock1() {
                    for (var i = 0; i < 81; i++) {
                      re8.exec(s26[i]);
                    }
                    for (var i = 0; i < 78; i++) {
                Severity: Major
                Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

                  Function runBlock2 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function runBlock2() {
                      for (var i = 0; i < 40; i++) {
                        s57a[i].replace(re14, '');
                        s57a[i].replace(re15, '');
                      }
                  Severity: Major
                  Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

                    Function helpCommand_ has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    DebugRequest.prototype.helpCommand_ = function(args) {
                      // Help os quite simple.
                      if (args && args.length > 0) {
                        print('warning: arguments to \'help\' are ignored');
                      }
                    Severity: Major
                    Found in deps/v8/src/d8.js - About 2 hrs to fix

                      Function getLite has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getLite (data, noname) {
                        var lite = {}
                          , maxDepth = npm.config.get("depth")
                      
                        if (!noname && data.name) lite.name = data.name
                      Severity: Major
                      Found in deps/npm/lib/ls.js - About 2 hrs to fix

                        Function save has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Conf.prototype.save = function (where, cb) {
                          var target = this.sources[where]
                          if (!target || !(target.path || target.source) || !target.data) {
                            if (where !== "builtin")
                              var er = new Error("bad save target: " + where)
                        Severity: Major
                        Found in deps/npm/lib/config/core.js - About 2 hrs to fix

                          File run_benchmarks_test.py has 262 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          #!/usr/bin/env python
                          # Copyright 2014 the V8 project authors. All rights reserved.
                          # Use of this source code is governed by a BSD-style license that can be
                          # found in the LICENSE file.
                          
                          
                          Severity: Minor
                          Found in deps/v8/tools/unittests/run_benchmarks_test.py - About 2 hrs to fix

                            Function Buffer has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function Buffer(subject, encoding) {
                              if (!util.isBuffer(this))
                                return new Buffer(subject, encoding);
                            
                              if (util.isNumber(subject)) {
                            Severity: Major
                            Found in lib/buffer.js - About 2 hrs to fix

                              Function trySpawn has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                              Interface.prototype.trySpawn = function(cb) {
                                var self = this,
                                    breakpoints = this.breakpoints || [],
                                    port = exports.port,
                                    host = 'localhost',
                              Severity: Minor
                              Found in lib/_debugger.js - About 2 hrs 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 removeAllListeners has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  function removeAllListeners(type) {
                                var key, listeners;
                              
                                if (!this._events)
                                  return this;
                              Severity: Minor
                              Found in lib/events.js - About 2 hrs 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 writeHead has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                              ServerResponse.prototype.writeHead = function(statusCode, reason, obj) {
                                var headers;
                              
                                if (util.isString(reason)) {
                                  // writeHead(statusCode, reasonPhrase[, headers])
                              Severity: Minor
                              Found in lib/_http_server.js - About 2 hrs 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 format has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                              exports.format = function(f) {
                                if (!isString(f)) {
                                  var objects = [];
                                  for (var i = 0; i < arguments.length; i++) {
                                    objects.push(inspect(arguments[i]));
                              Severity: Minor
                              Found in lib/util.js - About 2 hrs 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 readFile has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                              fs.readFile = function(path, options, callback_) {
                                var callback = maybeCallback(arguments[arguments.length - 1]);
                              
                                if (util.isFunction(options) || !options) {
                                  options = { encoding: null, flag: 'r' };
                              Severity: Minor
                              Found in lib/fs.js - About 2 hrs 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 pipe has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                              Readable.prototype.pipe = function(dest, pipeOpts) {
                                var src = this;
                                var state = this._readableState;
                              
                                switch (state.pipesCount) {
                              Severity: Minor
                              Found in lib/_stream_readable.js - About 2 hrs 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