deps/v8/tools/generate-runtime-tests.py

Summary

Maintainability
F
1 wk
Test Coverage

File generate-runtime-tests.py has 1175 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

Severity: Major
Found in deps/v8/tools/generate-runtime-tests.py - About 3 days to fix

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

    def Main():
      parser = BuildOptionParser()
      (options, args) = parser.parse_args()
    
      if not ProcessOptions(options, args):
    Severity: Minor
    Found in deps/v8/tools/generate-runtime-tests.py - About 7 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

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

      Function RunFuzzer has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

      def RunFuzzer(process_id, options, stop_running):
        MAX_SLEEP_TIME = 0.1
        INITIAL_SLEEP_TIME = 0.001
        SLEEP_TIME_FACTOR = 1.25
        base_file_name = "/dev/shm/runtime_fuzz_%d" % process_id
      Severity: Minor
      Found in deps/v8/tools/generate-runtime-tests.py - About 5 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

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

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

      def FindRuntimeFunctions():
        inline_functions = FindInlineRuntimeFunctions()
        functions = []
        expanded_lines = ReadFileAndExpandMacros(FILENAME)
        function = None
      Severity: Minor
      Found in deps/v8/tools/generate-runtime-tests.py - About 4 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function FindJSBuiltins has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      def FindJSBuiltins():
        PATH = "src"
        fileslist = []
        for (root, dirs, files) in os.walk(PATH):
          for f in files:
      Severity: Minor
      Found in deps/v8/tools/generate-runtime-tests.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

      Function ReadFileAndExpandMacros has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      def ReadFileAndExpandMacros(filename):
        found_macros = {}
        expanded_lines = []
        with open(filename, "r") as f:
          found_macro = None
      Severity: Minor
      Found in deps/v8/tools/generate-runtime-tests.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 FindInlineRuntimeFunctions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def FindInlineRuntimeFunctions():
        inline_functions = []
        with open(HEADERFILENAME, "r") as f:
          inline_list = "#define INLINE_FUNCTION_LIST(F) \\\n"
          inline_function = re.compile(r"^\s*F\((\w+), \d+, \d+\)\s*\\?")
      Severity: Minor
      Found in deps/v8/tools/generate-runtime-tests.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 __str__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def __str__(self):
          s = [self.name, "("]
          argcount = self.argslength
          if argcount < 0:
            print("WARNING: unknown argslength for function %s" % self.name)
      Severity: Minor
      Found in deps/v8/tools/generate-runtime-tests.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 t in NON_JS_TYPES:
                  decision = cctest_fuzzable_functions
                else:
                  assert Generator.IsTypeSupported(t), \
                      ("type generator not found for %s, function: %s" % (t, f))
      Severity: Major
      Found in deps/v8/tools/generate-runtime-tests.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                    if line.strip() == "# Allocation failed - process out of memory":
                      oom = True
                      break
                if oom: continue
        Severity: Major
        Found in deps/v8/tools/generate-runtime-tests.py - About 45 mins to fix

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

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

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Avoid deeply nested control flow statements.
          Open

                      if time.time() >= end_time:
                        # Kill the process and wait for it to exit.
                        os.kill(process.pid, signal.SIGTERM)
                        exit_code = process.wait()
                        timed_out = True
          Severity: Major
          Found in deps/v8/tools/generate-runtime-tests.py - About 45 mins to fix

            Avoid too many return statements within this function.
            Open

                  return self._SlicedString(name)
            Severity: Major
            Found in deps/v8/tools/generate-runtime-tests.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return 0
              Severity: Major
              Found in deps/v8/tools/generate-runtime-tests.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return self._InternalizedString(name)
                Severity: Major
                Found in deps/v8/tools/generate-runtime-tests.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return 0
                  Severity: Major
                  Found in deps/v8/tools/generate-runtime-tests.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return 0
                    Severity: Major
                    Found in deps/v8/tools/generate-runtime-tests.py - About 30 mins to fix

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

                        def _String(self, name, recursion_budget):
                          die = random.random()
                          if die < 0.5:
                            string = random.choice(self.USUAL_SUSPECT_PROPERTIES)
                            return self._Variable(name, "\"%s\"" % string)
                      Severity: Minor
                      Found in deps/v8/tools/generate-runtime-tests.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 _AddProperties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def _AddProperties(self, name, result, recursion_budget):
                          propcount = random.randint(0, 3)
                          propname = None
                          for i in range(propcount):
                            die = random.random()
                      Severity: Minor
                      Found in deps/v8/tools/generate-runtime-tests.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

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

                        def _JSFunction(self, name, recursion_budget):
                          result = self._PlainFunction(name, recursion_budget)
                          self._AddAccessors(name, result, recursion_budget)
                          self._AddProperties(name, result, recursion_budget)
                          self._AddElements(name, result, recursion_budget)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 2 hrs to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 516..521

                      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 56.

                      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 _JSArray(self, name, recursion_budget):
                          result = self._PlainArray(name, recursion_budget)
                          self._AddAccessors(name, result, recursion_budget)
                          self._AddProperties(name, result, recursion_budget)
                          self._AddElements(name, result, recursion_budget)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 2 hrs to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 581..586

                      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 56.

                      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

                        plain_arg_parser = ArgParser(
                            re.compile("^\s*CONVERT_ARG_CHECKED\((\w+), (\w+), (\d+)\)"),
                            lambda match: Arg(match.group(1), match.group(2), int(match.group(3))))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 2 hrs to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 802..804
                      deps/v8/tools/generate-runtime-tests.py on lines 822..825

                      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

                        number_arg_parser = ArgParser(
                            re.compile(
                                "^\s*CONVERT_NUMBER_CHECKED\(\w+, (\w+), (\w+), args\[(\d+)\]\)"),
                            lambda match: Arg(match.group(2), match.group(1), int(match.group(3))))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 2 hrs to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 802..804
                      deps/v8/tools/generate-runtime-tests.py on lines 806..808

                      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

                        handle_arg_parser = ArgParser(
                            re.compile("^\s*CONVERT_ARG_HANDLE_CHECKED\((\w+), (\w+), (\d+)\)"),
                            lambda match: Arg(match.group(1), match.group(2), int(match.group(3))))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 2 hrs to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 806..808
                      deps/v8/tools/generate-runtime-tests.py on lines 822..825

                      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 2 locations. Consider refactoring.
                      Open

                        def _SeqTwoByteString(self, name):
                          s1 = self._RawRandomString(1, 5)
                          s2 = self._RawRandomString(1, 5)
                          # 'foo' + unicode + 'bar'
                          return self._Variable(name, "\"%s\" + \"\\2082\" + \"%s\"" % (s1, s2))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 2 hrs to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 390..395

                      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 2 locations. Consider refactoring.
                      Open

                        def _ConsString(self, name):
                          s1 = self._RawRandomString(8, 15)
                          s2 = self._RawRandomString(8, 15)
                          # 'foo12345' + (function() { return 'bar12345';})()
                          return self._Variable(name,
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 2 hrs to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 379..383

                      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

                          elif die < 0.6:
                            number_name = name + "_number"
                            result = self._Number(number_name, recursion_budget)
                            return result + self._Variable(name, "\"\" + %s" % number_name)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 418..421
                      deps/v8/tools/generate-runtime-tests.py on lines 551..554

                      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 46.

                      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 _Symbol(self, name, recursion_budget):
                          raw_string_name = name + "_1"
                          result = self._String(raw_string_name, recursion_budget)
                          return result + self._Variable(name, "Symbol(%s)" % raw_string_name)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 405..408
                      deps/v8/tools/generate-runtime-tests.py on lines 551..554

                      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 46.

                      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

                          elif die < 0.5:
                            ms_name = name + "_ms"
                            result = self._Number(ms_name, recursion_budget)
                            return result + self._Variable(name, "new Date(%s)" % ms_name)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 405..408
                      deps/v8/tools/generate-runtime-tests.py on lines 418..421

                      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 46.

                      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 weak:
                              result += self._JSObject(key_name, recursion_budget - 1)
                            else:
                              result += self._Object(key_name, recursion_budget - 1)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 633..636

                      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 45.

                      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 weak:
                              result += self._JSObject(element_name, recursion_budget - 1)
                            else:
                              result += self._Object(element_name, recursion_budget - 1)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 603..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 45.

                      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 6 locations. Consider refactoring.
                      Open

                        smi_arg_parser = ArgParser(
                            re.compile("^\s*CONVERT_SMI_ARG_CHECKED\((\w+), (\d+)\)"),
                            lambda match: Arg("Smi", match.group(1), int(match.group(2))))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 5 other locations - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 810..812
                      deps/v8/tools/generate-runtime-tests.py on lines 818..820
                      deps/v8/tools/generate-runtime-tests.py on lines 827..829
                      deps/v8/tools/generate-runtime-tests.py on lines 831..833
                      deps/v8/tools/generate-runtime-tests.py on lines 835..837

                      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 44.

                      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 6 locations. Consider refactoring.
                      Open

                        double_arg_parser = ArgParser(
                            re.compile("^\s*CONVERT_DOUBLE_ARG_CHECKED\((\w+), (\d+)\)"),
                            lambda match: Arg("Number", match.group(1), int(match.group(2))))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 5 other locations - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 810..812
                      deps/v8/tools/generate-runtime-tests.py on lines 814..816
                      deps/v8/tools/generate-runtime-tests.py on lines 827..829
                      deps/v8/tools/generate-runtime-tests.py on lines 831..833
                      deps/v8/tools/generate-runtime-tests.py on lines 835..837

                      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 44.

                      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 6 locations. Consider refactoring.
                      Open

                        number_handle_arg_parser = ArgParser(
                            re.compile("^\s*CONVERT_NUMBER_ARG_HANDLE_CHECKED\((\w+), (\d+)\)"),
                            lambda match: Arg("Number", match.group(1), int(match.group(2))))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 5 other locations - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 814..816
                      deps/v8/tools/generate-runtime-tests.py on lines 818..820
                      deps/v8/tools/generate-runtime-tests.py on lines 827..829
                      deps/v8/tools/generate-runtime-tests.py on lines 831..833
                      deps/v8/tools/generate-runtime-tests.py on lines 835..837

                      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 44.

                      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 6 locations. Consider refactoring.
                      Open

                        strict_mode_arg_parser = ArgParser(
                            re.compile("^\s*CONVERT_STRICT_MODE_ARG_CHECKED\((\w+), (\d+)\)"),
                            lambda match: Arg("StrictMode", match.group(1), int(match.group(2))))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 5 other locations - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 810..812
                      deps/v8/tools/generate-runtime-tests.py on lines 814..816
                      deps/v8/tools/generate-runtime-tests.py on lines 818..820
                      deps/v8/tools/generate-runtime-tests.py on lines 831..833
                      deps/v8/tools/generate-runtime-tests.py on lines 835..837

                      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 44.

                      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 6 locations. Consider refactoring.
                      Open

                        boolean_arg_parser = ArgParser(
                            re.compile("^\s*CONVERT_BOOLEAN_ARG_CHECKED\((\w+), (\d+)\)"),
                            lambda match: Arg("Boolean", match.group(1), int(match.group(2))))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 5 other locations - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 810..812
                      deps/v8/tools/generate-runtime-tests.py on lines 814..816
                      deps/v8/tools/generate-runtime-tests.py on lines 818..820
                      deps/v8/tools/generate-runtime-tests.py on lines 827..829
                      deps/v8/tools/generate-runtime-tests.py on lines 835..837

                      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 44.

                      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 6 locations. Consider refactoring.
                      Open

                        property_details_parser = ArgParser(
                            re.compile("^\s*CONVERT_PROPERTY_DETAILS_CHECKED\((\w+), (\d+)\)"),
                            lambda match: Arg("PropertyDetails", match.group(1), int(match.group(2))))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 5 other locations - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 810..812
                      deps/v8/tools/generate-runtime-tests.py on lines 814..816
                      deps/v8/tools/generate-runtime-tests.py on lines 818..820
                      deps/v8/tools/generate-runtime-tests.py on lines 827..829
                      deps/v8/tools/generate-runtime-tests.py on lines 831..833

                      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 44.

                      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 die < 0.67:
                              offset_name = name + "_offset"
                              args.append(offset_name)
                              result += self._Int32(offset_name)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 680..683

                      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 43.

                      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 die < 0.33:
                              length_name = name + "_length"
                              args.append(length_name)
                              result += self._Int32(length_name)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 676..679

                      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 43.

                      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 _JSReceiver(self, name, recursion_budget):
                          if random.random() < 0.9: return self._JSObject(name, recursion_budget)
                          return self._JSProxy(name, recursion_budget)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 423..426

                      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

                        def _Name(self, name, recursion_budget):
                          if random.random() < 0.2:
                            return self._Symbol(name, recursion_budget)
                          return self._String(name, recursion_budget)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 724..726

                      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

                            function = random.choice([self._JSArrayBuffer, self._JSDataView,
                                                      self._JSDate, self._JSFunctionProxy,
                                                      self._JSGeneratorObject, self._JSMap,
                                                      self._JSMapIterator, self._JSRegExp,
                                                      self._JSSet, self._JSSetIterator,
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
                      deps/v8/tools/testrunner/objects/context.py on lines 51..54

                      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 40.

                      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

                      WORKSPACE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 1 hr to fix
                      deps/v8/tools/external-reference-check.py on lines 15..15

                      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

                          if die < 0.5:
                            value = random.choice([-5, -1, 0, 1, 2, 3, 0x3fffffff, -0x40000000])
                          elif die < 0.75:
                            value = random.randint(-1000, 1000)
                          else:
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 45 mins to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 322..328
                      deps/v8/tools/generate-runtime-tests.py on lines 333..339

                      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

                          if die < 0.5:
                            value = random.choice([0, 1, 2, 3, 4, 8, 0x3fffffff, 0x40000000,
                                                   0x7fffffff, 0xffffffff])
                          elif die < 0.75:
                            value = random.randint(0, 1000)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 45 mins to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 322..328
                      deps/v8/tools/generate-runtime-tests.py on lines 344..349

                      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 2 locations. Consider refactoring.
                      Open

                            return (result +
                                    self._Variable(name,
                                                   "new %sArray(%s)" % (arraytype, arraylike_name),
                                                   fallback="new %sArray(8)" % arraytype))
                      Severity: Minor
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 45 mins to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 658..660

                      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

                          if die < 0.5:
                            value = random.choice([-3, -1, 0, 1, 2, 10, 515, 0x3fffffff, 0x7fffffff,
                                                   0x40000000, -0x40000000, -0x80000000])
                          elif die < 0.75:
                            value = random.randint(-1000, 1000)
                      Severity: Major
                      Found in deps/v8/tools/generate-runtime-tests.py and 2 other locations - About 45 mins to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 333..339
                      deps/v8/tools/generate-runtime-tests.py on lines 344..349

                      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 2 locations. Consider refactoring.
                      Open

                            return (result +
                                    self._Variable(name, "new %sArray(%s)" % (arraytype, input_name),
                                                   fallback="new %sArray(8)" % arraytype))
                      Severity: Minor
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 45 mins to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 667..670

                      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 2 locations. Consider refactoring.
                      Open

                          if die < 0.33:
                            result = self._String(raw_name, recursion_budget)
                            return result + self._Variable(name, "new String(%s)" % raw_name)
                      Severity: Minor
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 45 mins to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 434..436

                      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 2 locations. Consider refactoring.
                      Open

                          elif die < 0.66:
                            result = self._Boolean(raw_name, recursion_budget)
                            return result + self._Variable(name, "new Boolean(%s)" % raw_name)
                      Severity: Minor
                      Found in deps/v8/tools/generate-runtime-tests.py and 1 other location - About 45 mins to fix
                      deps/v8/tools/generate-runtime-tests.py on lines 431..433

                      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

                      There are no issues that match your filters.

                      Category
                      Status