Showing 2,859 of 2,859 total issues

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

Writer.prototype.write = function(chunk, encoding, cb) {
  this.received += chunk.length;

  if (typeof encoding === 'function')
    encoding();
Severity: Major
Found in benchmark/net/net-s2c.js and 2 other locations - About 2 hrs to fix
benchmark/net/net-c2s.js on lines 51..60
benchmark/net/net-pipe.js on lines 51..60

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

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

    (sc_const_4_nboyer = (new sc_Pair("\u1E9Cimplies",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cu",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cw",null)))))),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cw",null)))))),null)))))));
Severity: Major
Found in deps/v8/benchmarks/earley-boyer.js and 1 other location - About 2 hrs to fix
deps/v8/benchmarks/earley-boyer.js on lines 3466..3466

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

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 (storedBuffer[n] === undefined) {
      storedBuffer[n] = new Buffer(n);
      for (var i = 0; i < n; i++) {
        storedBuffer[n][i] = 'C'.charCodeAt(0);
      }
Severity: Major
Found in benchmark/http_simple.js and 1 other location - About 2 hrs to fix
benchmark/http_simple_auto.js on lines 47..52

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

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 (storedBuffer[n] === undefined) {
      storedBuffer[n] = new Buffer(n);
      for (var i = 0; i < n; i++) {
        storedBuffer[n][i] = "C".charCodeAt(0);
      }
Severity: Major
Found in benchmark/http_simple_auto.js and 1 other location - About 2 hrs to fix
benchmark/http_simple.js on lines 52..57

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

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

File progress.py has 252 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
Severity: Minor
Found in deps/v8/tools/testrunner/local/progress.py - About 2 hrs to fix

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

    CryptoStream.prototype._write = function write(data, encoding, cb) {
      assert(util.isNull(this._pending));
    
      // Black-hole data
      if (!this.pair.ssl) return cb(null);
    Severity: Major
    Found in lib/_tls_legacy.js - About 2 hrs to fix

      Function client has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function client() {
        var chunk;
        switch (type) {
          case 'buf':
            chunk = new Buffer(len);
      Severity: Major
      Found in benchmark/net/tcp-raw-c2s.js - About 2 hrs to fix

        Function bnModPow has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function bnModPow(e,m) {
          var e_array = e.array;
          var i = e.bitLength(), k, r = nbv(1), z;
          if(i <= 0) return r;
          else if(i < 18) k = 1;
        Severity: Major
        Found in deps/v8/benchmarks/crypto.js - About 2 hrs to fix

          Function publish_ has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function publish_ (arg, data, isRetry, cachedir, cb) {
            if (!data) return cb(new Error("no package.json file found"))
          
            var mappedConfig = getPublishConfig(
              data.publishConfig,
          Severity: Major
          Found in deps/npm/lib/publish.js - About 2 hrs to fix

            Function runCmd_ has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) {
            
              function cb (er) {
                cb_.apply(null, arguments)
                log.resume()
            Severity: Major
            Found in deps/npm/lib/utils/lifecycle.js - About 2 hrs to fix

              File config.js has 251 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              
              module.exports = config
              
              config.usage = "npm config set <key> <value>"
                           + "\nnpm config get [<key>]"
              Severity: Minor
              Found in deps/npm/lib/config.js - About 2 hrs to fix

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

                function main(conf) {
                  dur = +conf.dur;
                  type = conf.type;
                  size = +conf.size;
                
                
                Severity: Minor
                Found in benchmark/tls/throughput.js - About 2 hrs to fix

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

                  function main(conf) {
                    var dur = +conf.dur;
                    var len = +conf.bytes;
                  
                    var encoding;
                  Severity: Minor
                  Found in benchmark/http/client-request-body.js - About 2 hrs to fix

                    Function andBuildResolvedTree has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          function andBuildResolvedTree (er, current) {
                            if (er) return cb(er)
                    
                            // each target will be a data object corresponding
                            // to a package, folder, or whatever that is in the cache now.
                    Severity: Minor
                    Found in deps/npm/lib/install.js - About 2 hrs to fix

                      Function getCredentialsByURI has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getCredentialsByURI (uri) {
                        assert(uri && typeof uri === "string", "registry URL is required")
                        var nerfed = toNerfDart(uri)
                        var defnerf = toNerfDart(this.get("registry"))
                      
                      
                      Severity: Minor
                      Found in deps/npm/lib/config/get-credentials-by-uri.js - About 2 hrs to fix

                        Consider simplifying this complex logical expression.
                        Open

                              if ext in ('cc', 'cpp', 'cxx'):
                                command = 'cxx'
                                self.uses_cpp = True
                              elif ext == 'c' or (ext == 'S' and self.flavor != 'win'):
                                command = 'cc'
                        Severity: Critical
                        Found in tools/gyp/pylib/gyp/generator/ninja.py - About 2 hrs to fix

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

                                npm.registry.distTags.add(base, params, function (er) {
                                  if (er) return cb(er)
                          
                                  console.log("+"+t+": "+pkg+"@"+version)
                                  cb()
                          Severity: Major
                          Found in deps/npm/lib/dist-tag.js and 1 other location - About 2 hrs to fix
                          deps/npm/lib/dist-tag.js on lines 104..109

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

                          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

                                npm.registry.distTags.rm(base, params, function (er) {
                                  if (er) return cb(er)
                          
                                  console.log("-"+tag+": "+pkg+"@"+version)
                                  cb()
                          Severity: Major
                          Found in deps/npm/lib/dist-tag.js and 1 other location - About 2 hrs to fix
                          deps/npm/lib/dist-tag.js on lines 73..78

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

                          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 3 locations. Consider refactoring.
                          Open

                            plain_arg_parser = ArgParser(
                                re.compile("^\s*CONVERT_ARG_CHECKED\((\w+), (\w+), (\d+)\)"),
                                lambda match: Arg(match.group(1), match.group(2), int(match.group(3))))
                          Severity: Major
                          Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 2 hrs to fix
                          deps/v8/tools/generate-runtime-tests.py on lines 802..804
                          deps/v8/tools/generate-runtime-tests.py on lines 822..825

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

                          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 3 locations. Consider refactoring.
                          Open

                            number_arg_parser = ArgParser(
                                re.compile(
                                    "^\s*CONVERT_NUMBER_CHECKED\(\w+, (\w+), (\w+), args\[(\d+)\]\)"),
                                lambda match: Arg(match.group(2), match.group(1), int(match.group(3))))
                          Severity: Major
                          Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 2 hrs to fix
                          deps/v8/tools/generate-runtime-tests.py on lines 802..804
                          deps/v8/tools/generate-runtime-tests.py on lines 806..808

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

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language