Showing 1,896 of 2,859 total issues

Function emit has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

EventEmitter.prototype.emit = function emit(type) {
  var er, handler, len, args, i, listeners;

  if (!this._events)
    this._events = {};
Severity: Major
Found in lib/events.js - About 2 hrs to fix

    Function prettify has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function prettify (data, args) {
      var searchsort = (npm.config.get("searchsort") || "NAME").toLowerCase()
        , sortField = searchsort.replace(/^\-+/, "")
        , searchRev = searchsort.charAt(0) === "-"
        , truncate = !npm.config.get("long")
    Severity: Major
    Found in deps/npm/lib/search.js - About 2 hrs to fix

      AndroidMkWriter has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class AndroidMkWriter(object):
        """AndroidMkWriter packages up the writing of one target-specific Android.mk.
      
        Its only real entry point is Write(), and is mostly used for namespacing.
        """
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/android.py - About 2 hrs to fix

        Map has 21 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Map(HeapObject):
          def Decode(self, offset, size, value):
            return (value >> offset) & ((1 << size) - 1)
        
          # Instance Sizes
        Severity: Minor
        Found in deps/v8/tools/grokdump.py - About 2 hrs to fix

          Function _send has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            target._send = function(message, handle, swallowErrors) {
              assert(this.connected || this._channel);
          
              if (util.isUndefined(message))
                throw new TypeError('message cannot be undefined');
          Severity: Major
          Found in lib/child_process.js - About 2 hrs to fix

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

            Stream.prototype.pipe = function(dest, options) {
              var source = this;
            
              function ondata(chunk) {
                if (dest.writable) {
            Severity: Major
            Found in lib/stream.js - About 2 hrs to fix

              Function listen has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Server.prototype.listen = function() {
                var self = this;
              
                var lastArg = arguments[arguments.length - 1];
                if (util.isFunction(lastArg)) {
              Severity: Major
              Found in lib/net.js - About 2 hrs to fix

                File view.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // npm view [pkg [pkg ...]]
                
                module.exports = view
                view.usage = "npm view pkg[@version] [<field>[.subfield]...]"
                
                
                Severity: Minor
                Found in deps/npm/lib/view.js - About 2 hrs to fix

                  Function decode has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function decode(input) {
                          // Don't use UCS-2
                          var output = [],
                              inputLength = input.length,
                              out,
                  Severity: Major
                  Found in lib/punycode.js - About 2 hrs to fix

                    Function Agent has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function Agent(options) {
                      if (!(this instanceof Agent))
                        return new Agent(options);
                    
                      EventEmitter.call(this);
                    Severity: Major
                    Found in lib/_http_agent.js - About 2 hrs to fix

                      Function Stringify has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function Stringify(x, depth) {
                        if (depth === undefined)
                          depth = stringifyDepthLimit;
                        else if (depth === 0)
                          return "*";
                      Severity: Major
                      Found in deps/v8/src/d8.js - About 2 hrs to fix

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

                        OutgoingMessage.prototype.write = function(chunk, encoding, callback) {
                          var self = this;
                        
                          if (this.finished) {
                            var err = new Error('write after end');
                        Severity: Major
                        Found in lib/_http_outgoing.js - About 2 hrs to fix

                          Function resolver has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            return function resolver (what, cb) {
                              if (resolveLeft) return setTimeout(function () {
                                resolver(what, cb)
                              }, to++)
                          
                          
                          Severity: Major
                          Found in deps/npm/lib/install.js - About 2 hrs to fix

                            Function objEquiv has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function objEquiv(a, b) {
                              if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
                                return false;
                              // an identical 'prototype' property.
                              if (a.prototype !== b.prototype) return false;
                            Severity: Minor
                            Found in lib/assert.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 send has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            Socket.prototype.send = function(buffer,
                                                             offset,
                                                             length,
                                                             port,
                                                             address,
                            Severity: Minor
                            Found in lib/dgram.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 _read has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            ReadStream.prototype._read = function(n) {
                              if (!util.isNumber(this.fd))
                                return this.once('open', function() {
                                  this._read(n);
                                });
                            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 SecurePair has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function SecurePair(context, isServer, requestCert, rejectUnauthorized,
                                                options) {
                              if (!(this instanceof SecurePair)) {
                                return new SecurePair(context,
                                                      isServer,
                            Severity: Minor
                            Found in lib/_tls_legacy.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 breakCommandToJSONRequest_ has a Cognitive Complexity of 16 (exceeds 5 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 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 client has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function client() {
                              var chunk;
                              switch (type) {
                                case 'buf':
                                  chunk = new Buffer(len);
                            Severity: Minor
                            Found in benchmark/net/tcp-raw-pipe.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 bnIsProbablePrime has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function bnIsProbablePrime(t) {
                              var i, x = this.abs();
                              var x_array = x.array;
                              if(x.t == 1 && x_array[0] <= lowprimes[lowprimes.length-1]) {
                                for(i = 0; i < lowprimes.length; ++i)
                            Severity: Minor
                            Found in deps/v8/benchmarks/crypto.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