Showing 2,859 of 2,859 total issues

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

      if die < 0.67:
        offset_name = name + "_offset"
        args.append(offset_name)
        result += self._Int32(offset_name)
Severity: Major
Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
deps/v8/tools/generate-runtime-tests.py on lines 680..683

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

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 die < 0.33:
        length_name = name + "_length"
        args.append(length_name)
        result += self._Int32(length_name)
Severity: Major
Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
deps/v8/tools/generate-runtime-tests.py on lines 676..679

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

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 token.type == Type.DOC_START_BRACE:
      open_count += 1
    elif token.type == Type.DOC_END_BRACE:
      close_count += 1
Severity: Major
Found in tools/closure_linter/closure_linter/statetracker.py and 1 other location - About 1 hr to fix
deps/v8/tools/ll_prof.py on lines 966..971

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

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

function parserOnIncomingClient(res, shouldKeepAlive) {
  var socket = this.socket;
  var req = socket._httpMessage;


Severity: Minor
Found in lib/_http_client.js - About 1 hr to fix

    Function _read has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ReadStream.prototype._read = function(n) {
      if (!util.isNumber(this.fd))
        return this.once('open', function() {
          this._read(n);
        });
    Severity: Minor
    Found in lib/fs.js - About 1 hr to fix

      Function ReadStream has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function ReadStream(path, options) {
        if (!(this instanceof ReadStream))
          return new ReadStream(path, options);
      
        // a little bit bigger buffer and water marks by default
      Severity: Minor
      Found in lib/fs.js - About 1 hr to fix

        Function clearBuffer has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function clearBuffer(stream, state) {
          state.bufferProcessing = true;
          var entry = state.bufferedRequest;
        
          if (stream._writev && entry && entry.next) {
        Severity: Minor
        Found in lib/_stream_writable.js - About 1 hr to fix

          Function isManaged has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function isManaged (target) {
            return function predicate (path, cb) {
              if (!path) {
                log.verbose('isManaged', 'no path passed for target', target)
                return cb(null, false)
          Severity: Minor
          Found in deps/npm/lib/utils/gently-rm.js - About 1 hr to fix

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

            view.completion = function (opts, cb) {
              if (opts.conf.argv.remain.length <= 2) {
                // FIXME: there used to be registry completion here, but it stopped making
                // sense somewhere around 50,000 packages on the registry
                return cb()
            Severity: Minor
            Found in deps/npm/lib/view.js - About 1 hr to fix

              Function loadPrefix has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function loadPrefix (cb) {
                var cli = this.list[0]
              
                Object.defineProperty(this, "prefix",
                  { set : function (prefix) {
              Severity: Minor
              Found in deps/npm/lib/config/load-prefix.js - About 1 hr to fix

                Function Main has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def Main():
                  parser = BuildOptions()
                  (options, args) = parser.parse_args()
                  if not ProcessOptions(options):
                    parser.print_help()
                Severity: Minor
                Found in tools/test.py - About 1 hr to fix

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

                    if (dy < 0) {
                      stream.write('\x1b[' + (-dy) + 'A');
                    } else if (dy > 0) {
                      stream.write('\x1b[' + dy + 'B');
                    }
                  Severity: Major
                  Found in lib/readline.js and 1 other location - About 1 hr to fix
                  lib/readline.js on lines 1214..1218

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

                  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

                  var bench = common.createBenchmark(main, {
                    writes: [500],
                    cipher: [ 'AES192', 'AES256' ],
                    type: ['asc', 'utf', 'buf'],
                    len: [2, 1024, 102400, 1024 * 1024],
                  Severity: Major
                  Found in benchmark/crypto/cipher-stream.js and 1 other location - About 1 hr to fix
                  benchmark/crypto/hash-stream-throughput.js on lines 6..12

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

                  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

                  var bench = common.createBenchmark(main, {
                    writes: [500],
                    algo: [ 'sha256', 'md5' ],
                    type: ['asc', 'utf', 'buf'],
                    len: [2, 1024, 102400, 1024 * 1024],
                  Severity: Major
                  Found in benchmark/crypto/hash-stream-throughput.js and 1 other location - About 1 hr to fix
                  benchmark/crypto/cipher-stream.js on lines 3..9

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

                  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 (dx < 0) {
                      stream.write('\x1b[' + (-dx) + 'D');
                    } else if (dx > 0) {
                      stream.write('\x1b[' + dx + 'C');
                    }
                  Severity: Major
                  Found in lib/readline.js and 1 other location - About 1 hr to fix
                  lib/readline.js on lines 1220..1224

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

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

                    var output = function(s, style) {
                      var length = s.length;
                      // this is more than just an optimization - we don't want to output empty <span></span> elements
                      if (length === 0) {
                        return;
                  Severity: Minor
                  Found in doc/sh_main.js - About 1 hr to fix

                    Function _load has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Module._load = function(request, parent, isMain) {
                      if (parent) {
                        debug('Module._load REQUEST  ' + (request) + ' parent: ' + parent.id);
                      }
                    
                    
                    Severity: Minor
                    Found in lib/module.js - About 1 hr to fix

                      Function sh_insertTags has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function sh_insertTags(tags, text) {
                        var doc = document;
                      
                        var result = document.createDocumentFragment();
                        var tagIndex = 0;
                      Severity: Minor
                      Found in doc/sh_main.js - About 1 hr to fix

                        Function unpipe has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        Readable.prototype.unpipe = function(dest) {
                          var state = this._readableState;
                        
                          // if we're not piping anywhere, then do nothing.
                          if (state.pipesCount === 0)
                        Severity: Minor
                        Found in lib/_stream_readable.js - About 1 hr to fix

                          Function parserOnHeadersComplete has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function parserOnHeadersComplete(info) {
                            debug('parserOnHeadersComplete', info);
                            var parser = this;
                            var headers = info.headers;
                            var url = info.url;
                          Severity: Minor
                          Found in lib/_http_common.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language