Showing 1,657 of 2,859 total issues

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

        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

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

        def ExpandWildcardDependencies(targets, data):
          """Expands dependencies specified as build_file:*.
        
          For each target in |targets|, examines sections containing links to other
          targets.  If any such section contains a link of the form build_file:*, it
        Severity: Minor
        Found in tools/gyp/pylib/gyp/input.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 has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Open

        def Load(build_files, variables, includes, depth, generator_input_info, check,
                 circular_check, parallel, root_targets):
          SetGeneratorGlobals(generator_input_info)
          # A generator can have other lists (in addition to sources) be processed
          # for rules.
        Severity: Minor
        Found in tools/gyp/pylib/gyp/input.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 ProcessOptions has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Open

        def ProcessOptions(options):
          global VARIANT_FLAGS
          global VARIANTS
        
          # Architecture and mode related stuff.
        Severity: Minor
        Found in deps/v8/tools/run-tests.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 RunFuzzer has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Open

        def RunFuzzer(process_id, options, stop_running):
          MAX_SLEEP_TIME = 0.1
          INITIAL_SLEEP_TIME = 0.001
          SLEEP_TIME_FACTOR = 1.25
          base_file_name = "/dev/shm/runtime_fuzz_%d" % process_id
        Severity: Minor
        Found in deps/v8/tools/generate-runtime-tests.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 json.js has 382 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 tools/doc/json.js - About 5 hrs to fix

          Function gunzTarPerm has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
          Open

          function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) {
            if (!dMode) dMode = npm.modes.exec
            if (!fMode) fMode = npm.modes.file
            log.silly("gunzTarPerm", "modes", [dMode.toString(8), fMode.toString(8)])
          
          
          Severity: Minor
          Found in deps/npm/lib/utils/tar.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 makeEnv has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
          Open

          function makeEnv (data, prefix, env) {
            prefix = prefix || "npm_package_"
            if (!env) {
              env = {}
              for (var i in process.env) if (!i.match(/^npm_/)) {
          Severity: Minor
          Found in deps/npm/lib/utils/lifecycle.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

          File run-deopt-fuzzer.py has 377 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #!/usr/bin/env python
          #
          # Copyright 2012 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
          Severity: Minor
          Found in deps/v8/tools/run-deopt-fuzzer.py - About 5 hrs to fix

            MsvsSettings has 38 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class MsvsSettings(object):
              """A class that understands the gyp 'msvs_...' values (especially the
              msvs_settings field). They largely correpond to the VS2008 IDE DOM. This
              class helps map those settings to command line options."""
            
            
            Severity: Minor
            Found in tools/gyp/pylib/gyp/msvs_emulation.py - About 5 hrs to fix

              Function MergeLists has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

              def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True):
                # Python documentation recommends objects which do not support hash
                # set this value to None. Python library objects follow this rule.
                is_hashable = lambda val: val.__hash__
              
              
              Severity: Minor
              Found in tools/gyp/pylib/gyp/input.py - About 4 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