Showing 1,896 of 2,859 total issues

Function targetResolver has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function targetResolver (where, context, deps, devDeps) {
  var alreadyInstalledManually = []
    , resolveLeft = 0
    , nm = path.resolve(where, "node_modules")
    , parent = context.parent
Severity: Major
Found in deps/npm/lib/install.js - About 3 hrs to fix

    StateTracker has 31 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class StateTracker(object):
      """EcmaScript state tracker.
    
      Tracks block depth, function names, etc. within an EcmaScript token stream.
      """
    Severity: Minor
    Found in tools/closure_linter/closure_linter/statetracker.py - About 3 hrs to fix

      MakefileWriter has 31 functions (exceeds 20 allowed). Consider refactoring.
      Open

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

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

        Readable.prototype.pipe = function(dest, pipeOpts) {
          var src = this;
          var state = this._readableState;
        
          switch (state.pipesCount) {
        Severity: Major
        Found in lib/_stream_readable.js - About 3 hrs to fix

          File run_benchmarks.py has 323 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #!/usr/bin/env python
          # Copyright 2014 the V8 project authors. All rights reserved.
          # Use of this source code is governed by a BSD-style license that can be
          # found in the LICENSE file.
          
          
          Severity: Minor
          Found in deps/v8/tools/run_benchmarks.py - About 3 hrs to fix

            Function fromList has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            function fromList(n, state) {
              var list = state.buffer;
              var length = state.length;
              var stringMode = !!state.decoder;
              var objectMode = !!state.objectMode;
            Severity: Minor
            Found in lib/_stream_readable.js - About 3 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 DebugEventDetails has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            function DebugEventDetails(response) {
              var details = {text:'', running:false};
            
              // Get the running state.
              details.running = response.running();
            Severity: Minor
            Found in deps/v8/src/d8.js - About 3 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 bnToString has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            function bnToString(b) {
              var this_array = this.array;
              if(this.s < 0) return "-"+this.negate().toString(b);
              var k;
              if(b == 16) k = 4;
            Severity: Minor
            Found in deps/v8/benchmarks/crypto.js - About 3 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 splay_ has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            SplayTree.prototype.splay_ = function(key) {
              if (this.isEmpty()) {
                return;
              }
              // Create a dummy node.  The use of the dummy node is a bit
            Severity: Minor
            Found in deps/v8/benchmarks/spinning-balls/splay-tree.js - About 3 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 splay_ has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            SplayTree.prototype.splay_ = function(key) {
              if (this.isEmpty()) {
                return;
              }
              // Create a dummy node.  The use of the dummy node is a bit
            Severity: Minor
            Found in deps/v8/benchmarks/splay.js - About 3 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 splay_ has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            SplayTree.prototype.splay_ = function(key) {
              if (this.isEmpty()) {
                return;
              }
              // Create a dummy node.  The use of the dummy node is a bit
            Severity: Minor
            Found in deps/v8/tools/splaytree.js - About 3 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 CheckLines has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

              def CheckLines(self, filename, lines_iter, is_html):
                """Checks a file, given as an iterable of lines, for warnings and errors.
            
                Args:
                  filename: The name of the file to check.
            Severity: Minor
            Found in tools/closure_linter/closure_linter/checkerbase.py - About 3 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 FilterTestCasesByStatus has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

              def FilterTestCasesByStatus(self, warn_unused_rules,
                                          flaky_tests="dontcare",
                                          slow_tests="dontcare",
                                          pass_fail_tests="dontcare"):
                filtered = []
            Severity: Minor
            Found in deps/v8/tools/testrunner/local/testsuite.py - About 3 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 processNextTick has 92 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              startup.processNextTick = function() {
                var nextTickQueue = [];
                var microtasksScheduled = false;
            
                // Used to run V8's micro task queue.
            Severity: Major
            Found in src/node.js - About 3 hrs to fix

              Function outdated_ has 90 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function outdated_ (args, dir, parentHas, depth, cb) {
                // get the deps from package.json, or {<dir/node_modules/*>:"*"}
                // asyncMap over deps:
                //   shouldHave = cache.add(dep, req).version
                //   if has === shouldHave then
              Severity: Major
              Found in deps/npm/lib/outdated.js - About 3 hrs to fix

                Function _init has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                TLSSocket.prototype._init = function(socket) {
                  assert(this._handle);
                
                  // lib/net.js expect this value to be non-zero if write hasn't been flushed
                  // immediately
                Severity: Minor
                Found in lib/_tls_wrap.js - About 3 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 stepCommandToJSONRequest_ has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                DebugRequest.prototype.stepCommandToJSONRequest_ = function(args, type) {
                  // Requesting a step is through the continue command with additional
                  // arguments.
                  var request = this.createRequest('continue');
                  request.arguments = {};
                Severity: Minor
                Found in deps/v8/src/d8.js - About 3 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 bnpFromString has a Cognitive Complexity of 25 (exceeds 5 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 3 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 server has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                var server = http.createServer(function (req, res) {
                  var commands = req.url.split("/");
                  var command = commands[1];
                  var body = "";
                  var arg = commands[2];
                Severity: Minor
                Found in benchmark/http_simple_auto.js - About 3 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 ReadFlagsFromFiles has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                Open

                  def ReadFlagsFromFiles(self, argv, force_gnu=True):
                    """Processes command line args, but also allow args to be read from file.
                    Args:
                      argv: A list of strings, usually sys.argv[1:], which may contain one or
                        more flagfile directives of the form --flagfile="./filename".
                Severity: Minor
                Found in tools/closure_linter/gflags.py - About 3 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