deps/v8/tools/grokdump.py

Summary

Maintainability
F
1 mo
Test Coverage

File grokdump.py has 2621 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/grokdump.py - About 1 wk to fix

    Function AnalyzeMinidump has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

    def AnalyzeMinidump(options, minidump_name):
      reader = MinidumpReader(options, minidump_name)
      heap = None
      DebugPrint("========================================")
      if reader.exception is None:
    Severity: Minor
    Found in deps/v8/tools/grokdump.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 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 do_GET has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

      def do_GET(self):
        try:
          parsedurl = urlparse.urlparse(self.path)
          query_components = urlparse.parse_qs(parsedurl.query)
          if parsedurl.path == "/dumps.html":
    Severity: Minor
    Found in deps/v8/tools/grokdump.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 output_words has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

      def output_words(self, f, start_address, end_address,
                       highlight_address, desc):
        region = self.reader.FindRegion(highlight_address)
        if region is None:
          f.write("<h3>Address 0x%x not found in the dump.</h3>\n" %
    Severity: Minor
    Found in deps/v8/tools/grokdump.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 output_ascii has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

      def output_ascii(self, f, start_address, end_address, highlight_address):
        region = self.reader.FindRegion(highlight_address)
        if region is None:
          f.write("<h3>Address %x not found in the dump.</h3>" %
              highlight_address)
    Severity: Minor
    Found in deps/v8/tools/grokdump.py - About 3 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

    MinidumpReader has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class MinidumpReader(object):
      """Minidump (.dmp) reader."""
    
      _HEADER_MAGIC = 0x504d444d
    
    
    Severity: Minor
    Found in deps/v8/tools/grokdump.py - About 3 hrs to fix

      InspectionWebFormatter has 28 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class InspectionWebFormatter(object):
        CONTEXT_FULL = 0
        CONTEXT_SHORT = 1
      
        def __init__(self, switches, minidump_name, http_server):
      Severity: Minor
      Found in deps/v8/tools/grokdump.py - About 3 hrs to fix

        Consider simplifying this complex logical expression.
        Open

              if (byte == 0x8b or           # mov
                  byte == 0x89 or           # mov reg-reg
                  (byte & 0xf0) == 0x50 or  # push/pop
                  (sixty_four and (byte & 0xf0) == 0x40) or  # rex prefix
                  byte == 0xc3 or           # return
        Severity: Critical
        Found in deps/v8/tools/grokdump.py - About 3 hrs to fix

          Function __init__ has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

            def __init__(self, options, minidump_name):
              self.minidump_name = minidump_name
              self.minidump_file = open(minidump_name, "r")
              self.minidump = mmap.mmap(self.minidump_file.fileno(), 0, mmap.MAP_PRIVATE)
              self.header = MINIDUMP_HEADER.Read(self.minidump, 0)
          Severity: Minor
          Found in deps/v8/tools/grokdump.py - About 2 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 output_disasm_range has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

            def output_disasm_range(
                self, f, start_address, end_address, highlight_address, exact):
              region = self.reader.FindRegion(highlight_address)
              if start_address < region[0]:
                start_address = region[0]
          Severity: Minor
          Found in deps/v8/tools/grokdump.py - About 2 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

          Map has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Map(HeapObject):
            def Decode(self, offset, size, value):
              return (value >> offset) & ((1 << size) - 1)
          
            # Instance Sizes
          Severity: Minor
          Found in deps/v8/tools/grokdump.py - About 2 hrs to fix

            Function IsProbableASCIIRegion has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

              def IsProbableASCIIRegion(self, location, length):
                ascii_bytes = 0
                non_ascii_bytes = 0
                for loc in xrange(location, location + length):
                  byte = ctypes.c_uint8.from_buffer(self.minidump, loc).value
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 1 hr 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 FindLocation has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

              def FindLocation(self, address):
                offset = 0
                if self.memory_list64 is not None:
                  for r in self.memory_list64.ranges:
                    if r.start <= address < r.start + r.size:
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 1 hr 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 SenseObject has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

              def SenseObject(self, tagged_address):
                if self.IsInKnownOldSpace(tagged_address):
                  offset = self.GetPageOffset(tagged_address)
                  lookup_key = (self.ContainingKnownOldSpaceName(tagged_address), offset)
                  known_obj_name = KNOWN_OBJECTS.get(lookup_key)
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 1 hr 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 Read has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

              def Read(self, memory, offset):
                if self.is_flexible:
                  fields_copy = self.fields[:]
                  last = 0
                  for name, type_or_func in fields_copy:
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 1 hr 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 format_disasm_line has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def format_disasm_line(
                  self, f, start, line, next_address, highlight_address):
                line_address = start + line[0]
                address_fmt = "  <td>%s</td>\n"
                if line_address == highlight_address:
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 1 hr 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 FindObject has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

              def FindObject(self, tagged_address):
                if tagged_address in self.objects:
                  return self.objects[tagged_address]
                if (tagged_address & self.ObjectAlignmentMask()) != 1: return None
                address = tagged_address - 1
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 1 hr 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 FindWordList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              def FindWordList(self, word):
                aligned_res = []
                unaligned_res = []
                def search_inside_region(reader, start, size, location):
                  for loc in xrange(location, location + size - self.PointerSize()):
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 1 hr 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 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def __init__(self, minidump_name, reader):
                self.comment_file = minidump_name + ".comments"
                self.address_comments = {}
                self.page_address = {}
                if os.path.exists(self.comment_file):
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 55 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 get_dump_formatter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def get_dump_formatter(self, name):
                if name is None:
                  return self.default_formatter
                else:
                  if not DUMP_FILE_RE.match(name):
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 55 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 IsProbableExecutableRegion has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def IsProbableExecutableRegion(self, location, length):
                opcode_bytes = 0
                sixty_four = self.arch == MD_CPU_ARCHITECTURE_AMD64
                for loc in xrange(location, location + length):
                  byte = ctypes.c_uint8.from_buffer(self.minidump, loc).value
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 55 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 output_context has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def output_context(self, f, details):
                exception_thread = self.reader.thread_map[self.reader.exception.thread_id]
                f.write("<h3>Exception context</h3>")
                f.write('<div class="code">\n')
                f.write("Thread id: %d" % exception_thread.id)
            Severity: Minor
            Found in deps/v8/tools/grokdump.py - About 55 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 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 output_words has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def output_words(self, f, start_address, end_address,
              Severity: Minor
              Found in deps/v8/tools/grokdump.py - About 35 mins to fix

                Function format_disasm_line has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def format_disasm_line(
                Severity: Minor
                Found in deps/v8/tools/grokdump.py - About 35 mins to fix

                  Function output_disasm_range has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def output_disasm_range(
                  Severity: Minor
                  Found in deps/v8/tools/grokdump.py - About 35 mins to fix

                    Function FormatDisasmLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def FormatDisasmLine(start, heap, line):
                      line_address = start + line[0]
                      stack_slot = heap.stack_map.get(line_address)
                      marker = "  "
                      if stack_slot:
                    Severity: Minor
                    Found in deps/v8/tools/grokdump.py - About 35 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 do_lm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def do_lm(self, arg):
                        """
                         List details for all loaded modules in the minidump. An argument can
                         be passed to limit the output to only those modules that contain the
                         argument as a substring (case insensitive match).
                    Severity: Minor
                    Found in deps/v8/tools/grokdump.py - About 35 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 too many return statements within this function.
                    Open

                          return cls(self, map, address)
                    Severity: Major
                    Found in deps/v8/tools/grokdump.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            if instance_type_name is None: return None
                      Severity: Major
                      Found in deps/v8/tools/grokdump.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              if instance_type_name is None: return None
                        Severity: Major
                        Found in deps/v8/tools/grokdump.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                if map is None: return None
                          Severity: Major
                          Found in deps/v8/tools/grokdump.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return None
                            Severity: Major
                            Found in deps/v8/tools/grokdump.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return object
                              Severity: Major
                              Found in deps/v8/tools/grokdump.py - About 30 mins to fix

                                Function Print has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def Print(self, p):
                                    length = self.Length()
                                    array = self.array
                                
                                    p.Print("Transitions(%08x, length=%d)" % (array.address, length))
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py - About 25 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 output_search_res has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def output_search_res(self, f, straddress):
                                    try:
                                      self.output_header(f)
                                      f.write("<h3>Search results for %s</h3>" % straddress)
                                
                                
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py - About 25 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 ForEachMemoryRegion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def ForEachMemoryRegion(self, cb):
                                    if self.memory_list64 is not None:
                                      for r in self.memory_list64.ranges:
                                        location = self.memory_list64.base_rva + offset
                                        cb(self, r.start, r.size, location)
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py - About 25 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 FindSymbol has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def FindSymbol(self, addr):
                                    if not self._IsInModuleWithSymbols(addr):
                                      return None
                                
                                    i = bisect.bisect_left(self.symbols, addr)
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py - About 25 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 do_da has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def do_da(self, address):
                                    """
                                     Print ASCII string starting at specified address.
                                    """
                                    address = int(address, 16)
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py - About 25 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 format_address has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def format_address(self, maybeaddress, straddress = None):
                                    if maybeaddress is None:
                                      return "not in dump"
                                    else:
                                      if straddress is None:
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py - About 25 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 output_dumps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def output_dumps(self, f):
                                    f.write(WEB_DUMPS_HEADER)
                                    f.write("<h3>List of available dumps</h3>")
                                    f.write("<table class=\"dumplist\">\n")
                                    f.write("<thead><tr>")
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py - About 25 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

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  if heap.reader.arch == MD_CPU_ARCHITECTURE_X86:
                                    if code.startswith("e8"):
                                      words = code.split()
                                      if len(words) > 6 and words[5] == "call":
                                        offset = int(words[4] + words[3] + words[2] + words[1], 16)
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 day to fix
                                deps/v8/tools/grokdump.py on lines 2514..2520

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 149.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    if self.heap.reader.arch == MD_CPU_ARCHITECTURE_X86:
                                      if code.startswith("e8"):
                                        words = code.split()
                                        if len(words) > 6 and words[5] == "call":
                                          offset = int(words[4] + words[3] + words[2] + words[1], 16)
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 day to fix
                                deps/v8/tools/grokdump.py on lines 909..915

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 149.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      elif parsedurl.path == "/setcomment":
                                        address = query_components.get("address", [])
                                        comment = query_components.get("comment", [""])
                                        if len(address) == 1 and len(comment) == 1:
                                          address = address[0]
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 day to fix
                                deps/v8/tools/grokdump.py on lines 2048..2058

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 123.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      elif parsedurl.path == "/setpageaddress":
                                        kind = query_components.get("kind", [])
                                        address = query_components.get("address", [""])
                                        if len(kind) == 1 and len(address) == 1:
                                          kind = kind[0]
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 day to fix
                                deps/v8/tools/grokdump.py on lines 2037..2047

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 123.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    if line_address == highlight_address:
                                      f.write("<tr class=\"highlight-line\">\n")
                                      address_fmt = "  <td><a id=\"highlight\">%s</a></td>\n"
                                    elif (line_address < highlight_address and
                                          highlight_address < next_address + start):
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 4 hrs to fix
                                deps/v8/tools/grokdump.py on lines 2339..2346

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 76.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      if slot == highlight_address:
                                        f.write("<tr class=\"highlight-line\">\n")
                                        address_fmt = "<a id=\"highlight\"></a>%s&nbsp;</td>\n"
                                      elif slot < highlight_address and highlight_address < slot + size:
                                        f.write("<tr class=\"inexact-highlight-line\">\n")
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 4 hrs to fix
                                deps/v8/tools/grokdump.py on lines 2494..2502

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 76.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def do_do_trans(self, address):
                                    """
                                      Print a transition array in a readable format.
                                    """
                                    start = int(address, 16)
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 3 hrs to fix
                                deps/v8/tools/grokdump.py on lines 2848..2854

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 70.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def do_do_desc(self, address):
                                    """
                                      Print a descriptor array in a readable format.
                                    """
                                    start = int(address, 16)
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 3 hrs to fix
                                deps/v8/tools/grokdump.py on lines 2864..2870

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 70.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def ExceptionIP(self):
                                    if self.arch == MD_CPU_ARCHITECTURE_AMD64:
                                      return self.exception_context.rip
                                    elif self.arch == MD_CPU_ARCHITECTURE_ARM:
                                      return self.exception_context.pc
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 3 hrs to fix
                                deps/v8/tools/grokdump.py on lines 776..782

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 65.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def ExceptionSP(self):
                                    if self.arch == MD_CPU_ARCHITECTURE_AMD64:
                                      return self.exception_context.rsp
                                    elif self.arch == MD_CPU_ARCHITECTURE_ARM:
                                      return self.exception_context.sp
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 3 hrs to fix
                                deps/v8/tools/grokdump.py on lines 768..774

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 65.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 4 locations. Consider refactoring.
                                Open

                                  def __init__(self, heap, map, address):
                                    HeapObject.__init__(self, heap, map, address)
                                    self.default_cache = self.ObjectField(self.DefaultCacheOffset())
                                    self.normal_type_cache = self.ObjectField(self.NormalTypeCacheOffset())
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 3 other locations - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 1134..1137
                                deps/v8/tools/grokdump.py on lines 1167..1170
                                deps/v8/tools/grokdump.py on lines 1424..1427

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 55.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 4 locations. Consider refactoring.
                                Open

                                  def __init__(self, heap, map, address):
                                    String.__init__(self, heap, map, address)
                                    self.left = self.ObjectField(self.LeftOffset())
                                    self.right = self.ObjectField(self.RightOffset())
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 3 other locations - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 1167..1170
                                deps/v8/tools/grokdump.py on lines 1424..1427
                                deps/v8/tools/grokdump.py on lines 1437..1440

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 55.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 4 locations. Consider refactoring.
                                Open

                                  def __init__(self, heap, map, address):
                                    HeapObject.__init__(self, heap, map, address)
                                    self.to_string = self.ObjectField(self.ToStringOffset())
                                    self.kind = self.SmiField(self.KindOffset())
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 3 other locations - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 1134..1137
                                deps/v8/tools/grokdump.py on lines 1424..1427
                                deps/v8/tools/grokdump.py on lines 1437..1440

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 55.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 4 locations. Consider refactoring.
                                Open

                                  def __init__(self, heap, map, address):
                                    HeapObject.__init__(self, heap, map, address)
                                    self.source = self.ObjectField(self.SourceOffset())
                                    self.name = self.ObjectField(self.NameOffset())
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 3 other locations - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 1134..1137
                                deps/v8/tools/grokdump.py on lines 1167..1170
                                deps/v8/tools/grokdump.py on lines 1437..1440

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 55.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                MINIDUMP_HEADER = Descriptor([
                                  ("signature", ctypes.c_uint32),
                                  ("version", ctypes.c_uint32),
                                  ("stream_count", ctypes.c_uint32),
                                  ("stream_directories_rva", ctypes.c_uint32),
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 443..450

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 52.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                MINIDUMP_THREAD = Descriptor([
                                  ("id", ctypes.c_uint32),
                                  ("suspend_count", ctypes.c_uint32),
                                  ("priority_class", ctypes.c_uint32),
                                  ("priority", ctypes.c_uint32),
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 182..189

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 52.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    if end_address > region[0] + region[1]:
                                      end_address = region[0] + region[1]
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 2436..2437

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 51.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    if end_address > region[0] + region[1]:
                                      end_address = region[0] + region[1]
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 2376..2377

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 51.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                  def do_km(self, address):
                                    """
                                     Teach V8 heap layout information to the inspector. Set the first
                                     map-space page by passing any pointer into that page.
                                    """
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 2 other locations - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 2893..2900
                                deps/v8/tools/grokdump.py on lines 2911..2918

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 50.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                  def do_kd(self, address):
                                    """
                                     Teach V8 heap layout information to the inspector. Set the first
                                     data-space page by passing any pointer into that page.
                                    """
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 2 other locations - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 2902..2909
                                deps/v8/tools/grokdump.py on lines 2911..2918

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 50.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                  def do_kp(self, address):
                                    """
                                     Teach V8 heap layout information to the inspector. Set the first
                                     pointer-space page by passing any pointer into that page.
                                    """
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 2 other locations - About 2 hrs to fix
                                deps/v8/tools/grokdump.py on lines 2893..2900
                                deps/v8/tools/grokdump.py on lines 2902..2909

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 50.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  if os.path.exists(options.objdump):
                                    disasm.OBJDUMP_BIN = options.objdump
                                    OBJDUMP_BIN = options.objdump
                                  else:
                                    print "Cannot find %s, falling back to default objdump" % options.objdump
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/ll_prof.py on lines 909..913

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 42.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    if start_address != region[0] or end_address != region[0] + region[1]:
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 2451..2451

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 42.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    if start_address != region[0] or end_address != region[0] + region[1]:
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 2380..2380

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 42.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    if descriptors.__class__ == FixedArray:
                                      DescriptorArray(descriptors).Print(p)
                                    else:
                                      p.Print("Descriptors: %s" % (descriptors))
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 1054..1057

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 41.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    if transitions.__class__ == FixedArray:
                                      TransitionArray(transitions).Print(p)
                                    else:
                                      p.Print("TransitionsOrBackPointer: %s" % (transitions))
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 1048..1051

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 41.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def StartPositionAndTypeOffset(self):
                                    return 12 * self.heap.PointerSize() + 5 * self.heap.IntSize()
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 1388..1389

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 39.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      if len(unaligned_res) > 0:
                                        f.write("<h3>Occurrences of 0x%x at unaligned addresses</h3>\n" % \
                                                address)
                                        self.output_find_results(f, unaligned_res)
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 2614..2617

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 39.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def EndPositionOffset(self):
                                    return 12 * self.heap.PointerSize() + 4 * self.heap.IntSize()
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 1391..1392

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 39.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      if len(aligned_res) > 0:
                                        f.write("<h3>Occurrences of 0x%x at aligned addresses</h3>\n" %
                                                address)
                                        self.output_find_results(f, aligned_res)
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 2619..2622

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 39.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def __init__(self, heap, map, address):
                                    HeapObject.__init__(self, heap, map, address)
                                    self.length = self.SmiField(self.LengthOffset())
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 1198..1200

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 38.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def save_page_address(self, page_kind, address):
                                    with open(self.comment_file, "a") as f:
                                      f.write("P %s 0x%x\n" % (page_kind, address))
                                      f.close()
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 1656..1658

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 38.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def __init__(self, heap, map, address):
                                    HeapObject.__init__(self, heap, map, address)
                                    self.length = self.SmiField(self.LengthOffset())
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 1070..1072

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 38.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    with open(self.comment_file, "a") as f:
                                      f.write("C 0x%x %s\n" % (address, comment))
                                      f.close()
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 1 hr to fix
                                deps/v8/tools/grokdump.py on lines 1621..1624

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 38.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                MINIDUMP_MEMORY_LIST = Descriptor([
                                  ("range_count", ctypes.c_uint32),
                                  ("ranges", lambda m: MINIDUMP_MEMORY_DESCRIPTOR.ctype * m.range_count)
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 2 other locations - About 50 mins to fix
                                deps/v8/tools/grokdump.py on lines 453..455
                                deps/v8/tools/grokdump.py on lines 487..489

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 36.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                MINIDUMP_THREAD_LIST = Descriptor([
                                  ("thread_count", ctypes.c_uint32),
                                  ("threads", lambda t: MINIDUMP_THREAD.ctype * t.thread_count)
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 2 other locations - About 50 mins to fix
                                deps/v8/tools/grokdump.py on lines 432..434
                                deps/v8/tools/grokdump.py on lines 487..489

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 36.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def Decode(self, offset, size, value):
                                    return (value >> offset) & ((1 << size) - 1)
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 50 mins to fix
                                deps/v8/tools/grokdump.py on lines 960..961

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 36.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                MINIDUMP_MODULE_LIST = Descriptor([
                                  ("number_of_modules", ctypes.c_uint32),
                                  ("modules", lambda t: MINIDUMP_RAW_MODULE.ctype * t.number_of_modules)
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 2 other locations - About 50 mins to fix
                                deps/v8/tools/grokdump.py on lines 432..434
                                deps/v8/tools/grokdump.py on lines 453..455

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 36.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                  def Decode(self, offset, size, value):
                                    return (value >> offset) & ((1 << size) - 1)
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 50 mins to fix
                                deps/v8/tools/grokdump.py on lines 1230..1231

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 36.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        return "{" + ", ".join("%s: %s" % (field, self.__getattribute__(field))
                                                               for field, _ in Raw._fields_) + "}"
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 45 mins to fix
                                deps/v8/tools/ll_prof.py on lines 516..517

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 35.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                  def ReadU8(self, address):
                                    location = self.FindLocation(address)
                                    return ctypes.c_uint8.from_buffer(self.minidump, location).value
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 2 other locations - About 40 mins to fix
                                deps/v8/tools/grokdump.py on lines 604..606
                                deps/v8/tools/grokdump.py on lines 608..610

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 34.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                  def ReadU32(self, address):
                                    location = self.FindLocation(address)
                                    return ctypes.c_uint32.from_buffer(self.minidump, location).value
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 2 other locations - About 40 mins to fix
                                deps/v8/tools/grokdump.py on lines 600..602
                                deps/v8/tools/grokdump.py on lines 608..610

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 34.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                  def ReadU64(self, address):
                                    location = self.FindLocation(address)
                                    return ctypes.c_uint64.from_buffer(self.minidump, location).value
                                Severity: Major
                                Found in deps/v8/tools/grokdump.py and 2 other locations - About 40 mins to fix
                                deps/v8/tools/grokdump.py on lines 600..602
                                deps/v8/tools/grokdump.py on lines 604..606

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 34.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      if not self.reader.IsValidAddress(address):
                                        f.write("<h3>Address 0x%x not found in the dump.</h3>" % address)
                                        return
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 30 mins to fix
                                deps/v8/tools/grokdump.py on lines 2275..2277

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 32.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      if not self.reader.IsValidAddress(address):
                                        f.write("<h3>Address 0x%x not found in the dump.</h3>" % address)
                                        return
                                Severity: Minor
                                Found in deps/v8/tools/grokdump.py and 1 other location - About 30 mins to fix
                                deps/v8/tools/grokdump.py on lines 2420..2422

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 32.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                There are no issues that match your filters.

                                Category
                                Status