Showing 1,896 of 2,859 total issues

Avoid deeply nested control flow statements.
Open

          if after:
            print " " * (basic_offset * indent) + line
            indent += brace_diff
          else:
            indent += brace_diff
Severity: Major
Found in tools/gyp/tools/pretty_gyp.py - About 45 mins to fix

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

    def GypBuild():
      # Dump out/ directory.
      print '@@@BUILD_STEP cleanup@@@'
      print 'Removing %s...' % OUT_DIR
      shutil.rmtree(OUT_DIR, ignore_errors=True)
    Severity: Minor
    Found in tools/gyp/buildbot/buildbot_run.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 SeekToNode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def SeekToNode(node1, child2):
      # A text node does not have properties.
      if child2.nodeType == Node.TEXT_NODE:
        return None
    
    
    Severity: Minor
    Found in tools/gyp/tools/pretty_vcproj.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 GetLineWidth has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    def GetLineWidth(line):
      """Determines the width of the line in column positions.
    
      Args:
        line: A string, which may be a Unicode string.
    Severity: Minor
    Found in tools/cpplint.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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def build(self, outputs, rule, inputs=None, implicit=None, order_only=None,
                  variables=None):
            outputs = self._as_list(outputs)
            all_inputs = self._as_list(inputs)[:]
            out_outputs = list(map(escape_path, outputs))
    Severity: Minor
    Found in tools/gyp/pylib/gyp/ninja_syntax.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 _GetIOSCodeSignIdentityKey has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def _GetIOSCodeSignIdentityKey(self, settings):
        identity = settings.get('CODE_SIGN_IDENTITY')
        if not identity:
          return None
        if identity not in XcodeSettings._codesigning_key_cache:
    Severity: Minor
    Found in tools/gyp/pylib/gyp/xcode_emulation.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 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
                            Severity
                            Category
                            Status
                            Source
                            Language