Showing 2,859 of 2,859 total issues

Function DebugOutput has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def DebugOutput(mode, message, *args):
  if 'all' in gyp.debug or mode in gyp.debug:
    ctx = ('unknown', 0, 'unknown')
    try:
      f = traceback.extract_stack(limit=2)
Severity: Minor
Found in tools/gyp/pylib/gyp/__init__.py - About 45 mins 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 build has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def build(self, outputs, rule, inputs=None, implicit=None, order_only=None,
Severity: Minor
Found in tools/gyp/pylib/gyp/ninja_syntax.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

              if parameter_regexp:             # Ignore bad syntax
                function += parameter_regexp.group(1)
            else:
    Severity: Major
    Found in tools/cpplint.py - About 45 mins to fix

      Function GetDisasmLines has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def GetDisasmLines(filename, offset, size, arch, inplace, arch_flags=""):
      Severity: Minor
      Found in deps/v8/tools/disasm.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                for ip in sample.ips:
                  caller_code = code_map.Find(ip)
                  if caller_code:
                    if code:
                      caller_code.CalleeTick(code)
        Severity: Major
        Found in deps/v8/tools/ll_prof.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if options.define:
                      for define in options.define:
                        key, value = define.split('=', 1)
                        # This non-standard push_macro extension is supported
                        # by compilers we support (GCC, clang).
          Severity: Major
          Found in deps/v8/tools/generate_shim_headers/generate_shim_headers.py - About 45 mins to fix

            Function Execute has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def Execute(arch, mode, args, options, suites, workspace):
            Severity: Minor
            Found in deps/v8/tools/run-tests.py - About 45 mins to fix

              Function PrintDot has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def PrintDot(code_map, options):
                print "digraph G {"
                for code in code_map.UsedCode():
                  if code.self_ticks < 10:
                    continue
              Severity: Minor
              Found in deps/v8/tools/ll_prof.py - About 45 mins 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 JS2C has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def JS2C(source, target, native_type, compression_type, raw_file, startup_blob):
              Severity: Minor
              Found in deps/v8/tools/js2c.py - About 45 mins to fix

                Function MakeStep has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def MakeStep(step_class=Step, number=0, state=None, config=None,
                Severity: Minor
                Found in deps/v8/tools/push-to-trunk/common_includes.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                          if code.codetype == Code.OPTIMIZED:
                            optimized_ticks += 1
                          elif code.codetype == Code.FULL_CODEGEN:
                            generated_ticks += 1
                          elif code.codetype == Code.V8INTERNAL:
                  Severity: Major
                  Found in deps/v8/tools/ll_prof.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                if byte >= 0x20 and byte < 0x7f:
                                  asc_line += chr(byte)
                                else:
                                  asc_line += "."
                                hex_line += " %02x" % (byte)
                    Severity: Major
                    Found in deps/v8/tools/grokdump.py - About 45 mins to fix

                      Function GetReleaseDict has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        def GetReleaseDict(
                      Severity: Minor
                      Found in deps/v8/tools/push-to-trunk/releases.py - About 45 mins to fix

                        Function Execute has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def Execute(arch, mode, args, options, suites, workspace):
                        Severity: Minor
                        Found in deps/v8/tools/run-deopt-fuzzer.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    if t in NON_JS_TYPES:
                                      decision = cctest_fuzzable_functions
                                    else:
                                      assert Generator.IsTypeSupported(t), \
                                          ("type generator not found for %s, function: %s" % (t, f))
                          Severity: Major
                          Found in deps/v8/tools/generate-runtime-tests.py - About 45 mins to fix

                            Function run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def run(self):
                                os.nice(20)
                                self.ip = presence_handler.GetOwnIP()
                                self.perf_data_manager = perfdata.PerfDataManager(self.datadir)
                                self.perf_data_lock = threading.Lock()
                            Severity: Minor
                            Found in deps/v8/tools/testrunner/server/main.py - About 45 mins 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

                            Avoid deeply nested control flow statements.
                            Open

                                      if options.use_include_next:
                                        f.write('#include_next <%s>\n' % include_target)
                                      else:
                                        f.write('#include <%s>\n' % include_target)
                            
                            
                            Severity: Major
                            Found in deps/v8/tools/generate_shim_headers/generate_shim_headers.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if options.define:
                                          for define in options.define:
                                            key, value = define.split('=', 1)
                                            # This non-standard pop_macro extension is supported
                                            # by compilers we support (GCC, clang).
                              Severity: Major
                              Found in deps/v8/tools/generate_shim_headers/generate_shim_headers.py - About 45 mins to fix

                                Function _JSTypedArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def _JSTypedArray(self, name, recursion_budget):
                                    arraytype = random.choice(["Int8", "Int16", "Int32", "Uint8", "Uint16",
                                                               "Uint32", "Float32", "Float64", "Uint8Clamped"])
                                    ctor_type = random.randint(0, 3)
                                    if ctor_type == 0:
                                Severity: Minor
                                Found in deps/v8/tools/generate-runtime-tests.py - About 45 mins 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

                                Avoid deeply nested control flow statements.
                                Open

                                              if has_unexpected_output:
                                                self.failed.append(test)
                                                if test.output.HasCrashed():
                                                  self.crashed += 1
                                              else:
                                Severity: Major
                                Found in deps/v8/tools/testrunner/network/network_execution.py - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language