Showing 1,896 of 2,859 total issues

Function Main has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

def Main():
  parser = BuildOptionParser()
  (options, args) = parser.parse_args()

  if not ProcessOptions(options, args):
Severity: Minor
Found in deps/v8/tools/generate-runtime-tests.py - About 7 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 GetAllIncludeDirectories has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def GetAllIncludeDirectories(target_list, target_dicts,
                             shared_intermediate_dirs, config_name, params):
  """Calculate the set of include directories to be used.

  Returns:
Severity: Minor
Found in tools/gyp/pylib/gyp/generator/eclipse.py - About 7 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 common_includes.py has 467 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# Copyright 2013 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
# met:
Severity: Minor
Found in deps/v8/tools/push-to-trunk/common_includes.py - About 7 hrs to fix

    File deltablue.js has 464 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright 2008 the V8 project authors. All rights reserved.
    // Copyright 1996 John Maloney and Mario Wolczko.
    
    // This program is free software; you can redistribute it and/or modify
    // it under the terms of the GNU General Public License as published by
    Severity: Minor
    Found in deps/v8/benchmarks/deltablue.js - About 7 hrs to fix

      Function formatValue has a Cognitive Complexity of 46 (exceeds 5 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: Minor
      Found in lib/util.js - About 7 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 main has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

      def main(argv=None):
        if argv is None:
          argv = sys.argv
      
        usage = "gyptest.py [-ahlnq] [-f formats] [test ...]"
      Severity: Minor
      Found in tools/gyp/gyptest.py - About 7 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

      Generator has 50 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Generator(object):
      
        def RandomVariable(self, varname, vartype, simple):
          if simple:
            return self._Variable(varname, self.GENERATORS[vartype][0])
      Severity: Minor
      Found in deps/v8/tools/generate-runtime-tests.py - About 7 hrs to fix

        File zlib.js has 456 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/zlib.js - About 6 hrs to fix

          Function shouldUpdate has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

          function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
            // look up the most recent version.
            // if that's what we already have, or if it's not on the args list,
            // then dive into it.  Otherwise, cb() with the data.
          
          
          Severity: Minor
          Found in deps/npm/lib/outdated.js - About 6 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 __init__ has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

            def __init__(self, properties=None, id=None, parent=None,
                         force_outdir=None, force_prefix=None, force_extension=None):
              # super
              XCTarget.__init__(self, properties, id, parent)
          
          
          Severity: Minor
          Found in tools/gyp/pylib/gyp/xcodeproj_file.py - About 6 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 FullDump has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

          def FullDump(reader, heap):
            """Dump all available memory regions."""
            def dump_region(reader, start, size, location):
              print
              while start & 3 != 0:
          Severity: Minor
          Found in deps/v8/tools/grokdump.py - About 6 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_objects has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

          def load_objects():
                  objfilename = sys.argv[2];
                  objfile = open(objfilename, 'r');
                  in_insttype = False;
          
          
          Severity: Minor
          Found in deps/v8/tools/gen-postmortem-metadata.py - About 6 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 parse has 170 lines of code (exceeds 25 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: Major
          Found in lib/url.js - About 6 hrs to fix

            Function ClientRequest has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
            Open

            function ClientRequest(options, cb) {
              var self = this;
              OutgoingMessage.call(self);
            
              if (util.isString(options)) {
            Severity: Minor
            Found in lib/_http_client.js - About 6 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 nextToken has 168 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            sc_Tokenizer.prototype.nextToken = function() {
                var port = this.port;
            
                function isNumberChar(c) {
                return (c >= "0" && c <= "9");
            Severity: Major
            Found in deps/v8/benchmarks/earley-boyer.js - About 6 hrs to fix

              Function _ttyWrite has 165 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Interface.prototype._ttyWrite = function(s, key) {
                key = key || {};
              
                // Ignore escape key - Fixes #2876
                if (key.name == 'escape') return;
              Severity: Major
              Found in lib/readline.js - About 6 hrs to fix

                Function DebugRequest has 165 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function DebugRequest(cmd_line) {
                  // If the very first character is a { assume that a JSON request have been
                  // entered as a command. Converting that to a JSON request is trivial.
                  if (cmd_line && cmd_line.length > 0 && cmd_line.charAt(0) == '{') {
                    this.request_ = cmd_line;
                Severity: Major
                Found in deps/v8/src/d8.js - About 6 hrs to fix

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

                    def WriteRules(self, rules, extra_sources, prebuild,
                                   mac_bundle_resources, extra_mac_bundle_resources):
                      env = self.GetSortedXcodeEnv()
                      all_outputs = []
                      for rule in rules:
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/generator/ninja.py - About 6 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 queueForRemoval has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def queueForRemoval(tree):
                      global remove
                      if not config.has_key("trees"):
                          # no config
                          return
                  Severity: Minor
                  Found in tools/icu/icutrim.py - About 6 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 42 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def Write(self, writer=gyp.common.WriteOnDiff):
                      """Writes the solution file to disk.
                  
                      Raises:
                        IndexError: An entry appears multiple times.
                  Severity: Minor
                  Found in tools/gyp/pylib/gyp/MSVSNew.py - About 6 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