Showing 1,896 of 2,859 total issues

Function output_context has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def output_context(self, f, details):
    exception_thread = self.reader.thread_map[self.reader.exception.thread_id]
    f.write("<h3>Exception context</h3>")
    f.write('<div class="code">\n')
    f.write("Thread id: %d" % exception_thread.id)
Severity: Minor
Found in deps/v8/tools/grokdump.py - About 55 mins 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 __init__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def __init__(self, minidump_name, reader):
    self.comment_file = minidump_name + ".comments"
    self.address_comments = {}
    self.page_address = {}
    if os.path.exists(self.comment_file):
Severity: Minor
Found in deps/v8/tools/grokdump.py - About 55 mins 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 FlattenRunnables has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def FlattenRunnables(node):
  """Generator that traverses the tree structure and iterates over all
  runnables.
  """
  if isinstance(node, Runnable):
Severity: Minor
Found in deps/v8/tools/run_benchmarks.py - About 55 mins 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 IsProbableExecutableRegion has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def IsProbableExecutableRegion(self, location, length):
    opcode_bytes = 0
    sixty_four = self.arch == MD_CPU_ARCHITECTURE_AMD64
    for loc in xrange(location, location + length):
      byte = ctypes.c_uint8.from_buffer(self.minidump, loc).value
Severity: Minor
Found in deps/v8/tools/grokdump.py - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
Open

  def FindFilesIn(self, path):
    result = []
    for (root, dirs, files) in os.walk(path):
      for ignored in [x for x in dirs if self.IgnoreDir(x)]:
        dirs.remove(ignored)
Severity: Minor
Found in deps/v8/tools/presubmit.py - About 55 mins 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 ExpandMacroDefinition has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def ExpandMacroDefinition(lines, pos, name_pattern, macro, expander):
  pattern_match = name_pattern.search(lines, pos)
  while pattern_match is not None:
    # Scan over the arguments
    height = 1
Severity: Minor
Found in deps/v8/tools/js2c.py - About 55 mins 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 RunStep has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def RunStep(self):
    last_push = self._options.last_push or self.FindLastTrunkPush()
    while True:
      # Print assumed commit, circumventing git's pager.
      print self.GitLog(n=1, git_hash=last_push)
Severity: Minor
Found in deps/v8/tools/push-to-trunk/push_to_trunk.py - About 55 mins 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 get_dump_formatter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def get_dump_formatter(self, name):
    if name is None:
      return self.default_formatter
    else:
      if not DUMP_FILE_RE.match(name):
Severity: Minor
Found in deps/v8/tools/grokdump.py - About 55 mins 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 _CheckUnwantedDependencies has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def _CheckUnwantedDependencies(input_api, output_api):
  """Runs checkdeps on #include statements added in this
  change. Breaking - rules is an error, breaking ! rules is a
  warning.
  """
Severity: Minor
Found in deps/v8/PRESUBMIT.py - About 55 mins 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 handle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def handle(self):
    rec = compression.Receiver(self.request)
    while not rec.IsDone():
      data = rec.Current()
      action = data[0]
Severity: Minor
Found in deps/v8/tools/testrunner/server/local_handler.py - About 55 mins 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 __str__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def __str__(self):
    s = [self.name, "("]
    argcount = self.argslength
    if argcount < 0:
      print("WARNING: unknown argslength for function %s" % self.name)
Severity: Minor
Found in deps/v8/tools/generate-runtime-tests.py - About 55 mins 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 HasRun has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def HasRun(self, test, has_unexpected_output):
    self.progress_indicator.HasRun(test, has_unexpected_output)
    fail_text = ""
    if has_unexpected_output:
      stdout = test.output.stdout.strip()
Severity: Minor
Found in deps/v8/tools/testrunner/local/progress.py - About 55 mins 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 ReadStatusFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def ReadStatusFile(path, variables):
  with open(path) as f:
    global KEYWORDS
    contents = eval(f.read(), KEYWORDS)

Severity: Minor
Found in deps/v8/tools/testrunner/local/statusfile.py - About 55 mins 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 HasRun has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def HasRun(self, test, has_unexpected_output):
    if has_unexpected_output:
      self.ClearLine(self.last_status_length)
      self.PrintFailureHeader(test)
      stdout = test.output.stdout.strip()
Severity: Minor
Found in deps/v8/tools/testrunner/local/progress.py - About 55 mins 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 listen has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

function listen(self, address, port, addressType, backlog, fd, exclusive) {
Severity: Major
Found in lib/net.js - About 50 mins to fix

    Function doWrite has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function doWrite(stream, state, writev, len, chunk, encoding, cb) {
    Severity: Major
    Found in lib/_stream_writable.js - About 50 mins to fix

      Function lifecycle_ has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) {
      Severity: Major
      Found in deps/npm/lib/utils/lifecycle.js - About 50 mins to fix

        Function unpack_ has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) {
        Severity: Major
        Found in deps/npm/lib/utils/tar.js - About 50 mins to fix

          Function gunzTarPerm has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) {
          Severity: Major
          Found in deps/npm/lib/utils/tar.js - About 50 mins to fix

            Function unpack has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function unpack (tarball, unpackTarget, dMode, fMode, uid, gid, cb) {
            Severity: Major
            Found in deps/npm/lib/utils/tar.js - About 50 mins to fix
              Severity
              Category
              Status
              Source
              Language