Showing 2,859 of 2,859 total issues

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

  def __init__(self, heap, map, address):
    HeapObject.__init__(self, heap, map, address)
    self.source = self.ObjectField(self.SourceOffset())
    self.name = self.ObjectField(self.NameOffset())
Severity: Major
Found in deps/v8/tools/grokdump.py and 3 other locations - About 2 hrs to fix
deps/v8/tools/grokdump.py on lines 1134..1137
deps/v8/tools/grokdump.py on lines 1167..1170
deps/v8/tools/grokdump.py on lines 1437..1440

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

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

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

def FormatTime(d):
  millis = round(d * 1000) % 1000
  return time.strftime("%M:%S.", time.gmtime(d)) + ("%03i" % millis)
Severity: Major
Found in tools/test.py and 1 other location - About 2 hrs to fix
deps/v8/tools/testrunner/local/verbose.py on lines 82..84

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

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

Module.prototype._compile = function(content, filename) {
  var self = this;
  // remove shebang
  content = content.replace(/^\#\!.*/, '');

Severity: Major
Found in lib/module.js - About 2 hrs to fix

    Function spawn has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ChildProcess.prototype.spawn = function(options) {
      var self = this,
          ipc,
          ipcFd,
          // If no `stdio` option was given - use default
    Severity: Major
    Found in lib/child_process.js - About 2 hrs to fix

      Function readFileSync has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      fs.readFileSync = function(path, options) {
        if (!options) {
          options = { encoding: null, flag: 'r' };
        } else if (util.isString(options)) {
          options = { encoding: options, flag: 'r' };
      Severity: Major
      Found in lib/fs.js - About 2 hrs to fix

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

        function completion (args, cb) {
          if (process.platform === "win32") {
            var e = new Error("npm completion not supported on windows")
            e.code = "ENOTSUP"
            e.errno = require("constants").ENOTSUP
        Severity: Major
        Found in deps/npm/lib/completion.js - About 2 hrs to fix

          Function mutate has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function mutate (pkg, user, mutation, cb) {
            if (user) {
              var byUser = "-/user/org.couchdb.user:" + user
              mapToRegistry(byUser, npm.config, function (er, uri, auth) {
                if (er) return cb(er)
          Severity: Major
          Found in deps/npm/lib/owner.js - About 2 hrs to fix

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

              if (maybe_func.length) {
                var funcAddr = parseInt(maybe_func[0]);
                var state = parseState(maybe_func[1]);
                this.profile_.addFuncCode(type, name, start, size, funcAddr, state);
              } else {
            Severity: Major
            Found in deps/v8/tools/tickprocessor.js and 1 other location - About 2 hrs to fix
            deps/v8/tools/tickprocessor.js on lines 111..117

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

            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

            Socket.prototype.addMembership = function(multicastAddress,
                                                      interfaceAddress) {
              this._healthCheck();
            
              if (!multicastAddress) {
            Severity: Major
            Found in lib/dgram.js and 1 other location - About 2 hrs to fix
            lib/dgram.js on lines 437..449

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

            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

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

              if (maybe_func.length) {
                var funcAddr = parseInt(maybe_func[0]);
                var state = parseState(maybe_func[1]);
                this.profile_.addFuncCode(type, name, start, size, funcAddr, state);
              } else {
            Severity: Major
            Found in deps/v8/tools/tickprocessor.js and 1 other location - About 2 hrs to fix
            deps/v8/tools/tickprocessor.js on lines 333..339

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

            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

            Socket.prototype.dropMembership = function(multicastAddress,
                                                       interfaceAddress) {
              this._healthCheck();
            
              if (!multicastAddress) {
            Severity: Major
            Found in lib/dgram.js and 1 other location - About 2 hrs to fix
            lib/dgram.js on lines 422..434

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

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

            Readable.prototype.read = function(n) {
              debug('read', n);
              var state = this._readableState;
              var nOrig = n;
            
            
            Severity: Major
            Found in lib/_stream_readable.js - About 2 hrs to fix

              Function runBlock7 has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function runBlock7() {
                  for (var i = 0; i < 9; i++) {
                    '0'.replace(re40, '');
                    '0'.replace(re10, '');
                    '0'.replace(re51, '');
              Severity: Major
              Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

                Function server has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function server() {
                  var serverHandle = new TCP();
                  var err = serverHandle.bind('127.0.0.1', PORT);
                  if (err)
                    fail(err, 'bind');
                Severity: Major
                Found in benchmark/net/tcp-raw-s2c.js - About 2 hrs to fix

                  Function addLocalDirectory has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function addLocalDirectory (p, pkgData, shasum, cb) {
                    assert(pkgData, "must pass package data")
                    assert(typeof cb === "function", "must have callback")
                  
                    // if it's a folder, then read the package.json,
                  Severity: Major
                  Found in deps/npm/lib/cache/add-local.js - About 2 hrs to fix

                    Function load has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function load (npm, cli, cb) {
                      which(process.argv[0], function (er, node) {
                        if (!er && node.toUpperCase() !== process.execPath.toUpperCase()) {
                          log.verbose("node symlink", node)
                          process.execPath = node
                    Severity: Major
                    Found in deps/npm/lib/npm.js - About 2 hrs to fix

                      Function WriteTarget has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use,
                                      options, generator_flags, all_qualified_targets, output):
                      
                        # The make generator does this always.
                        # TODO: It would be nice to be able to tell CMake all dependencies.
                      Severity: Major
                      Found in tools/gyp/pylib/gyp/generator/cmake.py - About 2 hrs to fix

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

                        fs.readdir = function(path, callback) {
                          callback = makeCallback(callback);
                          if (!nullCheck(path, callback)) return;
                          var req = new FSReqWrap();
                          req.oncomplete = callback;
                        Severity: Major
                        Found in lib/fs.js and 5 other locations - About 2 hrs to fix
                        lib/fs.js on lines 707..713
                        lib/fs.js on lines 776..782
                        lib/fs.js on lines 784..790
                        lib/fs.js on lines 806..812
                        lib/fs.js on lines 879..885

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

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

                        fs.lstat = function(path, callback) {
                          callback = makeCallback(callback);
                          if (!nullCheck(path, callback)) return;
                          var req = new FSReqWrap();
                          req.oncomplete = callback;
                        Severity: Major
                        Found in lib/fs.js and 5 other locations - About 2 hrs to fix
                        lib/fs.js on lines 707..713
                        lib/fs.js on lines 757..763
                        lib/fs.js on lines 784..790
                        lib/fs.js on lines 806..812
                        lib/fs.js on lines 879..885

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

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

                        fs.readlink = function(path, callback) {
                          callback = makeCallback(callback);
                          if (!nullCheck(path, callback)) return;
                          var req = new FSReqWrap();
                          req.oncomplete = callback;
                        Severity: Major
                        Found in lib/fs.js and 5 other locations - About 2 hrs to fix
                        lib/fs.js on lines 707..713
                        lib/fs.js on lines 757..763
                        lib/fs.js on lines 776..782
                        lib/fs.js on lines 784..790
                        lib/fs.js on lines 879..885

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

                        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