Showing 1,896 of 2,859 total issues

Function _Pop has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def _Pop(self):
    """Pops the top token from the stack.

    Returns:
      The popped token info.
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 _ConvertSourcesToFilterHierarchy has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None,
                                     list_excluded=True, msvs_version=None):
  """Converts a list split source file paths into a vcproj folder hierarchy.

  Arguments:
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/msvs.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 WriteSources has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def WriteSources(self, spec, configs, extra_sources):
    """Write Makefile code for any 'sources' from the gyp input.
    These are source files necessary to build the current target.
    We need to handle shared_intermediate directory source files as
    a special case by copying them to the intermediate directory and
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/android.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 ComputeOutput has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def ComputeOutput(self, spec, arch=None):
    """Compute the path for the final output of the spec."""
    type = spec['type']

    if self.flavor == 'win':
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/ninja.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 CheckNextIncludeOrder has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def CheckNextIncludeOrder(self, header_type):
    """Returns a non-empty error message if the next header is out of order.

    This function also updates the internal state to be ready to check
    the next include.
Severity: Minor
Found in tools/cpplint.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 execute has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def execute(self, command, stdout=None, stderr=None):
    """
    Executes a single command.
    """
    if not self.active:
Severity: Minor
Found in tools/gyp/gyptest.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 ParseArguments has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def ParseArguments(args):
  """Parses the command line arguments.

  This may set the output format and verbosity level as side-effects.

Severity: Minor
Found in tools/cpplint.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 _line has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def _line(self, text, indent=0):
        """Write 'text' word-wrapped at self.width characters."""
        leading_space = '  ' * indent
        while len(leading_space) + len(text) > self.width:
            # The text is too wide; wrap if possible.
Severity: Minor
Found in tools/gyp/pylib/gyp/ninja_syntax.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 Main has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def Main():
  parser = BuildOptions()
  (options, args) = parser.parse_args()
  if not ProcessOptions(options):
    parser.print_help()
Severity: Minor
Found in deps/v8/tools/run-tests.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 ProcessLogFile has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def ProcessLogFile(filename, options):
  if options.js_cons_profile:
    itemname = 'heap-js-cons-item'
  else:
    itemname = 'heap-sample-item'
Severity: Minor
Found in deps/v8/tools/process-heap-prof.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 FindFilesIn has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def FindFilesIn(self, path):
    if os.path.exists(path+'/.git'):
      output = subprocess.Popen('git ls-files --full-name',
                                stdout=PIPE, cwd=path, shell=True)
      result = []
Severity: Minor
Found in deps/v8/tools/presubmit.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 output_disasm_range has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def output_disasm_range(
      self, f, start_address, end_address, highlight_address, exact):
    region = self.reader.FindRegion(highlight_address)
    if start_address < region[0]:
      start_address = region[0]
Severity: Minor
Found in deps/v8/tools/grokdump.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 _SenderThread has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

  def _SenderThread(self):
    keep_running = True
    tests = []
    self.sender_lock.acquire()
    while keep_running:
Severity: Minor
Found in deps/v8/tools/testrunner/network/endpoint.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 _compile has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Module.prototype._compile = function(content, filename) {
  var self = this;
  // remove shebang
  content = content.replace(/^\#\!.*/, '');

Severity: Major
Found in lib/module.js - About 2 hrs to fix

    Function spawn has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ChildProcess.prototype.spawn = function(options) {
      var self = this,
          ipc,
          ipcFd,
          // If no `stdio` option was given - use default
    Severity: Major
    Found in lib/child_process.js - About 2 hrs to fix

      Function readFileSync has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      fs.readFileSync = function(path, options) {
        if (!options) {
          options = { encoding: null, flag: 'r' };
        } else if (util.isString(options)) {
          options = { encoding: options, flag: 'r' };
      Severity: Major
      Found in lib/fs.js - About 2 hrs to fix

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

        function completion (args, cb) {
          if (process.platform === "win32") {
            var e = new Error("npm completion not supported on windows")
            e.code = "ENOTSUP"
            e.errno = require("constants").ENOTSUP
        Severity: Major
        Found in deps/npm/lib/completion.js - About 2 hrs to fix

          Function mutate has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function mutate (pkg, user, mutation, cb) {
            if (user) {
              var byUser = "-/user/org.couchdb.user:" + user
              mapToRegistry(byUser, npm.config, function (er, uri, auth) {
                if (er) return cb(er)
          Severity: Major
          Found in deps/npm/lib/owner.js - About 2 hrs to fix

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

            Readable.prototype.read = function(n) {
              debug('read', n);
              var state = this._readableState;
              var nOrig = n;
            
            
            Severity: Major
            Found in lib/_stream_readable.js - About 2 hrs to fix

              Function runBlock7 has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function runBlock7() {
                  for (var i = 0; i < 9; i++) {
                    '0'.replace(re40, '');
                    '0'.replace(re10, '');
                    '0'.replace(re51, '');
              Severity: Major
              Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language