Showing 2,859 of 2,859 total issues

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

function main(conf) {
  dur = +conf.dur;
  len = +conf.len;
  type = conf.type;

Severity: Major
Found in benchmark/net/net-c2s.js and 2 other locations - About 6 hrs to fix
benchmark/net/net-pipe.js on lines 18..42
benchmark/net/net-s2c.js on lines 18..42

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

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 ClientRequest has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

function ClientRequest(options, cb) {
  var self = this;
  OutgoingMessage.call(self);

  if (util.isString(options)) {
Severity: Minor
Found in lib/_http_client.js - About 6 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  while exit_code is None:
    if (not end_time is None) and (time.time() >= end_time):
      # Kill the process and wait for it to exit.
      KillProcessWithID(process.pid)
      exit_code = process.wait()
Severity: Major
Found in tools/test.py and 1 other location - About 6 hrs to fix
deps/v8/tools/testrunner/local/commands.py on lines 94..105

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

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

  while exit_code is None:
    if (not end_time is None) and (time.time() >= end_time):
      # Kill the process and wait for it to exit.
      KillProcessWithID(process.pid)
      exit_code = process.wait()
Severity: Major
Found in deps/v8/tools/testrunner/local/commands.py and 1 other location - About 6 hrs to fix
tools/test.py on lines 544..555

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

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

sc_Tokenizer.prototype.nextToken = function() {
    var port = this.port;

    function isNumberChar(c) {
    return (c >= "0" && c <= "9");
Severity: Major
Found in deps/v8/benchmarks/earley-boyer.js - About 6 hrs to fix

    Function _ttyWrite has 165 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Interface.prototype._ttyWrite = function(s, key) {
      key = key || {};
    
      // Ignore escape key - Fixes #2876
      if (key.name == 'escape') return;
    Severity: Major
    Found in lib/readline.js - About 6 hrs to fix

      Function DebugRequest has 165 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function DebugRequest(cmd_line) {
        // If the very first character is a { assume that a JSON request have been
        // entered as a command. Converting that to a JSON request is trivial.
        if (cmd_line && cmd_line.length > 0 && cmd_line.charAt(0) == '{') {
          this.request_ = cmd_line;
      Severity: Major
      Found in deps/v8/src/d8.js - About 6 hrs to fix

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

          if(a.t < this.t) {
            c += a.s;
            while(i < this.t) {
              c += this_array[i];
              r_array[i++] = c&BI_DM;
        Severity: Major
        Found in deps/v8/benchmarks/crypto.js and 1 other location - About 6 hrs to fix
        deps/v8/benchmarks/crypto.js on lines 388..405

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

        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(a.t < this.t) {
            c -= a.s;
            while(i < this.t) {
              c += this_array[i];
              r_array[i++] = c&BI_DM;
        Severity: Major
        Found in deps/v8/benchmarks/crypto.js and 1 other location - About 6 hrs to fix
        deps/v8/benchmarks/crypto.js on lines 945..962

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

        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 WriteRules has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

          def WriteRules(self, rules, extra_sources, prebuild,
                         mac_bundle_resources, extra_mac_bundle_resources):
            env = self.GetSortedXcodeEnv()
            all_outputs = []
            for rule in rules:
        Severity: Minor
        Found in tools/gyp/pylib/gyp/generator/ninja.py - About 6 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function queueForRemoval has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

        def queueForRemoval(tree):
            global remove
            if not config.has_key("trees"):
                # no config
                return
        Severity: Minor
        Found in tools/icu/icutrim.py - About 6 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function Write has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

          def Write(self, writer=gyp.common.WriteOnDiff):
            """Writes the solution file to disk.
        
            Raises:
              IndexError: An entry appears multiple times.
        Severity: Minor
        Found in tools/gyp/pylib/gyp/MSVSNew.py - About 6 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        File composer.js has 433 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // Copyright 2013 the V8 project authors. All rights reserved.
        // Redistribution and use in source and binary forms, with or without
        // modification, are permitted provided that the following conditions are
        // met:
        //
        Severity: Minor
        Found in deps/v8/tools/profviz/composer.js - About 6 hrs to fix

          File _http_outgoing.js has 432 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Copyright Joyent, Inc. and other Node contributors.
          //
          // Permission is hereby granted, free of charge, to any person obtaining a
          // copy of this software and associated documentation files (the
          // "Software"), to deal in the Software without restriction, including
          Severity: Minor
          Found in lib/_http_outgoing.js - About 6 hrs to fix

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

              for (id, length) in delay_ids:
                native_name = "native %s.js" % id
                get_index_cases.append(GET_DELAY_INDEX_CASE % { 'id': id, 'i': i })
                get_script_source_cases.append(GET_DELAY_SCRIPT_SOURCE_CASE % {
                  'id': id,
            Severity: Major
            Found in tools/js2c.py and 1 other location - About 6 hrs to fix
            tools/js2c.py on lines 327..340

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

            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

              for (id, length) in ids:
                native_name = "native %s.js" % id
                get_index_cases.append(GET_DELAY_INDEX_CASE % { 'id': id, 'i': i })
                get_script_source_cases.append(GET_DELAY_SCRIPT_SOURCE_CASE % {
                  'id': id,
            Severity: Major
            Found in tools/js2c.py and 1 other location - About 6 hrs to fix
            tools/js2c.py on lines 312..325

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

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

            function sh_highlightString(inputString, language) {
              if (/Konqueror/.test(navigator.userAgent)) {
                if (! language.konquered) {
                  for (var s = 0; s < language.length; s++) {
                    for (var p = 0; p < language[s].length; p++) {
            Severity: Major
            Found in doc/sh_main.js - About 6 hrs to fix

              Function connectionListener has 157 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function connectionListener(socket) {
                var self = this;
                var outgoing = [];
                var incoming = [];
              
              
              Severity: Major
              Found in lib/_http_server.js - About 6 hrs to fix

                Function Stringify has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                Open

                function Stringify(x, depth) {
                  if (depth === undefined)
                    depth = stringifyDepthLimit;
                  else if (depth === 0)
                    return "*";
                Severity: Minor
                Found in deps/v8/src/d8.js - About 6 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                    elif upper_bound == -1:
                      sh = "a negative %s" % self.number_name
                    elif lower_bound == 0:
                      sh = "a non-negative %s" % self.number_name
                    elif upper_bound == 0:
                Severity: Major
                Found in tools/closure_linter/gflags.py and 1 other location - About 6 hrs to fix
                tools/closure_linter/gflags.py on lines 2124..2133

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

                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