Showing 2,859 of 2,859 total issues

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

fs.unlink = 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 806..812

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.stat = 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 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.rmdir = function(path, callback) {
  callback = maybeCallback(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 757..763
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 3 locations. Consider refactoring.
Open

SplayTree.prototype.findMax = function(opt_startNode) {
  if (this.isEmpty()) {
    return null;
  }
  var current = opt_startNode || this.root_;
Severity: Major
Found in deps/v8/tools/splaytree.js and 2 other locations - About 2 hrs to fix
deps/v8/benchmarks/spinning-balls/splay-tree.js on lines 141..150
deps/v8/benchmarks/splay.js on lines 236..245

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

Socket.prototype.setMulticastTTL = function(arg) {
  if (!util.isNumber(arg)) {
    throw new TypeError('Argument must be a number');
  }

Severity: Major
Found in lib/dgram.js and 1 other location - About 2 hrs to fix
lib/dgram.js on lines 384..395

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

SplayTree.prototype.findMax = function(opt_startNode) {
  if (this.isEmpty()) {
    return null;
  }
  var current = opt_startNode || this.root_;
Severity: Major
Found in deps/v8/benchmarks/splay.js and 2 other locations - About 2 hrs to fix
deps/v8/benchmarks/spinning-balls/splay-tree.js on lines 141..150
deps/v8/tools/splaytree.js on lines 158..167

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

SplayTree.prototype.findMax = function(opt_startNode) {
  if (this.isEmpty()) {
    return null;
  }
  var current = opt_startNode || this.root_;
Severity: Major
Found in deps/v8/benchmarks/spinning-balls/splay-tree.js and 2 other locations - About 2 hrs to fix
deps/v8/benchmarks/splay.js on lines 236..245
deps/v8/tools/splaytree.js on lines 158..167

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

Socket.prototype.setTTL = function(arg) {
  if (!util.isNumber(arg)) {
    throw new TypeError('Argument must be a number');
  }

Severity: Major
Found in lib/dgram.js and 1 other location - About 2 hrs to fix
lib/dgram.js on lines 398..409

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

Consider simplifying this complex logical expression.
Open

      if (is_last_code_in_line and
          self._StatementCouldEndInContext() and
          not is_multiline_string and
          not is_end_of_block and
          not is_continued_identifier and
Severity: Critical
Found in tools/closure_linter/closure_linter/ecmametadatapass.py - About 2 hrs to fix

    MacTool has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class MacTool(object):
      """This class performs all the Mac tooling steps. The methods can either be
      executed directly, or dispatched from an argument list."""
    
      def Dispatch(self, args):
    Severity: Minor
    Found in tools/gyp/pylib/gyp/mac_tool.py - About 2 hrs to fix

      Function bind has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Socket.prototype.bind = function(port /*, address, callback*/) {
        var self = this;
      
        self._healthCheck();
      
      
      Severity: Major
      Found in lib/dgram.js - About 2 hrs to fix

        Function runBlock1 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function runBlock1() {
            for (var i = 0; i < 81; i++) {
              re8.exec(s26[i]);
            }
            for (var i = 0; i < 78; i++) {
        Severity: Major
        Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

          Function runBlock2 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function runBlock2() {
              for (var i = 0; i < 40; i++) {
                s57a[i].replace(re14, '');
                s57a[i].replace(re15, '');
              }
          Severity: Major
          Found in deps/v8/benchmarks/regexp.js - About 2 hrs to fix

            Function helpCommand_ has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            DebugRequest.prototype.helpCommand_ = function(args) {
              // Help os quite simple.
              if (args && args.length > 0) {
                print('warning: arguments to \'help\' are ignored');
              }
            Severity: Major
            Found in deps/v8/src/d8.js - About 2 hrs to fix

              Function getLite has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function getLite (data, noname) {
                var lite = {}
                  , maxDepth = npm.config.get("depth")
              
                if (!noname && data.name) lite.name = data.name
              Severity: Major
              Found in deps/npm/lib/ls.js - About 2 hrs to fix

                Function save has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Conf.prototype.save = function (where, cb) {
                  var target = this.sources[where]
                  if (!target || !(target.path || target.source) || !target.data) {
                    if (where !== "builtin")
                      var er = new Error("bad save target: " + where)
                Severity: Major
                Found in deps/npm/lib/config/core.js - About 2 hrs to fix

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

                  function root (args, silent, cb) {
                    if (typeof cb !== "function") cb = silent, silent = false
                    if (!silent) console.log(npm.dir)
                    process.nextTick(cb.bind(this, null, npm.dir))
                  }
                  Severity: Major
                  Found in deps/npm/lib/root.js and 1 other location - About 2 hrs to fix
                  deps/npm/lib/prefix.js on lines 7..11

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

                  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 (this.v2.mark == mark) {
                      this.direction = (this.v1.mark != mark && Strength.stronger(this.strength, this.v1.walkStrength))
                        ? Direction.BACKWARD
                        : Direction.NONE;
                    }
                  Severity: Major
                  Found in deps/v8/benchmarks/deltablue.js and 1 other location - About 2 hrs to fix
                  deps/v8/benchmarks/deltablue.js on lines 357..361

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

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

                  Buffer.prototype.writeDoubleBE = function writeDoubleBE(val, offset, noAssert) {
                    val = +val;
                    offset = offset >>> 0;
                    if (!noAssert)
                      checkFloat(this, val, offset, 8);
                  Severity: Major
                  Found in lib/buffer.js and 3 other locations - About 2 hrs to fix
                  lib/buffer.js on lines 928..935
                  lib/buffer.js on lines 938..945
                  lib/buffer.js on lines 948..955

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

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

                  Buffer.prototype.writeDoubleLE = function writeDoubleLE(val, offset, noAssert) {
                    val = +val;
                    offset = offset >>> 0;
                    if (!noAssert)
                      checkFloat(this, val, offset, 8);
                  Severity: Major
                  Found in lib/buffer.js and 3 other locations - About 2 hrs to fix
                  lib/buffer.js on lines 928..935
                  lib/buffer.js on lines 938..945
                  lib/buffer.js on lines 958..965

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

                  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