Function Sodium has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring.
Open

var Sodium = (function() {
  "use strict";

  var kinds = ["FUNCTION", "OPTIMIZED_FUNCTION", "STUB", "BUILTIN",
               "LOAD_IC", "KEYED_LOAD_IC", "CALL_IC", "KEYED_CALL_IC",
Severity: Minor
Found in deps/v8/tools/sodium/sodium.js - About 2 days 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 resolveObject has a Cognitive Complexity of 134 (exceeds 5 allowed). Consider refactoring.
Open

Url.prototype.resolveObject = function(relative) {
  if (util.isString(relative)) {
    var rel = new Url();
    rel.parse(relative, false, true);
    relative = rel;
Severity: Minor
Found in lib/url.js - About 2 days 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 _ProcessContext has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
Open

  def _ProcessContext(self):
    """Process the context at the current token.

    Returns:
      The context that should be assigned to the current token, or None if
Severity: Minor
Found in tools/closure_linter/closure_linter/ecmametadatapass.py - About 2 days 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 net.js has 1029 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: Major
Found in lib/net.js - About 2 days to fix

    Function RegExpBenchmark has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring.
    Open

    function RegExpBenchmark() {
      var re0 = /^ba/;
      var re1 = /(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/;
      var re2 = /^\s*|\s*$/g;
      var re3 = /\bQBZPbageby_cynprubyqre\b/;
    Severity: Minor
    Found in deps/v8/benchmarks/regexp.js - About 2 days 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 child_process.js has 973 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: Major
    Found in lib/child_process.js - About 2 days to fix

      Function parse has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring.
      Open

      Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
        if (!util.isString(url)) {
          throw new TypeError("Parameter 'url' must be a string, not " + typeof url);
        }
      
      
      Severity: Minor
      Found in lib/url.js - About 2 days 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 complete has a Cognitive Complexity of 116 (exceeds 5 allowed). Consider refactoring.
      Open

      REPLServer.prototype.complete = function(line, callback) {
        // There may be local variables to evaluate, try a nested REPL
        if (!util.isUndefined(this.bufferedCommand) && this.bufferedCommand.length) {
          // Get a new array of inputed lines
          var tmp = this.lines.slice();
      Severity: Minor
      Found in lib/repl.js - About 2 days 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 readline.js has 940 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: Major
      Found in lib/readline.js - About 2 days to fix

        File install.js has 896 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // npm install <pkg> <pkg> <pkg>
        //
        // See doc/install.md for more description
        
        // Managing contexts...
        Severity: Major
        Found in deps/npm/lib/install.js - About 2 days to fix

          Function testConvertToMSBuildSettings_full_synthetic has 433 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def testConvertToMSBuildSettings_full_synthetic(self):
              """Tests conversion of all the MSBuild settings."""
              msvs_settings = {
                  'VCCLCompilerTool': {
                      'AdditionalIncludeDirectories': 'folder1;folder2;folder3',
          Severity: Major
          Found in tools/gyp/pylib/gyp/MSVSSettings_test.py - About 2 days to fix

            Function PlotScriptComposer has 427 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function PlotScriptComposer(kResX, kResY, error_output) {
              // Constants.
              var kV8BinarySuffixes = ["/d8", "/libv8.so"];
              var kStackFrames = 8;             // Stack frames to display in the plot.
            
            
            Severity: Major
            Found in deps/v8/tools/profviz/composer.js - About 2 days to fix

              Function runBlock11 has 419 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function runBlock11() {
                  for (var i = 0; i < 2; i++) {
                    ' .pybfr'.replace(re18, '');
                    ' n.svryqOgaPnapry'.replace(re18, '');
                    ' qg'.replace(re18, '');
              Severity: Major
              Found in deps/v8/benchmarks/regexp.js - About 2 days to fix

                Function FluidField has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
                Open

                function FluidField(canvas) {
                    function addFields(x, s, dt)
                    {
                        for (var i=0; i<size ; i++ ) x[i] += dt*s[i];
                    }
                Severity: Minor
                Found in deps/v8/benchmarks/navier-stokes.js - About 2 days 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 sh_highlightString has a Cognitive Complexity of 104 (exceeds 5 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: Minor
                Found in doc/sh_main.js - About 2 days 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 nextToken has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
                Open

                sc_Tokenizer.prototype.nextToken = function() {
                    var port = this.port;
                
                    function isNumberChar(c) {
                    return (c >= "0" && c <= "9");
                Severity: Minor
                Found in deps/v8/benchmarks/earley-boyer.js - About 2 days 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 MSVSSettings.py has 821 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # 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.
                
                """Code to validate and convert settings of the Microsoft build tools.
                Severity: Major
                Found in tools/gyp/pylib/gyp/MSVSSettings.py - About 1 day to fix

                  File ll_prof.py has 803 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: Major
                  Found in deps/v8/tools/ll_prof.py - About 1 day to fix

                    Function gyp_main has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def gyp_main(args):
                      my_name = os.path.basename(sys.argv[0])
                    
                      parser = RegeneratableOptionParser()
                      usage = 'usage: %s [options ...] [build_file ...]'
                    Severity: Minor
                    Found in tools/gyp/pylib/gyp/__init__.py - About 1 day 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 Sodium has 349 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var Sodium = (function() {
                      "use strict";
                    
                      var kinds = ["FUNCTION", "OPTIMIZED_FUNCTION", "STUB", "BUILTIN",
                                   "LOAD_IC", "KEYED_LOAD_IC", "CALL_IC", "KEYED_CALL_IC",
                    Severity: Major
                    Found in deps/v8/tools/sodium/sodium.js - About 1 day to fix
                      Severity
                      Category
                      Status