Showing 2,859 of 2,859 total issues

Function WriteRules has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

  def WriteRules(self, rules, extra_sources, extra_outputs):
    """Write Makefile code for any 'rules' from the gyp input.

    extra_sources: a list that will be filled in with newly generated source
                   files, if any
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/android.py - About 5 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 GetCflags has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

  def GetCflags(self, configname, arch=None):
    """Returns flags that need to be added to .c, .cc, .m, and .mm
    compilations."""
    # This functions (and the similar ones below) do not offer complete
    # emulation of all xcode_settings keys. They're implemented on demand.
Severity: Minor
Found in tools/gyp/pylib/gyp/xcode_emulation.py - About 5 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 load_fields has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

def load_fields():
        inlfilename = sys.argv[3];
        inlfile = open(inlfilename, 'r');

        #
Severity: Minor
Found in deps/v8/tools/gen-postmortem-metadata.py - About 5 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 execFile has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.execFile = function(file /* args, options, callback */) {
  var args = [], callback;
  var options = {
    encoding: 'utf8',
    timeout: 0,
Severity: Major
Found in lib/child_process.js - About 5 hrs to fix

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

    function main(conf) {
      var type = conf.type;
      var clazz = global[type];
      var n = +conf.n;
    
    
    Severity: Major
    Found in benchmark/arrays/zero-float.js and 1 other location - About 5 hrs to fix
    benchmark/arrays/zero-int.js on lines 7..20

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

    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

    function main(conf) {
      var type = conf.type;
      var clazz = global[type];
      var n = +conf.n;
    
    
    Severity: Major
    Found in benchmark/arrays/zero-int.js and 1 other location - About 5 hrs to fix
    benchmark/arrays/zero-float.js on lines 7..20

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

    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 _http_client.js has 397 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_client.js - About 5 hrs to fix

      File __init__.py has 396 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/env python
      
      # Copyright (c) 2012 Google Inc. 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 tools/gyp/pylib/gyp/__init__.py - About 5 hrs to fix

        Function REPLServer has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

        function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) {
          if (!(this instanceof REPLServer)) {
            return new REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined);
          }
        
        
        Severity: Minor
        Found in lib/repl.js - About 5 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 bnModInverse has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

        function bnModInverse(m) {
          var ac = m.isEven();
          if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
          var u = m.clone(), v = this.clone();
          var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
        Severity: Minor
        Found in deps/v8/benchmarks/crypto.js - About 5 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 WriteSourcesForArch has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

          def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
                                  predepends, precompiled_header, spec, arch=None):
            """Write build rules to compile all of |sources|."""
        
            extra_defines = []
        Severity: Minor
        Found in tools/gyp/pylib/gyp/generator/ninja.py - About 5 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 ReadUpToGC has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

          def ReadUpToGC(self):
            while self.log_pos < self.log.size():
              tag = self.log[self.log_pos]
              self.log_pos += 1
        
        
        Severity: Minor
        Found in deps/v8/tools/ll_prof.py - About 5 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 mac_tool.py has 392 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #!/usr/bin/env python
        # Copyright (c) 2012 Google Inc. 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 tools/gyp/pylib/gyp/mac_tool.py - About 5 hrs to fix

          File npm.js has 389 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ;(function(){
          // windows: running "npm blah" in this folder will invoke WSH, not node.
          if (typeof WScript !== "undefined") {
            WScript.echo("npm does not work when run\n"
                        +"with the Windows Scripting Host\n\n"
          Severity: Minor
          Found in deps/npm/lib/npm.js - About 5 hrs to fix

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

                for included_file in included_files:
                  # The included_files entries are relative to the dir of the build file
                  # that included them, so we have to undo that and then make them relative
                  # to the root dir.
                  relative_include_file = gyp.common.RelativePath(
            Severity: Major
            Found in tools/gyp/pylib/gyp/generator/make.py and 1 other location - About 5 hrs to fix
            tools/gyp/pylib/gyp/generator/android.py on lines 1012..1026

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

            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

                for included_file in included_files:
                  # The included_files entries are relative to the dir of the build file
                  # that included them, so we have to undo that and then make them relative
                  # to the root dir.
                  relative_include_file = gyp.common.RelativePath(
            Severity: Major
            Found in tools/gyp/pylib/gyp/generator/android.py and 1 other location - About 5 hrs to fix
            tools/gyp/pylib/gyp/generator/make.py on lines 2104..2118

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

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

              this.assembleOutput = function(output) {
                output("set yrange [0:" + (num_timer_event + 1) + "]");
                output("set xlabel \"execution time in ms\"");
                output("set xrange [" + range_start + ":" + range_end + "]");
                output("set style fill pattern 2 bo 1");
            Severity: Major
            Found in deps/v8/tools/profviz/composer.js - About 5 hrs to fix

              Function read has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              CryptoStream.prototype._read = function read(size) {
                // XXX: EOF?!
                if (!this.pair.ssl) return this.push(null);
              
                // Wait for session to be resumed
              Severity: Minor
              Found in lib/_tls_legacy.js - About 5 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 realpathSync has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              fs.realpathSync = function realpathSync(p, cache) {
                // make p is absolute
                p = pathModule.resolve(p);
              
                if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
              Severity: Minor
              Found in lib/fs.js - About 5 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 _storeHeader has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
              Open

              OutgoingMessage.prototype._storeHeader = function(firstLine, headers) {
                // firstLine in the case of request is: 'GET /index.html HTTP/1.1\r\n'
                // in the case of response it is: 'HTTP/1.1 200 OK\r\n'
                var state = {
                  sentConnectionHeader: false,
              Severity: Minor
              Found in lib/_http_outgoing.js - About 5 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

              Severity
              Category
              Status
              Source
              Language