Showing 2,859 of 2,859 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

def Win32SetErrorMode(mode):
  prev_error_mode = SEM_INVALID_VALUE
  try:
    import ctypes
    prev_error_mode = \
Severity: Major
Found in deps/v8/tools/testrunner/local/commands.py and 1 other location - About 1 hr to fix
tools/test.py on lines 507..514

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    return [self.arch, self.mode, self.mode_flags, self.timeout, self.isolates,
            self.command_prefix, self.extra_flags, self.noi18n,
            self.random_seed, self.no_sorting, self.rerun_failures_count,
            self.rerun_failures_max, self.predictable]
Severity: Major
Found in deps/v8/tools/testrunner/objects/context.py and 1 other location - About 1 hr to fix
deps/v8/tools/generate-runtime-tests.py on lines 711..717

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  path = path.replace('$(InputExt)',
                      os.path.splitext(os.path.split(input_file)[1])[1])
Severity: Major
Found in tools/gyp/pylib/gyp/generator/msvs.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/generator/msvs.py on lines 511..512

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  for target in flat_list:
    target_dict = targets[target]
    build_file = gyp.common.BuildFile(target)
    ProcessVariablesAndConditionsInDict(
        target_dict, PHASE_LATE, variables, build_file)
Severity: Major
Found in tools/gyp/pylib/gyp/input.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/input.py on lines 2781..2785

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

      function = random.choice([self._JSArrayBuffer, self._JSDataView,
                                self._JSDate, self._JSFunctionProxy,
                                self._JSGeneratorObject, self._JSMap,
                                self._JSMapIterator, self._JSRegExp,
                                self._JSSet, self._JSSetIterator,
Severity: Major
Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
deps/v8/tools/testrunner/objects/context.py on lines 51..54

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  for target in flat_list:
    target_dict = targets[target]
    build_file = gyp.common.BuildFile(target)
    ProcessVariablesAndConditionsInDict(
        target_dict, PHASE_LATELATE, variables, build_file)
Severity: Major
Found in tools/gyp/pylib/gyp/input.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/input.py on lines 2764..2768

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  if (not os.path.exists(pubkeyfile) or
      os.path.getmtime(pubkeyfile) < os.path.getmtime(privkeyfile)):
Severity: Major
Found in deps/v8/tools/test-server.py and 1 other location - About 1 hr to fix
deps/v8/tools/testrunner/server/signatures.py on lines 38..39

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  if (not os.path.exists(signature_file) or
      os.path.getmtime(signature_file) < os.path.getmtime(filename)):
Severity: Major
Found in deps/v8/tools/testrunner/server/signatures.py and 1 other location - About 1 hr to fix
deps/v8/tools/test-server.py on lines 103..104

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  path = path.replace('$(InputName)',
                      os.path.splitext(os.path.split(input_file)[1])[0])
Severity: Major
Found in tools/gyp/pylib/gyp/generator/msvs.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/generator/msvs.py on lines 514..515

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    elif isinstance(item, str):
      expanded = ExpandVariables(item, phase, variables, build_file)
      if isinstance(expanded, str) or isinstance(expanded, int):
        the_list[index] = expanded
      elif isinstance(expanded, list):
Severity: Major
Found in tools/gyp/pylib/gyp/input.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/input.py on lines 1231..1240

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    elif isinstance(value, list):
      # The list itself can't influence the variables dict, and
      # ProcessVariablesAndConditionsInList will make copies of the variables
      # dict if it needs to pass it to something that can influence it.  No
      # copy is necessary here.
Severity: Major
Found in tools/gyp/pylib/gyp/input.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/input.py on lines 1255..1273

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 40.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function sh_extractTagsFromNodeList has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function sh_extractTagsFromNodeList(nodeList, result) {
  var length = nodeList.length;
  for (var i = 0; i < length; i++) {
    var node = nodeList.item(i);
    switch (node.nodeType) {
Severity: Minor
Found in doc/sh_main.js - About 1 hr to fix

    Function createContext has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    REPLServer.prototype.createContext = function() {
      var context;
      if (this.useGlobal) {
        context = global;
      } else {
    Severity: Minor
    Found in lib/repl.js - About 1 hr to fix

      Function close has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Server.prototype.close = function(cb) {
        function onSlaveClose() {
          if (--left !== 0) return;
      
          self._connections = 0;
      Severity: Minor
      Found in lib/net.js - About 1 hr to fix

        Function watchers has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Interface.prototype.watchers = function() {
          var self = this,
              verbose = arguments[0] || false,
              callback = arguments[1] || function() {},
              waiting = this._watchers.length,
        Severity: Minor
        Found in lib/_debugger.js - About 1 hr to fix

          Function compare has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function compare() {
            // each result is an object with {"foo.js arg=bar":12345,...}
            // compare each thing, and show which node did the best.
            // node[0] is shown in green, node[1] shown in red.
            var maxLen = -Infinity;
          Severity: Minor
          Found in benchmark/compare.js - About 1 hr to fix

            Function SnapshotLogProcessor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function SnapshotLogProcessor() {
              LogReader.call(this, {
                  'code-creation': {
                      parsers: [null, parseInt, parseInt, parseInt, null, 'var-args'],
                      processor: this.processCodeCreation },
            Severity: Minor
            Found in deps/v8/tools/tickprocessor.js - About 1 hr to fix

              Function sc_escapeWriteString has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function sc_escapeWriteString(s) {
                  var res = "";
                  var j = 0;
                  for (i = 0; i < s.length; i++) {
                  switch (s.charAt(i)) {
              Severity: Minor
              Found in deps/v8/benchmarks/earley-boyer.js - About 1 hr to fix

                Function _transform has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Client.prototype._transform = function _transform(data, enc, cb) {
                  cb();
                
                  this.buffer += data;
                
                
                Severity: Minor
                Found in deps/debugger-agent/lib/_debugger_agent.js - About 1 hr to fix

                  Function filter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function filter (data, args, set, seen) {
                    if (!set) set = {}
                    if (!seen) seen = {}
                    if (set.hasOwnProperty(data.path)) return set
                    if (seen.hasOwnProperty(data.path)) return set
                  Severity: Minor
                  Found in deps/npm/lib/rebuild.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language