Showing 2,859 of 2,859 total issues

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

  def __RenderOurModuleFlags(self, module, output_lines, prefix=""):
    """Generates a help string for a given module."""
    flags = self._GetFlagsDefinedByModule(module)
    if flags:
      self.__RenderModuleFlags(module, flags, output_lines, prefix)
Severity: Major
Found in tools/closure_linter/gflags.py and 1 other location - About 1 hr to fix
tools/closure_linter/gflags.py on lines 1201..1212

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 41.

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 transitions.__class__ == FixedArray:
      TransitionArray(transitions).Print(p)
    else:
      p.Print("TransitionsOrBackPointer: %s" % (transitions))
Severity: Major
Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
deps/v8/tools/grokdump.py on lines 1048..1051

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 41.

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 descriptors.__class__ == FixedArray:
      DescriptorArray(descriptors).Print(p)
    else:
      p.Print("Descriptors: %s" % (descriptors))
Severity: Major
Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
deps/v8/tools/grokdump.py on lines 1054..1057

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 41.

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

  def __RenderOurModuleKeyFlags(self, module, output_lines, prefix=""):
    """Generates a help string for the key flags of a given module.

    Args:
      module: A module object or a module name (a string).
Severity: Major
Found in tools/closure_linter/gflags.py and 1 other location - About 1 hr to fix
tools/closure_linter/gflags.py on lines 1195..1199

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 41.

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

        'VCManifestTool': {
            'AdditionalManifestFiles': 'file1;file2;file3',
            'AdditionalOptions': 'a_string',
            'AssemblyIdentity': 'a_string',
            'ComponentFileName': 'a_file_name',
Severity: Major
Found in tools/gyp/pylib/gyp/MSVSSettings_test.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/MSVSSettings_test.py on lines 1284..1304

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 41.

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

generator_default_variables = {
    'EXECUTABLE_PREFIX': '',
    'EXECUTABLE_SUFFIX': '.exe',
    'STATIC_LIB_PREFIX': '',
    'SHARED_LIB_PREFIX': '',
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/cmake.py on lines 38..55

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 41.

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

        'VCManifestTool': {
            'AdditionalManifestFiles': 'sfsdfsd',
            'AdditionalOptions': 'afdsdafsd',
            'AssemblyIdentity': 'sddfdsadfsa',
            'ComponentFileName': 'fsdfds',
Severity: Major
Found in tools/gyp/pylib/gyp/MSVSSettings_test.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/MSVSSettings_test.py on lines 853..872

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 41.

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

  def Hashables(self):
    # super
    hashables = XCObject.Hashables(self)

    # It is not sufficient to just rely on Name() to get the
Severity: Major
Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/xcodeproj_file.py on lines 2105..2111

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 41.

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

  def Hashables(self):
    # super
    hashables = XCObject.Hashables(self)

    # Use the hashables of the weak objects that this object refers to.
Severity: Major
Found in tools/gyp/pylib/gyp/xcodeproj_file.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/xcodeproj_file.py on lines 1716..1728

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 41.

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

generator_default_variables = {
  'EXECUTABLE_PREFIX': '',
  'EXECUTABLE_SUFFIX': '',
  'STATIC_LIB_PREFIX': 'lib',
  'STATIC_LIB_SUFFIX': '.a',
Severity: Major
Found in tools/gyp/pylib/gyp/generator/cmake.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/generator/msvs.py on lines 47..64

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 41.

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 highlight has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function highlight(prefix, suffix, tag) {
  var nodeList = document.getElementsByTagName(tag);
  for (var i = 0; i < nodeList.length; i++) {
    var element = nodeList.item(i);
    var htmlClasses = sh_getClasses(element);
Severity: Minor
Found in doc/sh_main.js - About 1 hr to fix

    Function processKillAndExit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      startup.processKillAndExit = function() {
    
        process.exit = function(code) {
          if (code || code === 0)
            process.exitCode = code;
    Severity: Minor
    Found in src/node.js - About 1 hr to fix

      Function defaultEval has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function defaultEval(code, context, file, cb) {
          var err, result;
          // first, create the Script object to check the syntax
          try {
            var script = vm.createScript(code, {
      Severity: Minor
      Found in lib/repl.js - About 1 hr to fix

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

        fs.write = function(fd, buffer, offset, length, position, callback) {
          function strWrapper(err, written) {
            // Retain a reference to buffer so that it can't be GC'ed too soon.
            callback(err, written || 0, buffer);
          }
        Severity: Minor
        Found in lib/fs.js - About 1 hr to fix

          Function Server has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Server(options, connectionListener) {
            if (!(this instanceof Server))
              return new Server(options, connectionListener);
          
            events.EventEmitter.call(this);
          Severity: Minor
          Found in lib/net.js - About 1 hr to fix

            Function writeHead has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            ServerResponse.prototype.writeHead = function(statusCode, reason, obj) {
              var headers;
            
              if (util.isString(reason)) {
                // writeHead(statusCode, reasonPhrase[, headers])
            Severity: Minor
            Found in lib/_http_server.js - About 1 hr to fix

              Function _addHeaderLine has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              IncomingMessage.prototype._addHeaderLine = function(field, value, dest) {
                field = field.toLowerCase();
                switch (field) {
                  // Array headers:
                  case 'set-cookie':
              Severity: Minor
              Found in lib/_http_incoming.js - About 1 hr to fix

                Function queryServer has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function queryServer(worker, message) {
                    var args = [message.address,
                                message.port,
                                message.addressType,
                                message.fd];
                Severity: Minor
                Found in lib/cluster.js - About 1 hr to fix

                  Function addRequest has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Agent.prototype.addRequest = function(req, options) {
                    // Legacy API: addRequest(req, host, port, path)
                    if (typeof options === 'string') {
                      options = {
                        host: options,
                  Severity: Minor
                  Found in lib/_http_agent.js - About 1 hr to fix

                    Function draw has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    PausePlot.prototype.draw = function () {
                      var first = null;
                    
                      if (this.autoScale) {
                        this.iteratePauses(function (i, v) {
                    Severity: Minor
                    Found in deps/v8/benchmarks/spinning-balls/v.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language