Showing 2,859 of 2,859 total issues

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

win32.dirname = function(path) {
  var result = win32SplitPath(path),
      root = result[0],
      dir = result[1];

Severity: Major
Found in lib/path.js and 1 other location - About 3 hrs to fix
lib/path.js on lines 538..554

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

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 releases.py has 314 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

Severity: Minor
Found in deps/v8/tools/push-to-trunk/releases.py - About 3 hrs to fix

    Function setBreakpoint has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Interface.prototype.setBreakpoint = function(script, line,
                                                 condition, silent) {
      if (!this.requireConnection()) return;
    
      var self = this,
    Severity: Major
    Found in lib/_debugger.js - About 3 hrs to fix

      Function gentlyRm has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function gentlyRm (target, gently, base, cb) {
        if (!cb) {
          cb = base
          base = undefined
        }
      Severity: Major
      Found in deps/npm/lib/utils/gently-rm.js - About 3 hrs to fix

        GitRecipesMixin has 29 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class GitRecipesMixin(object):
          def GitIsWorkdirClean(self):
            return self.Git("status -s -uno").strip() == ""
        
          @Strip
        Severity: Minor
        Found in deps/v8/tools/push-to-trunk/git_recipes.py - About 3 hrs to fix

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

            switch (type) {
              case 'buf':
                chunk = new Buffer(len);
                chunk.fill('x');
                break;
          Severity: Major
          Found in benchmark/net/tcp-raw-c2s.js and 2 other locations - About 3 hrs to fix
          benchmark/net/tcp-raw-pipe.js on lines 74..88
          benchmark/net/tcp-raw-s2c.js on lines 49..63

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

          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

            function write() {
              var writeReq = { oncomplete: afterWrite };
              var err;
              switch (type) {
                case 'buf':
          Severity: Major
          Found in benchmark/net/tcp-raw-c2s.js and 1 other location - About 3 hrs to fix
          benchmark/net/tcp-raw-pipe.js on lines 123..140

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

          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

            function write() {
              var writeReq = { oncomplete: afterWrite };
              var err;
              switch (type) {
                case 'buf':
          Severity: Major
          Found in benchmark/net/tcp-raw-pipe.js and 1 other location - About 3 hrs to fix
          benchmark/net/tcp-raw-c2s.js on lines 110..127

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

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

            switch (type) {
              case 'buf':
                chunk = new Buffer(len);
                chunk.fill('x');
                break;
          Severity: Major
          Found in benchmark/net/tcp-raw-pipe.js and 2 other locations - About 3 hrs to fix
          benchmark/net/tcp-raw-c2s.js on lines 77..91
          benchmark/net/tcp-raw-s2c.js on lines 49..63

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

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

              switch (type) {
                case 'buf':
                  chunk = new Buffer(len);
                  chunk.fill('x');
                  break;
          Severity: Major
          Found in benchmark/net/tcp-raw-s2c.js and 2 other locations - About 3 hrs to fix
          benchmark/net/tcp-raw-c2s.js on lines 77..91
          benchmark/net/tcp-raw-pipe.js on lines 74..88

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

          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

              add : function(c1, c2){
                  var result = new Flog.RayTracer.Color(0,0,0);
          
                  result.red = c1.red + c2.red;
                  result.green = c1.green + c2.green;
          Severity: Major
          Found in deps/v8/benchmarks/raytrace.js and 2 other locations - About 3 hrs to fix
          deps/v8/benchmarks/raytrace.js on lines 116..124
          deps/v8/benchmarks/raytrace.js on lines 126..134

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

          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

              subtract: function(c1, c2){
                  var result = new Flog.RayTracer.Color(0,0,0);
          
                  result.red = c1.red - c2.red;
                  result.green = c1.green - c2.green;
          Severity: Major
          Found in deps/v8/benchmarks/raytrace.js and 2 other locations - About 3 hrs to fix
          deps/v8/benchmarks/raytrace.js on lines 94..102
          deps/v8/benchmarks/raytrace.js on lines 126..134

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

          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 (options.crl) {
              if (util.isArray(options.crl)) {
                for (var i = 0, len = options.crl.length; i < len; i++) {
                  c.context.addCRL(options.crl[i]);
                }
          Severity: Major
          Found in lib/_tls_common.js and 1 other location - About 3 hrs to fix
          lib/_tls_common.js on lines 117..127

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

          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 (options.ca) {
              if (util.isArray(options.ca)) {
                for (var i = 0, len = options.ca.length; i < len; i++) {
                  c.context.addCACert(options.ca[i]);
                }
          Severity: Major
          Found in lib/_tls_common.js and 1 other location - About 3 hrs to fix
          lib/_tls_common.js on lines 150..158

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

          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

              multiply : function(c1, c2) {
                  var result = new Flog.RayTracer.Color(0,0,0);
          
                  result.red = c1.red * c2.red;
                  result.green = c1.green * c2.green;
          Severity: Major
          Found in deps/v8/benchmarks/raytrace.js and 2 other locations - About 3 hrs to fix
          deps/v8/benchmarks/raytrace.js on lines 94..102
          deps/v8/benchmarks/raytrace.js on lines 116..124

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

          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 ls.js has 311 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          
          // show the installed versions of packages
          //
          // --parseable creates output like this:
          // <fullpath>:<name@ver>:<realpath>:<flags>
          Severity: Minor
          Found in deps/npm/lib/ls.js - About 3 hrs to fix

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

            fs.rename = function(oldPath, newPath, callback) {
              callback = makeCallback(callback);
              if (!nullCheck(oldPath, callback)) return;
              if (!nullCheck(newPath, callback)) return;
              var req = new FSReqWrap();
            Severity: Major
            Found in lib/fs.js and 1 other location - About 3 hrs to fix
            lib/fs.js on lines 859..870

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

            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

            fs.link = function(srcpath, dstpath, callback) {
              callback = makeCallback(callback);
              if (!nullCheck(srcpath, callback)) return;
              if (!nullCheck(dstpath, callback)) return;
            
            
            Severity: Major
            Found in lib/fs.js and 1 other location - About 3 hrs to fix
            lib/fs.js on lines 628..637

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

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

            function _validateStdio(stdio, sync) {
              var ipc,
                  ipcFd;
            
              // Replace shortcut with an array
            Severity: Major
            Found in lib/child_process.js - About 3 hrs to fix

              Function doJSON has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function doJSON(input, filename, cb) {
                var root = {source: filename};
                var stack = [root];
                var depth = 0;
                var current = root;
              Severity: Major
              Found in tools/doc/json.js - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language