Showing 2,859 of 2,859 total issues

Function CallLoadTargetBuildFile has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

def CallLoadTargetBuildFile(global_flags,
Severity: Major
Found in tools/gyp/pylib/gyp/input.py - About 1 hr to fix

    Function Load has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def Load(build_files, variables, includes, depth, generator_input_info, check,
    Severity: Major
    Found in tools/gyp/pylib/gyp/input.py - About 1 hr to fix

      Function ExecLinkWithManifests has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname,
      Severity: Major
      Found in tools/gyp/pylib/gyp/win_tool.py - About 1 hr to fix

        Function ExecMidlWrapper has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl,
        Severity: Major
        Found in tools/gyp/pylib/gyp/win_tool.py - About 1 hr to fix

          Function kill has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          ChildProcess.prototype.kill = function(sig) {
            var signal;
          
            if (!constants) {
              constants = process.binding('constants');
          Severity: Minor
          Found in lib/child_process.js - About 1 hr to fix

            Function sh_load has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function sh_load(language, element, prefix, suffix) {
              if (language in sh_requests) {
                sh_requests[language].push(element);
                return;
              }
            Severity: Minor
            Found in doc/sh_main.js - About 1 hr to fix

              Function DiffieHellman has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) {
                if (!(this instanceof DiffieHellman))
                  return new DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding);
              
                if (!util.isBuffer(sizeOrKey) &&
              Severity: Minor
              Found in lib/crypto.js - About 1 hr to fix

                Function request has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Client.prototype.request = function(method, path, headers) {
                  var self = this;
                  var options = {};
                  options.host = self.host;
                  options.port = self.port;
                Severity: Minor
                Found in lib/http.js - About 1 hr to fix

                  Function removeAllListeners has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function removeAllListeners(type) {
                    var key, listeners;
                  
                    if (!this._events)
                      return this;
                  Severity: Minor
                  Found in lib/events.js - About 1 hr to fix

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

                    function main(conf) {
                      var api = conf.api;
                      if (api === 'stream' && process.version.match(/^v0\.[0-8]\./)) {
                        console.error('Crypto streams not available until v0.10');
                        // use the legacy, just so that we can compare them.
                    Severity: Minor
                    Found in benchmark/crypto/hash-stream-creation.js - About 1 hr to fix

                      Function http has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Benchmark.prototype.http = function(p, args, cb) {
                        var self = this;
                        var wrk = path.resolve(__dirname, '..', 'tools', 'wrk', 'wrk');
                        var regexp = /Requests\/sec:[ \t]+([0-9\.]+)/;
                        var spawn = require('child_process').spawn;
                      Severity: Minor
                      Found in benchmark/common.js - About 1 hr to fix

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

                        function main(conf) {
                          var api = conf.api;
                          if (api === 'stream' && process.version.match(/^v0\.[0-8]\./)) {
                            console.error('Crypto streams not available until v0.10');
                            // use the legacy, just so that we can compare them.
                        Severity: Minor
                        Found in benchmark/crypto/hash-stream-throughput.js - About 1 hr to fix

                          Function init has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function init (args, cb) {
                            var dir = process.cwd()
                            log.pause()
                            npm.spinner.stop()
                            var initFile = npm.config.get("init-module")
                          Severity: Minor
                          Found in deps/npm/lib/init.js - About 1 hr to fix

                            Function out has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              var out = results.map(function (res) {
                                var out = res.cmd
                                  , r = Object.keys(res.hits).map(function (k) {
                                      return k + ":" + res.hits[k]
                                    }).sort(function (a, b) {
                            Severity: Minor
                            Found in deps/npm/lib/help-search.js - About 1 hr to fix

                              Function linkMans has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function linkMans (pkg, folder, parent, gtop, cb) {
                                if (!pkg.man || !gtop || process.platform === "win32") return cb()
                              
                                var manRoot = path.resolve(npm.config.get("prefix"), "share", "man")
                                log.verbose("linkMans", "man files are", pkg.man, "in", manRoot)
                              Severity: Minor
                              Found in deps/npm/lib/build.js - About 1 hr to fix

                                Function _AddConfigurationToMSVSProject has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config):
                                  """Adds a configuration to the MSVS project.
                                
                                  Many settings in a vcproj file are specific to a configuration.  This
                                  function the main part of the vcproj file that's configuration specific.
                                Severity: Minor
                                Found in tools/gyp/pylib/gyp/generator/msvs.py - About 1 hr to fix

                                  Function GenerateOutputForConfig has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  def GenerateOutputForConfig(target_list, target_dicts, data,
                                                              params, config_to_use):
                                    options = params['options']
                                    generator_flags = params['generator_flags']
                                  
                                  
                                  Severity: Minor
                                  Found in tools/gyp/pylib/gyp/generator/cmake.py - About 1 hr to fix

                                    Function BuildOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    def BuildOptions():
                                      result = optparse.OptionParser()
                                      result.add_option("-m", "--mode", help="The test modes in which to run (comma-separated)",
                                          default='release')
                                      result.add_option("-v", "--verbose", help="Verbose output",
                                    Severity: Minor
                                    Found in tools/test.py - About 1 hr to fix

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

                                            if (size === 0) {
                                              // collected the data into the buffers list.
                                              buffer = Buffer.concat(buffers, pos);
                                            } else if (pos < size) {
                                              buffer = buffer.slice(0, pos);
                                      Severity: Major
                                      Found in lib/fs.js and 1 other location - About 1 hr to fix
                                      lib/fs.js on lines 411..416

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

                                      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 (size === 0) {
                                          // data was collected into the buffers list.
                                          buffer = Buffer.concat(buffers, pos);
                                        } else if (pos < size) {
                                          buffer = buffer.slice(0, pos);
                                      Severity: Major
                                      Found in lib/fs.js and 1 other location - About 1 hr to fix
                                      lib/fs.js on lines 332..337

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

                                      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