Showing 1,896 of 2,859 total issues

Function Load has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

  def Load(self, mmap_info, code_map, options):
    # Skip kernel mmaps when requested using the fact that their tid
    # is 0.
    if mmap_info.tid == 0 and not options.kernel:
      return True
Severity: Minor
Found in deps/v8/tools/ll_prof.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

Function formatValue has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function formatValue(ctx, value, recurseTimes) {
  // Provide a hook for user-specified inspect functions.
  // Check that value is an object with an inspect function on it
  if (ctx.customInspect &&
      value &&
Severity: Major
Found in lib/util.js - About 4 hrs to fix

    Function get has 110 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Object.defineProperty(exports, "defaults", {get: function () {
      if (defaults) return defaults
    
      if (process.env.PREFIX) {
        globalPrefix = process.env.PREFIX
    Severity: Major
    Found in deps/npm/lib/config/defaults.js - About 4 hrs to fix

      NinjaWriter has 34 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class NinjaWriter:
        def __init__(self, qualified_target, target_outputs, base_dir, build_dir,
                     output_file, toplevel_build, output_file_name, flavor,
                     toplevel_dir=None):
          """
      Severity: Minor
      Found in tools/gyp/pylib/gyp/generator/ninja.py - About 4 hrs to fix

        Function setBreakpoint has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        Interface.prototype.setBreakpoint = function(script, line,
                                                     condition, silent) {
          if (!this.requireConnection()) return;
        
          var self = this,
        Severity: Minor
        Found in lib/_debugger.js - 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

        Function Zlib has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        function Zlib(opts, mode) {
          this._opts = opts = opts || {};
          this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK;
        
          Transform.call(this, opts);
        Severity: Minor
        Found in lib/zlib.js - 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

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

          def WriteRules(self, rules, extra_sources, extra_outputs,
                         extra_mac_bundle_resources, part_of_all):
            """Write Makefile code for any 'rules' from the gyp input.
        
            extra_sources: a list that will be filled in with newly generated source
        Severity: Minor
        Found in tools/gyp/pylib/gyp/generator/make.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

        Function LoadTargetBuildFile has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        def LoadTargetBuildFile(build_file_path, data, aux_data, variables, includes,
                                depth, check, load_dependencies):
          # If depth is set, predefine the DEPTH variable to be a relative path from
          # this build file's directory to the directory identified by depth.
          if depth:
        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

        Function TakeOverOnlyChild has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

          def TakeOverOnlyChild(self, recurse=False):
            """If this PBXGroup has only one child and it's also a PBXGroup, take
            it over by making all of its children this object's children.
        
            This function will continue to take over only children when those children
        Severity: Minor
        Found in tools/gyp/pylib/gyp/xcodeproj_file.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

        Function FindRuntimeFunctions has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        def FindRuntimeFunctions():
          inline_functions = FindInlineRuntimeFunctions()
          functions = []
          expanded_lines = ReadFileAndExpandMacros(FILENAME)
          function = None
        Severity: Minor
        Found in deps/v8/tools/generate-runtime-tests.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

        Function ClassifyFunctions has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        def ClassifyFunctions(functions):
          # Can be fuzzed with a JavaScript testcase.
          js_fuzzable_functions = []
          # We have enough information to fuzz these, but they need inputs that
          # cannot be created or passed around in JavaScript.
        Severity: Minor
        Found in deps/v8/tools/generate-runtime-tests.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

        Function install has 105 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function install (args, cb_) {
          var hasArguments = !!args.length
        
          function cb (er, installed) {
            if (er) return cb_(er)
        Severity: Major
        Found in deps/npm/lib/install.js - About 4 hrs to fix

          File ecmametadatapass.py has 341 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          #!/usr/bin/env python
          #
          # Copyright 2010 The Closure Linter Authors. All Rights Reserved.
          #
          # Licensed under the Apache License, Version 2.0 (the "License");
          Severity: Minor
          Found in tools/closure_linter/closure_linter/ecmametadatapass.py - About 4 hrs to fix

            File stats-viewer.py has 341 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #!/usr/bin/env python
            #
            # Copyright 2008 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/stats-viewer.py - About 4 hrs to fix

              File core.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              
              var CC = require("config-chain").ConfigChain
              var inherits = require("inherits")
              var configDefs = require("./defaults.js")
              var types = configDefs.types
              Severity: Minor
              Found in deps/npm/lib/config/core.js - About 4 hrs to fix

                Function collectData has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  this.collectData = function(input, distortion_per_entry) {
                
                    var last_timestamp = 0;
                
                    // Parse functions.
                Severity: Major
                Found in deps/v8/tools/profviz/composer.js - About 4 hrs to fix

                  Function isFullWidthCodePoint has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function isFullWidthCodePoint(code) {
                    if (isNaN(code)) {
                      return false;
                    }
                  
                  
                  Severity: Minor
                  Found in lib/readline.js - 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

                  Function exports has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var server = module.exports = http.createServer(function (req, res) {
                    if (useDomains) {
                      var dom = domain.create();
                      dom.add(req);
                      dom.add(res);
                  Severity: Minor
                  Found in benchmark/http_simple.js - 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

                  Function GetClosurizedNamespace has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def GetClosurizedNamespace(self, identifier):
                      """Given an identifier, returns the namespace that identifier is from.
                  
                      Args:
                        identifier: The identifier to extract a namespace from.
                  Severity: Minor
                  Found in tools/closure_linter/closure_linter/javascriptstatetracker.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

                  Function Finalize has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def Finalize(self, state, tokenizer_mode):
                      """Perform all checks that need to occur after all lines are processed."""
                      # Call the base class's Finalize function.
                      super(JavaScriptLintRules, self).Finalize(state, tokenizer_mode)
                  
                  
                  Severity: Minor
                  Found in tools/closure_linter/closure_linter/javascriptlintrules.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