Showing 2,859 of 2,859 total issues

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

def try_unlink(path):
  try:
    os.unlink(path)
  except OSError, e:
    if e.errno != errno.ENOENT: raise
Severity: Major
Found in tools/install.py and 1 other location - About 1 hr to fix
tools/install.py on lines 42..46

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

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 StartPositionAndTypeOffset(self):
    return 12 * self.heap.PointerSize() + 5 * self.heap.IntSize()
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 1388..1389

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

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

    self.WriteVariableList(ninja_file, 'includes',
        [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
Severity: Major
Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/generator/ninja.py on lines 933..934

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

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

      self.WriteVariableList(ninja_file, 'resource_includes',
          [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
Severity: Major
Found in tools/gyp/pylib/gyp/generator/ninja.py and 1 other location - About 1 hr to fix
tools/gyp/pylib/gyp/generator/ninja.py on lines 859..860

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

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 _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

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

          exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
            var callbackCalled = false;
          
            function call(a, b, c) {
              if (callback && !callbackCalled) {
          Severity: Minor
          Found in lib/util.js - About 1 hr to fix

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

            TLSSocket.prototype.renegotiate = function(options, callback) {
              var requestCert = this._requestCert,
                  rejectUnauthorized = this._rejectUnauthorized;
            
              if (typeof options.requestCert !== 'undefined')
            Severity: Minor
            Found in lib/_tls_wrap.js - About 1 hr to fix

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

              function GetCompletions(global, last, full) {
                var full_tokens = full.split();
                full = full_tokens.pop();
                var parts = full.split('.');
                parts.pop();
              Severity: Minor
              Found in deps/v8/src/d8.js - About 1 hr to fix

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

                function formatScope_(scope) {
                  var result = '';
                  var index = scope.index;
                  result += '#' + (index <= 9 ? '0' : '') + index;
                  result += ' ';
                Severity: Minor
                Found in deps/v8/src/d8.js - About 1 hr to fix

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

                  function bnToString(b) {
                    var this_array = this.array;
                    if(this.s < 0) return "-"+this.negate().toString(b);
                    var k;
                    if(b == 16) k = 4;
                  Severity: Minor
                  Found in deps/v8/benchmarks/crypto.js - About 1 hr to fix

                    Function cleanup has 27 lines of code (exceeds 25 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 1 hr to fix

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

                      runScript.completion = function (opts, cb) {
                      
                        // see if there's already a package specified.
                        var argv = opts.conf.argv.remain
                      
                      
                      Severity: Minor
                      Found in deps/npm/lib/run-script.js - About 1 hr to fix

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

                        function viewMan (man, cb) {
                          var nre = /([0-9]+)$/
                          var num = man.match(nre)[1]
                          var section = path.basename(man, "." + num)
                        
                        
                        Severity: Minor
                        Found in deps/npm/lib/help.js - About 1 hr to fix

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

                          function linkBins (pkg, folder, parent, gtop, cb) {
                            if (!pkg.bin || !gtop && path.basename(parent) !== "node_modules") {
                              return cb()
                            }
                            var binRoot = gtop ? npm.globalBin
                          Severity: Minor
                          Found in deps/npm/lib/build.js - About 1 hr to fix

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

                            function fetchAndShaCheck (u, tmp, shasum, auth, cb) {
                              npm.registry.fetch(u, { auth : auth }, function (er, response) {
                                if (er) {
                                  log.error("fetch failed", u)
                                  return cb(er, response)
                            Severity: Minor
                            Found in deps/npm/lib/cache/add-remote-tarball.js - About 1 hr to fix

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

                              function mirrorRemote (from, cloneURL, treeish, cachedRemote, silent, cb) {
                                mkdir(cachedRemote, function (er) {
                                  if (er) return cb(er)
                              
                                  var args = [
                              Severity: Minor
                              Found in deps/npm/lib/cache/add-remote-git.js - About 1 hr to fix

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

                                def _GenerateMSVSProject(project, options, version, generator_flags):
                                  """Generates a .vcproj file.  It may create .rules and .user files too.
                                
                                  Arguments:
                                    project: The project object we will generate the file for.
                                Severity: Minor
                                Found in tools/gyp/pylib/gyp/generator/msvs.py - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language