Showing 1,896 of 2,859 total issues

Function __init__ has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  def __init__(self, flag_token):
    """Creates the DocFlag object and attaches it to the given start token.

    Args:
      flag_token: The starting token of the flag.
Severity: Minor
Found in tools/closure_linter/closure_linter/statetracker.py - About 3 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 Finalize2 has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  def Finalize2(self, xcode_targets, xcode_target_to_target_dict):
    # Finalize2 needs to happen in a separate step because the process of
    # updating references to other projects depends on the ordering of targets
    # within remote project files.  Finalize1 is responsible for sorting duty,
    # and once all project files are sorted, Finalize2 can come in and update
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/xcode.py - About 3 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 ParseSolution has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def ParseSolution(solution_file):
  # All projects, their clsid and paths.
  projects = dict()

  # A list of dependencies associated with a project.
Severity: Minor
Found in tools/gyp/tools/pretty_sln.py - About 3 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 ParagraphParser has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ParagraphParser() {
  var self = this,
      block_is_license_block = false,
      block_has_c_style_comment,
      is_first_line_in_paragraph,
Severity: Major
Found in tools/license2rtf.js - About 3 hrs to fix

    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

            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

              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

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

                  exports.checkServerIdentity = function checkServerIdentity(host, cert) {
                    // Create regexp to much hostnames
                    function regexpify(host, wildcards) {
                      // Add trailing dot (make hostnames uniform)
                      if (!/\.$/.test(host)) host += '.';
                  Severity: Major
                  Found in lib/tls.js - About 3 hrs to fix

                    Function format has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Url.prototype.format = function() {
                      var auth = this.auth || '';
                      if (auth) {
                        auth = encodeURIComponent(auth);
                        auth = auth.replace(/%3A/i, ':');
                    Severity: Minor
                    Found in lib/url.js - About 3 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 _processChunk has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Zlib.prototype._processChunk = function(chunk, flushFlag, cb) {
                      var availInBefore = chunk && chunk.length;
                      var availOutBefore = this._chunkSize - this._offset;
                      var inOff = 0;
                    
                    
                    Severity: Minor
                    Found in lib/zlib.js - About 3 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 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Buffer.prototype.write = function(string, offset, length, encoding) {
                      // Buffer#write(string);
                      if (util.isUndefined(offset)) {
                        encoding = 'utf8';
                        length = this.length;
                    Severity: Minor
                    Found in lib/buffer.js - About 3 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 emit has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    EventEmitter.prototype.emit = function emit(type) {
                      var er, handler, len, args, i, listeners;
                    
                      if (!this._events)
                        this._events = {};
                    Severity: Minor
                    Found in lib/events.js - About 3 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 unescapeBuffer has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    QueryString.unescapeBuffer = function(s, decodeSpaces) {
                      var out = new Buffer(s.length);
                      var state = 'CHAR'; // states: CHAR, HEX0, HEX1
                      var n, m, hexchar;
                    
                    
                    Severity: Minor
                    Found in lib/querystring.js - About 3 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 read has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Readable.prototype.read = function(n) {
                      debug('read', n);
                      var state = this._readableState;
                      var nOrig = n;
                    
                    
                    Severity: Minor
                    Found in lib/_stream_readable.js - About 3 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 rayTrace has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                        rayTrace: function(info, ray, scene, depth){
                            // Calc ambient
                            var color = Flog.RayTracer.Color.prototype.multiplyScalar(info.color, scene.background.ambience);
                            var oldColor = color;
                            var shininess = Math.pow(10, info.shape.material.gloss + 1);
                    Severity: Minor
                    Found in deps/v8/benchmarks/raytrace.js - About 3 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 connect has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    exports.connect = function(/* [port, host], options, cb */) {
                      var args = normalizeConnectArgs(arguments);
                      var options = args[0];
                      var cb = args[1];
                    
                    
                    Severity: Minor
                    Found in lib/_tls_wrap.js - About 3 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