Showing 1,896 of 2,859 total issues

Function write has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function write (target, targetFolder, context, cb_) {
  var up = npm.config.get("unsafe-perm")
    , user = up ? null : npm.config.get("user")
    , group = up ? null : npm.config.get("group")
    , family = context.family
Severity: Major
Found in deps/npm/lib/install.js - About 2 hrs to fix

    Function addNameVersion has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function addNameVersion (name, v, data, cb) {
      var ver = semver.valid(v, true)
      if (!ver) return cb(new Error("Invalid version: "+v))
    
      var response
    Severity: Major
    Found in deps/npm/lib/cache/add-named.js - About 2 hrs to fix

      Function write has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Buffer.prototype.write = function(string, offset, length, encoding) {
        // Buffer#write(string);
        if (util.isUndefined(offset)) {
          encoding = 'utf8';
          length = this.length;
      Severity: Major
      Found in lib/buffer.js - About 2 hrs to fix

        Function read has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        CryptoStream.prototype._read = function read(size) {
          // XXX: EOF?!
          if (!this.pair.ssl) return this.push(null);
        
          // Wait for session to be resumed
        Severity: Major
        Found in lib/_tls_legacy.js - About 2 hrs to fix

          Function SecurePair has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function SecurePair(context, isServer, requestCert, rejectUnauthorized,
                              options) {
            if (!(this instanceof SecurePair)) {
              return new SecurePair(context,
                                    isServer,
          Severity: Major
          Found in lib/_tls_legacy.js - About 2 hrs to fix

            Function exports has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var server = module.exports = http.createServer(function (req, res) {
              if (useDomains) {
                var dom = domain.create();
                dom.add(req);
                dom.add(res);
            Severity: Major
            Found in benchmark/http_simple.js - About 2 hrs to fix

              Function readDependencies has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function readDependencies (context, where, opts, cb) {
                var wrap = context ? context.wrap : null
              
                var jsonPath = path.resolve(where, 'package.json')
                log.verbose('readDependencies', 'loading dependencies from', jsonPath)
              Severity: Major
              Found in deps/npm/lib/install.js - About 2 hrs to fix

                Function UIWrapper has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function UIWrapper() {
                  var input_elements = ["range_start",
                                        "range_end",
                                        "distortion",
                                        "start",
                Severity: Major
                Found in deps/v8/tools/profviz/profviz.js - About 2 hrs to fix

                  Function Unwrapper has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function Unwrapper() {
                    var self = this;
                  
                    Stream.call(this);
                    this.writable = true;
                  Severity: Minor
                  Found in tools/license2rtf.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 _deferToConnect has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) {
                    // This function is for calls that need to happen once the socket is
                    // connected and writable. It's an important promisy thing for all the socket
                    // calls that happen either now (when a socket is assigned) or
                    // in the future (when a socket gets assigned out of the pool and is
                  Severity: Minor
                  Found in lib/_http_client.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 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Stream.prototype.pipe = function(dest, options) {
                    var source = this;
                  
                    function ondata(chunk) {
                      if (dest.writable) {
                  Severity: Minor
                  Found in lib/stream.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 Socket has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function Socket(options) {
                    if (!(this instanceof Socket)) return new Socket(options);
                  
                    this._connecting = false;
                    this._hadError = false;
                  Severity: Minor
                  Found in lib/net.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 _transform has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Client.prototype._transform = function _transform(data, enc, cb) {
                    cb();
                  
                    this.buffer += data;
                  
                  
                  Severity: Minor
                  Found in deps/debugger-agent/lib/_debugger_agent.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 _Add has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def _Add(self, token_info):
                      """Adds the given token info to the stack.
                  
                      Args:
                        token_info: The token information to add.
                  Severity: Minor
                  Found in tools/closure_linter/closure_linter/indentation.py - 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 _LinkDependenciesInternal has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def _LinkDependenciesInternal(self, targets, include_shared_libraries,
                                                  dependencies=None, initial=True):
                      """Returns a list of dependency targets that are linked into this target.
                  
                      This function has a split personality, depending on the setting of
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/input.py - 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 ProcessVariablesAndConditionsInDict has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def ProcessVariablesAndConditionsInDict(the_dict, phase, variables_in,
                                                          build_file, the_dict_key=None):
                    """Handle all variable and command expansion and conditional evaluation.
                  
                    This function is the public entry point for all variable expansions and
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/input.py - 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 prettyprint_input has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def prettyprint_input(lines):
                    """Does the main work of indenting the input based on the brace counts."""
                    indent = 0
                    basic_offset = 2
                    last_line = ""
                  Severity: Minor
                  Found in tools/gyp/tools/pretty_gyp.py - 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 MakeChangeLogBugReference has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def MakeChangeLogBugReference(body):
                    """Grep for "BUG=xxxx" lines in the commit message and convert them to
                    "(issue xxxx)".
                    """
                    crbugs = []
                  Severity: Minor
                  Found in deps/v8/tools/push-to-trunk/common_includes.py - 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 changeBreakpointCommandToJSONRequest_ has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function(args, command) {
                  
                    var request;
                  
                    // Check for exception breaks first:
                  Severity: Major
                  Found in deps/v8/src/d8.js - About 2 hrs to fix

                    File punycode.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*! http://mths.be/punycode v1.2.3 by @mathias */
                    ;(function(root) {
                    
                        /** Detect free variables */
                        var freeExports = typeof exports == 'object' && exports;
                    Severity: Minor
                    Found in lib/punycode.js - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language