Showing 1,896 of 2,859 total issues

Function sc_prepWriteCircle has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function sc_prepWriteCircle(o, symb, nbPointer) {
    // TODO sc_Struct
    if (o instanceof sc_Pair ||
    o instanceof sc_Vector) {
    if (o[symb] !== undefined) {
Severity: Minor
Found in deps/v8/benchmarks/earley-boyer.js - 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 UIWrapper has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function UIWrapper() {
  var input_elements = ["range_start",
                        "range_end",
                        "distortion",
                        "start",
Severity: Minor
Found in deps/v8/tools/profviz/profviz.js - 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 cleanup has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function cleanup (data) {
  if (Array.isArray(data)) {
    if (data.length === 1) {
      data = data[0]
    } else {
Severity: Minor
Found in deps/npm/lib/view.js - 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 addNameVersion has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function addNameVersion (name, v, data, cb) {
  var ver = semver.valid(v, true)
  if (!ver) return cb(new Error("Invalid version: "+v))

  var response
Severity: Minor
Found in deps/npm/lib/cache/add-named.js - 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 __RenderFlagList has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def __RenderFlagList(self, flaglist, output_lines, prefix="  "):
    fl = self.FlagDict()
    special_fl = _SPECIAL_FLAGS.FlagDict()
    flaglist = [(flag.name, flag) for flag in flaglist]
    flaglist.sort()
Severity: Minor
Found in tools/closure_linter/gflags.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 _GetExpectedMessages has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def _GetExpectedMessages(self, stream):
    """Parse a file and get a sorted list of expected messages."""
    messages = []
    for i, line in enumerate(stream):
      match = self._EXPECTED_RE.search(line)
Severity: Minor
Found in tools/closure_linter/closure_linter/common/filetestcase.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 WriteAndroidNdkModuleRule has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps):
    """Write a set of LOCAL_XXX definitions for Android NDK.

    These variable definitions will be used by Android NDK but do nothing for
    non-Android applications.
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/make.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 WriteOnDiff has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def WriteOnDiff(filename):
  """Write to a file only if the new contents differ.

  Arguments:
    filename: name of the file to potentially write to.
Severity: Minor
Found in tools/gyp/pylib/gyp/common.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 _DetectVisualStudioVersions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def _DetectVisualStudioVersions(versions_to_check, force_express):
  """Collect the list of installed visual studio versions.

  Returns:
    A list of visual studio versions installed in descending order of
Severity: Minor
Found in tools/gyp/pylib/gyp/MSVSVersion.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 FindEnclosingBracketGroup has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def FindEnclosingBracketGroup(input_str):
  stack = []
  start = -1
  for index, char in enumerate(input_str):
    if char in LBRACKETS:
Severity: Minor
Found in tools/gyp/pylib/gyp/input.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 Tokenize has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def Tokenize(self):
    self.tokens = [ ]
    while self.HasMore():
      self.SkipSpaces()
      if not self.HasMore():
Severity: Minor
Found in tools/test.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 MakeChangeLogBody has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def MakeChangeLogBody(commit_messages, auto_format=False):
  result = ""
  added_titles = set()
  for (title, body, author) in commit_messages:
    # TODO(machenbach): Better check for reverts. A revert should remove the
Severity: Minor
Found in deps/v8/tools/push-to-trunk/common_includes.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 ProcessOptions has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def ProcessOptions(options):
  global VARIANT_FLAGS

  # Architecture and mode related stuff.
  if options.arch_and_mode:
Severity: Minor
Found in deps/v8/tools/run-deopt-fuzzer.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 Update has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def Update():
  # Create directory for private data storage.
  data_dir = os.path.join(ROOT, "data")
  if not os.path.exists(data_dir):
    os.makedirs(data_dir)
Severity: Minor
Found in deps/v8/tools/test-server.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 PrintReport has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def PrintReport(tests):
  total = len(tests)
  skipped = timeout = nocrash = passes = fail_ok = fail = 0
  for t in tests:
    if "outcomes" not in dir(t) or not t.outcomes:
Severity: Minor
Found in deps/v8/tools/testrunner/local/verbose.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 parseLists has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function parseLists(input) {
  var state = null;
  var depth = 0;
  var output = [];
  output.links = input.links;
Severity: Major
Found in tools/doc/html.js - About 2 hrs to fix

    Function main has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function main(conf) {
      var dur = +conf.dur;
      var type = conf.type;
      var size = +conf.size;
      var encoding;
    Severity: Major
    Found in benchmark/fs/write-stream-throughput.js - About 2 hrs to fix

      Function runBlock5 has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function runBlock5() {
          for (var i = 0; i < 13; i++) {
            'purpx'.replace(re14, '');
            'purpx'.replace(re15, '');
            'pvgl'.replace(re14, '');
      Severity: Major
      Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

        Function OD has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            .on("data", function OD (c) {
              // detect what it is.
              // Then, depending on that, we'll figure out whether it's
              // a single-file module, gzipped tarball, or naked tarball.
              // gzipped files all start with 1f8b08
        Severity: Major
        Found in deps/npm/lib/utils/tar.js - About 2 hrs to fix

          Function linkInstall has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function linkInstall (pkgs, cb) {
            asyncMap(pkgs, function (pkg, cb) {
              var t = path.resolve(npm.globalDir, "..")
                , pp = path.resolve(npm.globalDir, pkg)
                , rp = null
          Severity: Major
          Found in deps/npm/lib/link.js - About 2 hrs to fix
            Severity
            Category
            Status
            Source
            Language