Showing 1,896 of 2,859 total issues

Function _DefaultSdkRoot has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def _DefaultSdkRoot(self):
    """Returns the default SDKROOT to use.

    Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode
    project, then the environment variable was empty. Starting with this
Severity: Minor
Found in tools/gyp/pylib/gyp/xcode_emulation.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 files has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def files(action):
  action(['out/Release/node'], 'bin/node')

  if 'true' == variables.get('node_use_dtrace'):
    action(['out/Release/node.d'], 'lib/dtrace/node.d')
Severity: Minor
Found in tools/install.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 __call__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def __call__(self, x, y):
    def get_string(node):
      node_string = "node"
      node_string += node.nodeName
      if node.nodeValue:
Severity: Minor
Found in tools/gyp/tools/pretty_vcproj.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 FixFilenames has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def FixFilenames(filenames, current_directory):
  new_list = []
  for filename in filenames:
    if filename:
      for key in REPLACEMENTS:
Severity: Minor
Found in tools/gyp/tools/pretty_vcproj.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 RegenerateAppendFlag has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def RegenerateAppendFlag(flag, values, predicate, env_name, options):
  """Regenerate a list of command line flags, for an option of action='append'.

  The |env_name|, if given, is checked in the environment and used to generate
  an initial list of options, then the options that were specified on the
Severity: Minor
Found in tools/gyp/pylib/gyp/__init__.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 GuessOS has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def GuessOS():
  id = platform.system()
  if id == 'Linux':
    return 'linux'
  elif id == 'Darwin':
Severity: Minor
Found in tools/utils.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 FindWordList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def FindWordList(self, word):
    aligned_res = []
    unaligned_res = []
    def search_inside_region(reader, start, size, location):
      for loc in xrange(location, location + size - self.PointerSize()):
Severity: Minor
Found in deps/v8/tools/grokdump.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 Call has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def Call(self, name, *args):  # pragma: no cover
    self._index += 1
    try:
      expected_call = self._recipe[self._index]
    except IndexError:
Severity: Minor
Found in deps/v8/tools/push-to-trunk/test_scripts.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 UpdateCounters has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def UpdateCounters(self):
    """Read the contents of the memory-mapped file and update the ui if
    necessary.  If the same counters are present in the file as before
    we just update the existing labels.  If any counters have been added
    or removed we scrap the existing ui and draw a new one.
Severity: Minor
Found in deps/v8/tools/stats-viewer.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 RunStep has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def RunStep(self):
    self["patch_commit_hashes"] = []
    for revision in self["full_revision_list"]:
      next_hash = self.GitSVNFindGitHash(revision, "svn/bleeding_edge")
      if not next_hash:  # pragma: no cover
Severity: Minor
Found in deps/v8/tools/push-to-trunk/merge_to_branch.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 GuessOS has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def GuessOS():
  system = platform.system()
  if system == 'Linux':
    return 'linux'
  elif system == 'Darwin':
Severity: Minor
Found in deps/v8/tools/testrunner/local/utils.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 _AddOutcome has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _AddOutcome(result, new):
  global DEFS
  if new in DEFS:
    mapped = DEFS[new]
    if type(mapped) == list:
Severity: Minor
Found in deps/v8/tools/testrunner/local/statusfile.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 PeriodicTasks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def PeriodicTasks(self):
    # If we know peers we don't trust, see if someone else trusts them.
    with self.peer_list_lock:
      for p in self.peers:
        if p.trusted: continue
Severity: Minor
Found in deps/v8/tools/testrunner/server/main.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 stop has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def stop(self):
    """
    Stop the daemon
    """
    # Get the pid from the pidfile
Severity: Minor
Found in deps/v8/tools/testrunner/server/daemon.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 _MaybeRerun has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def _MaybeRerun(self, pool, test):
    if test.run <= self.context.rerun_failures_count:
      # Possibly rerun this test if its run count is below the maximum per
      # test. <= as the flag controls reruns not including the first run.
      if test.run == 1:
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 Execute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def Execute(workspace, ctx, tests, sock, server):
  suite_paths = utils.GetSuitePaths(os.path.join(workspace, "test"))
  suites = []
  for root in suite_paths:
    suite = testsuite.TestSuite.LoadTestSuite(
Severity: Minor
Found in deps/v8/tools/testrunner/network/endpoint.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 _getDisplayPos has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Interface.prototype._getDisplayPos = function(str) {
  var offset = 0;
  var col = this.columns;
  var row = 0;
  var code;
Severity: Minor
Found in lib/readline.js - About 1 hr to fix

    Function write has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      this.write = function(paragraph) {
        if (!did_write_anything) {
          emitHeader();
          did_write_anything = true;
        }
    Severity: Minor
    Found in tools/license2rtf.js - About 1 hr to fix

      Function newSection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function newSection(tok) {
        var section = {};
        // infer the type from the text.
        var text = section.textRaw = tok.text;
        if (text.match(eventExpr)) {
      Severity: Minor
      Found in tools/doc/json.js - About 1 hr to fix

        Function normalizeSpawnArguments has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function normalizeSpawnArguments(file /*, args, options*/) {
          var args, options;
        
          if (Array.isArray(arguments[1])) {
            args = arguments[1].slice(0);
        Severity: Minor
        Found in lib/child_process.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language