Showing 2,859 of 2,859 total issues

Function addCommand has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) {
  Object.defineProperty(npm.commands, c, { get : function () {
    if (!loaded) throw new Error(
      "Call npm.load(config, cb) before using this command.\n"+
      "See the README.md or cli.js for example usage.")
Severity: Minor
Found in deps/npm/lib/npm.js - About 1 hr to fix

    Function formatResults has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function formatResults (args, results, cb) {
      if (!results) return cb(null)
    
      var cols = Math.min(process.stdout.columns || Infinity, 80) + 1
    
    
    Severity: Minor
    Found in deps/npm/lib/help-search.js - About 1 hr to fix

      Function _GenerateMSBuildProject has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def _GenerateMSBuildProject(project, options, version, generator_flags):
        spec = project.spec
        configurations = spec['configurations']
        project_dir, project_file_name = os.path.split(project.path)
        gyp.common.EnsureDirExists(project.path)
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/msvs.py - About 1 hr to fix

        Function sh_mergeTags has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function sh_mergeTags(originalTags, highlightTags) {
          var numOriginalTags = originalTags.length;
          if (numOriginalTags === 0) {
            return highlightTags;
          }
        Severity: Minor
        Found in doc/sh_main.js - About 1 hr to fix

          Function addTmpTarball has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function addTmpTarball (tgz, pkgData, shasum, cb) {
            assert(typeof cb === "function", "must have callback function")
            assert(shasum, "must have shasum by now")
          
            cb = inflight("addTmpTarball:" + tgz, cb)
          Severity: Minor
          Found in deps/npm/lib/cache/add-local-tarball.js - About 1 hr to fix

            Function GenerateOutput has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def GenerateOutput(target_list, target_dicts, data, params):
              options = params['options']
              flavor = gyp.common.GetFlavor(params)
              generator_flags = params.get('generator_flags', {})
              builddir_name = generator_flags.get('output_dir', 'out')
            Severity: Minor
            Found in tools/gyp/pylib/gyp/generator/make.py - About 1 hr to fix

              Function Write has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def Write(self, qualified_target, relative_target, base_path, output_filename,
                          spec, configs, part_of_all):
                  """The main entry point: writes a .mk file for a single target.
              
                  Arguments:
              Severity: Minor
              Found in tools/gyp/pylib/gyp/generator/android.py - About 1 hr to fix

                Function scripts has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                Interface.prototype.scripts = function() {
                  if (!this.requireConnection()) return;
                
                  var client = this.client,
                      displayNatives = arguments[0] || false,
                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

                Function _writeGeneric has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
                  // If we are still connecting, then buffer this for later.
                  // The Writable logic will buffer up any more writes while
                  // waiting for this one to be done.
                  if (this._connecting) {
                Severity: Minor
                Found in lib/net.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

                Function addListener has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                EventEmitter.prototype.addListener = function addListener(type, listener) {
                  var m;
                
                  if (!util.isFunction(listener))
                    throw TypeError('listener must be a function');
                Severity: Minor
                Found in lib/events.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

                Function slice has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                Buffer.prototype.slice = function(start, end) {
                  var len = this.length;
                  start = ~~start;
                  end = util.isUndefined(end) ? len : ~~end;
                
                
                Severity: Minor
                Found in lib/buffer.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

                Function connect has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                function connect(self, address, port, addressType, localAddress, localPort) {
                  // TODO return promise from Socket.prototype.connect which
                  // wraps _connectReq.
                
                  assert.ok(self._connecting);
                Severity: Minor
                Found in lib/net.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

                Function sh_extractTagsFromNodeList has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                function sh_extractTagsFromNodeList(nodeList, result) {
                  var length = nodeList.length;
                  for (var i = 0; i < length; i++) {
                    var node = nodeList.item(i);
                    switch (node.nodeType) {
                Severity: Minor
                Found in doc/sh_main.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

                Function kill has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                ChildProcess.prototype.kill = function(sig) {
                  var signal;
                
                  if (!constants) {
                    constants = process.binding('constants');
                Severity: Minor
                Found in lib/child_process.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

                Function removeSocket has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                Agent.prototype.removeSocket = function(s, options) {
                  var name = this.getName(options);
                  debug('removeSocket', name, 'destroyed:', s.destroyed);
                  var sets = [this.sockets];
                
                
                Severity: Minor
                Found in lib/_http_agent.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

                Function backtraceCommandToJSONRequest_ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                DebugRequest.prototype.backtraceCommandToJSONRequest_ = function(args) {
                  // Build a backtrace request from the text command.
                  var request = this.createRequest('backtrace');
                
                  // Default is to show top 10 frames.
                Severity: Minor
                Found in deps/v8/src/d8.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

                Function sc_toWriteCircleString has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) {
                    if (this[symb + "use"]) { // use-flag is set. Just use it.
                    var nb = this[symb + "nb"];
                    if (this[symb]-- === 0) { // if we are the last use. remove all fields.
                        delete this[symb];
                Severity: Minor
                Found in deps/v8/benchmarks/earley-boyer.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

                Function _writeRaw has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                OutgoingMessage.prototype._writeRaw = function(data, encoding, callback) {
                  if (util.isFunction(encoding)) {
                    callback = encoding;
                    encoding = null;
                  }
                Severity: Minor
                Found in lib/_http_outgoing.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

                Function end has a Cognitive Complexity of 13 (exceeds 5 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

                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 sc_jsstring2number has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                function sc_jsstring2number(s, radix) {
                    if (s === "") return false;
                
                    if (radix) {
                    var t = parseInt(s, radix);
                Severity: Minor
                Found in deps/v8/benchmarks/earley-boyer.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