Showing 1,896 of 2,859 total issues

Function parseField has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function parseField (f, k) {
  if (typeof f !== "string" && !(f instanceof String))
    return f

  // type can be an array or single thing.
Severity: Minor
Found in deps/npm/lib/config/core.js - About 1 hr to fix

    Function createWritableStdioStream has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function createWritableStdioStream(fd) {
        var stream;
        var tty_wrap = process.binding('tty_wrap');
    
        // Note stream._type is used for test-module-load-list.js
    Severity: Minor
    Found in src/node.js - About 1 hr to fix

      Function createSocket has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Agent.prototype.createSocket = function(req, options) {
        var self = this;
        options = util._extend({}, options);
        options = util._extend(options, self.options);
      
      
      Severity: Minor
      Found in lib/_http_agent.js - About 1 hr to fix

        Function pipe has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.pipe = function pipe(pair, socket) {
          pair.encrypted.pipe(socket);
          socket.pipe(pair.encrypted);
        
          pair.encrypted.on('close', function() {
        Severity: Minor
        Found in lib/_tls_legacy.js - About 1 hr to fix

          Function run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function run() {
            if (--r < 0)
              return compare();
            toggle = ++toggle % 2;
          
          
          Severity: Minor
          Found in benchmark/compare.js - About 1 hr to fix

            Function sc_toWriteCircleString has 37 lines of code (exceeds 25 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

              Function installedDeep has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function installedDeep (opts, cb) {
                var local
                  , global
                  , depth = npm.config.get("depth")
                  , opt = { depth: depth, dev: true }
              Severity: Minor
              Found in deps/npm/lib/utils/completion/installed-deep.js - About 1 hr to fix

                Function updateDeps has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function updateDeps (er, d) {
                    if (er) {
                      if (parsed.type !== 'local') return cb()
                      return updateLocalDeps()
                    }
                Severity: Minor
                Found in deps/npm/lib/outdated.js - About 1 hr to fix

                  Function rmMans has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function rmMans (pkg, folder, parent, top, cb) {
                    if (!pkg.man
                        || !top
                        || process.platform === "win32"
                        || !npm.config.get("global")) {
                  Severity: Minor
                  Found in deps/npm/lib/unbuild.js - About 1 hr to fix

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

                    function save (c, u, cb) {
                      npm.spinner.start()
                    
                      // save existing configs, but yank off for this PUT
                      var uri   = npm.config.get("registry")
                    Severity: Minor
                    Found in deps/npm/lib/adduser.js - About 1 hr to fix

                      Function X has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          , function X (er) {
                            if (er) return cb(er)
                      
                            // before continuing to installing dependencies, check for a shrinkwrap.
                            var opt = { dev: npm.config.get("dev") }
                      Severity: Minor
                      Found in deps/npm/lib/install.js - About 1 hr to fix

                        Function processSignalHandlers has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          startup.processSignalHandlers = function() {
                            // Load events module in order to access prototype elements on process like
                            // process.addListener.
                            var signalWraps = {};
                            var addListener = process.addListener;
                        Severity: Minor
                        Found in src/node.js - About 1 hr to fix

                          Function clearBreakpoint has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          Interface.prototype.clearBreakpoint = function(script, line) {
                            if (!this.requireConnection()) return;
                          
                            var ambiguous,
                                breakpoint,
                          Severity: Minor
                          Found in lib/_debugger.js - About 1 hr to fix

                            Function readableAddChunk has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function readableAddChunk(stream, state, chunk, encoding, addToFront) {
                              var er = chunkInvalid(state, chunk);
                              if (er) {
                                stream.emit('error', er);
                              } else if (chunk === null) {
                            Severity: Minor
                            Found in lib/_stream_readable.js - About 1 hr to fix

                              Function bnpFromString has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function bnpFromString(s,b) {
                                var this_array = this.array;
                                var k;
                                if(b == 16) k = 4;
                                else if(b == 8) k = 3;
                              Severity: Minor
                              Found in deps/v8/benchmarks/crypto.js - About 1 hr to fix

                                Function filterInstalled has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function filterInstalled (local, global, filter, cb) {
                                  var fl
                                    , fg
                                
                                  if (!filter) {
                                Severity: Minor
                                Found in deps/npm/lib/utils/completion/installed-shallow.js - About 1 hr to fix

                                  Function completion has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  install.completion = function (opts, cb) {
                                    // install can complete to a folder with a package.json, or any package.
                                    // if it has a slash, then it's gotta be a folder
                                    // if it starts with https?://, then just give up, because it's a url
                                    if (/^https?:\/\//.test(opts.partialWord)) {
                                  Severity: Minor
                                  Found in deps/npm/lib/install.js - About 1 hr to fix

                                    Function GenerateOutputForConfig has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

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

                                      Function execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      Protocol.prototype.execute = function(d) {
                                        var res = this.res;
                                        res.raw += d;
                                      
                                        switch (this.state) {
                                      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 sh_mergeTags has a Cognitive Complexity of 12 (exceeds 5 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

                                      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