Showing 1,896 of 2,859 total issues

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

  def _ProcessTestPredictable(self, test, result, pool):
    def HasDifferentAllocations(output1, output2):
      def AllocationStr(stdout):
        for line in reversed((stdout or "").splitlines()):
          if line.startswith("### Allocations = "):
Severity: Minor
Found in deps/v8/tools/testrunner/local/execution.py - 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 Done has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def Done(self):
    print
    for failed in self.runner.failed:
      self.PrintFailureHeader(failed)
      if failed.output.stderr:
Severity: Minor
Found in deps/v8/tools/testrunner/local/progress.py - 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 execute has 39 lines of code (exceeds 25 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

    Function memory has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    REPLServer.prototype.memory = function memory(cmd) {
      var self = this;
    
      self.lines = self.lines || [];
      self.lines.level = self.lines.level || [];
    Severity: Minor
    Found in lib/repl.js - About 1 hr to fix

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

        Function getFlatProfile has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Profile.prototype.getFlatProfile = function(opt_label) {
          var counters = new CallTree();
          var rootLabel = opt_label || CallTree.ROOT_NODE_LABEL;
          var precs = {};
          precs[rootLabel] = 0;
        Severity: Minor
        Found in deps/v8/tools/profile.js - About 1 hr to fix

          Function installAndRetest has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function installAndRetest (set, filter, dir, unavoidable, silent, cb) {
            //return cb(null, set)
            var remove = []
          
            asyncMap(set, function (item, cb) {
          Severity: Minor
          Found in deps/npm/lib/dedupe.js - About 1 hr to fix

            Function gyp_main has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def gyp_main(args):
              my_name = os.path.basename(sys.argv[0])
            
              parser = RegeneratableOptionParser()
              usage = 'usage: %s [options ...] [build_file ...]'
            Severity: Minor
            Found in tools/gyp/pylib/gyp/__init__.py - About 1 hr to fix

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

              Interface.prototype._tabComplete = function() {
                var self = this;
              
                self.pause();
                self.completer(self.line.slice(0, self.cursor), function(err, rv) {
              Severity: Minor
              Found in lib/readline.js - About 1 hr to fix

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

                function ChildProcess() {
                  EventEmitter.call(this);
                
                  // Initialize TCPWrap and PipeWrap
                  process.binding('tcp_wrap');
                Severity: Minor
                Found in lib/child_process.js - About 1 hr to fix

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

                  function socketOnData(d) {
                    var socket = this;
                    var req = this._httpMessage;
                    var parser = this.parser;
                  
                  
                  Severity: Minor
                  Found in lib/_http_client.js - About 1 hr to fix

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

                    function parseListItem(item) {
                      if (item.options) item.options.forEach(parseListItem);
                      if (!item.textRaw) return;
                    
                      // the goal here is to find the name, type, default, and optional.
                    Severity: Minor
                    Found in tools/doc/json.js - About 1 hr to fix

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

                      Client.prototype._onResponse = function(res) {
                        var cb,
                            index = -1;
                      
                        this._reqCallbacks.some(function(fn, i) {
                      Severity: Minor
                      Found in lib/_debugger.js - About 1 hr to fix

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

                          function callback(availInAfter, availOutAfter) {
                            if (self._hadError)
                              return;
                        
                            var have = availOutBefore - availOutAfter;
                        Severity: Minor
                        Found in lib/zlib.js - About 1 hr to fix

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

                          function main(conf) {
                            var api = conf.api;
                            if (api === 'stream' && process.version.match(/^v0\.[0-8]\./)) {
                              console.error('Crypto streams not available until v0.10');
                              // use the legacy, just so that we can compare them.
                          Severity: Minor
                          Found in benchmark/crypto/cipher-stream.js - About 1 hr to fix

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

                            function bnModInverse(m) {
                              var ac = m.isEven();
                              if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
                              var u = m.clone(), v = this.clone();
                              var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
                            Severity: Minor
                            Found in deps/v8/benchmarks/crypto.js - About 1 hr to fix

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

                              BenchmarkSuite.prototype.RunStep = function(runner) {
                                this.results = [];
                                this.runner = runner;
                                var length = this.benchmarks.length;
                                var index = 0;
                              Severity: Minor
                              Found in deps/v8/benchmarks/base.js - About 1 hr to fix

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

                                function run (pkg, wd, cmd, args, cb) {
                                  if (!pkg.scripts) pkg.scripts = {}
                                
                                  var cmds
                                  if (cmd === "restart" && !pkg.scripts.restart) {
                                Severity: Minor
                                Found in deps/npm/lib/run-script.js - About 1 hr to fix

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

                                  function outdated (args, silent, cb) {
                                    if (typeof cb !== "function") cb = silent, silent = false
                                    var dir = path.resolve(npm.dir, "..")
                                  
                                    // default depth for `outdated` is 0 (cf. `ls`)
                                  Severity: Minor
                                  Found in deps/npm/lib/outdated.js - About 1 hr to fix

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

                                    function prettify (tree, installed) {
                                      function red (set, kv) {
                                        set[kv[0]] = kv[1]
                                        return set
                                      }
                                    Severity: Minor
                                    Found in deps/npm/lib/install.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language