Showing 1,896 of 2,859 total issues

Function GitLog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def GitLog(self, n=0, format="", grep="", git_hash="", parent_hash="",
             branch="", reverse=False):
    assert not (git_hash and parent_hash)
    args = ["log"]
    if n > 0:
Severity: Minor
Found in deps/v8/tools/push-to-trunk/git_recipes.py - About 35 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 do_lm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def do_lm(self, arg):
    """
     List details for all loaded modules in the minidump. An argument can
     be passed to limit the output to only those modules that contain the
     argument as a substring (case insensitive match).
Severity: Minor
Found in deps/v8/tools/grokdump.py - About 35 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 7 (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/status_handler.py - About 35 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 ReadLinesFrom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def ReadLinesFrom(name):
  lines = []
  with open(name) as f:
    for line in f:
      if line.startswith('#'): continue
Severity: Minor
Found in deps/v8/tools/testrunner/local/utils.py - About 35 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 decode_v8_value has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def decode_v8_value(v, bitness):
  base_str = 'v8[%x]' % v
  if has_smi_tag(v):
    if bitness == 32:
      return base_str + (" SMI(%d)" % smi_to_int_32(v))
Severity: Minor
Found in deps/v8/tools/gdb-v8-support.py - About 35 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 FindNewName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def FindNewName(self, var_name):
    """Finds a new 1-character or 2-character name for a variable.

    Enters it into the mapping table for this scope.

Severity: Minor
Found in deps/v8/tools/jsmin.py - About 35 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 terminate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def terminate(self):
    if self.terminated:
      return
    self.terminated = True

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

def DefaultArch():
  machine = platform.machine()
  machine = machine.lower()  # Windows 7 capitalizes 'AMD64'.
  if machine.startswith('arm'):
    return 'arm'
Severity: Minor
Found in deps/v8/tools/testrunner/local/utils.py - About 35 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

Avoid too many return statements within this function.
Open

        return;
Severity: Major
Found in tools/doc/html.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return false;
    Severity: Major
    Found in lib/child_process.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return ctx.stylize('' + value, 'boolean');
      Severity: Major
      Found in lib/util.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return actual.source === expected.source &&
                   actual.global === expected.global &&
                   actual.multiline === expected.multiline &&
                   actual.lastIndex === expected.lastIndex &&
                   actual.ignoreCase === expected.ignoreCase;
        Severity: Major
        Found in lib/assert.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              if (!_deepEqual(a[key], b[key])) return false;
          Severity: Major
          Found in lib/assert.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return ctx.stylize(value.toString(), 'symbol');
            Severity: Major
            Found in lib/util.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return ctx.stylize('[String: ' + formatted + ']', 'string');
              Severity: Major
              Found in lib/util.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return false;
                Severity: Major
                Found in lib/assert.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    return result;
                  Severity: Major
                  Found in lib/url.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return;
                    Severity: Major
                    Found in tools/doc/json.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return formatError(value);
                      Severity: Major
                      Found in lib/util.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return false;
                        Severity: Major
                        Found in lib/assert.js - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language