tools/test.py

Summary

Maintainability
F
1 wk
Test Coverage

File test.py has 1176 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
#
# Copyright 2008 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 tools/test.py - About 3 days to fix

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

    def Main():
      parser = BuildOptions()
      (options, args) = parser.parse_args()
      if not ProcessOptions(options):
        parser.print_help()
    Severity: Minor
    Found in tools/test.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 RunSingle has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

      def RunSingle(self):
        while not self.terminate:
          try:
            test = self.queue.get_nowait()
          except Empty:
    Severity: Minor
    Found in tools/test.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 ProcessOptions has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def ProcessOptions(options):
      global VERBOSE
      VERBOSE = options.verbose
      options.mode = options.mode.split(',')
      for mode in options.mode:
    Severity: Minor
    Found in tools/test.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 Tokenize has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

      def Tokenize(self):
        self.tokens = [ ]
        while self.HasMore():
          self.SkipSpaces()
          if not self.HasMore():
    Severity: Minor
    Found in tools/test.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 RunProcess has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def RunProcess(context, timeout, args, **rest):
      if context.verbose: print "#", " ".join(args)
      popen_args = args
      prev_error_mode = SEM_INVALID_VALUE;
      if utils.IsWindows():
    Severity: Minor
    Found in tools/test.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 ReadConfigurationInto has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def ReadConfigurationInto(path, sections, defs):
      current_section = Section(Constant(True))
      sections.append(current_section)
      prefix = []
      for line in utils.ReadLinesFrom(path):
    Severity: Minor
    Found in tools/test.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 Done has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      def Done(self):
        print
        for failed in self.failed:
          self.PrintFailureHeader(failed.test)
          if failed.output.stderr:
    Severity: Minor
    Found in tools/test.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 Main has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def Main():
      parser = BuildOptions()
      (options, args) = parser.parse_args()
      if not ProcessOptions(options):
        parser.print_help()
    Severity: Minor
    Found in tools/test.py - About 1 hr to fix

      Function ParseAtomicExpression has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def ParseAtomicExpression(scan):
        if scan.Current() == "true":
          scan.Advance()
          return Constant(True)
        elif scan.Current() == "false":
      Severity: Minor
      Found in tools/test.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 HasRun has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        def HasRun(self, output):
          self._done += 1
          command = basename(output.command[-1])
          if output.UnexpectedOutput():
            status_line = 'not ok %i - %s' % (self._done, command)
      Severity: Minor
      Found in tools/test.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 BuildOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def BuildOptions():
        result = optparse.OptionParser()
        result.add_option("-m", "--mode", help="The test modes in which to run (comma-separated)",
            default='release')
        result.add_option("-v", "--verbose", help="Verbose output",
      Severity: Minor
      Found in tools/test.py - About 1 hr to fix

        Function GetVm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def GetVm(self, mode):
            if mode == 'debug':
              name = 'out/Debug/node'
            else:
              name = 'out/Release/node'
        Severity: Minor
        Found in tools/test.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 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppress_dialogs, store_unexpected_output):
        Severity: Major
        Found in tools/test.py - About 1 hr to fix

          Function HasRun has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            def HasRun(self, output):
              if output.UnexpectedOutput():
                self.ClearLine(self.last_status_length)
                self.PrintFailureHeader(output.test)
                stdout = output.output.stdout.strip()
          Severity: Minor
          Found in tools/test.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 HasRun has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def HasRun(self, output):
              total = self.succeeded + len(self.failed)
              if (total > 1) and (total % 50 == 1):
                sys.stdout.write('\n')
              if output.UnexpectedOutput():
          Severity: Minor
          Found in tools/test.py - About 45 mins to fix

          Cognitive Complexity

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

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

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

          Further reading

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

            def AddTestsToList(self, result, current_path, path, context, mode):
          Severity: Minor
          Found in tools/test.py - About 35 mins to fix

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

              def GetOutcomes(self, env, defs):
                if self.op == '||' or self.op == ',':
                  return self.left.GetOutcomes(env, defs).Union(self.right.GetOutcomes(env, defs))
                elif self.op == 'if':
                  if self.right.Evaluate(env, defs): return self.left.GetOutcomes(env, defs)
            Severity: Minor
            Found in tools/test.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 Variable(name.lower())
            Severity: Major
            Found in tools/test.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

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

                Avoid too many return statements within this function.
                Open

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

                  Avoid too many return statements within this function.
                  Open

                      return result
                  Severity: Major
                  Found in tools/test.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return 1
                    Severity: Major
                    Found in tools/test.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        return result
                      Severity: Major
                      Found in tools/test.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return 1
                        Severity: Major
                        Found in tools/test.py - About 30 mins to fix

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

                          def ParseOperatorExpression(scan):
                            left = ParseAtomicExpression(scan)
                            if not left: return None
                            while scan.HasMore() and (scan.Current() in BINARIES):
                              op = scan.Current()
                          Severity: Minor
                          Found in tools/test.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 Evaluate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def Evaluate(self, env, defs):
                              if self.op == '||' or self.op == ',':
                                return self.left.Evaluate(env, defs) or self.right.Evaluate(env, defs)
                              elif self.op == 'if':
                                return False
                          Severity: Minor
                          Found in tools/test.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

                            while exit_code is None:
                              if (not end_time is None) and (time.time() >= end_time):
                                # Kill the process and wait for it to exit.
                                KillProcessWithID(process.pid)
                                exit_code = process.wait()
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 6 hrs to fix
                          deps/v8/tools/testrunner/local/commands.py on lines 94..105

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

                          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 ParseLogicalExpression(scan):
                            left = ParseConditionalExpression(scan)
                            if not left: return None
                            while scan.HasMore() and (scan.Current() in LOGICALS):
                              op = scan.Current()
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 6 hrs to fix
                          tools/test.py on lines 1021..1031

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

                          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 ParseOperatorExpression(scan):
                            left = ParseAtomicExpression(scan)
                            if not left: return None
                            while scan.HasMore() and (scan.Current() in BINARIES):
                              op = scan.Current()
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 6 hrs to fix
                          tools/test.py on lines 1047..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 99.

                          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 EscapeCommand(command):
                            parts = []
                            for part in command:
                              if ' ' in part:
                                # Escape spaces.  We may need to escape more characters for this
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 2 hrs to fix
                          deps/v8/tools/testrunner/local/progress.py on lines 40..49

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

                          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 GetSuites(test_root):
                            def IsSuite(path):
                              return isdir(path) and exists(join(path, 'testcfg.py'))
                            return [ f for f in os.listdir(test_root) if IsSuite(join(test_root, f)) ]
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 2 hrs to fix
                          deps/v8/tools/testrunner/local/utils.py on lines 38..41

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

                          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 Truncate(self, str, length):
                              if length and (len(str) > (length - 3)):
                                return str[:(length-3)] + "..."
                              else:
                                return str
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 2 hrs to fix
                          deps/v8/tools/testrunner/local/progress.py on lines 186..190

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

                          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 __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppress_dialogs, store_unexpected_output):
                              self.workspace = workspace
                              self.buildspace = buildspace
                              self.verbose = verbose
                              self.vm_root = vm
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 2 hrs to fix
                          tools/gyp/pylib/gyp/generator/ninja.py on lines 132..155

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

                          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 FormatTime(d):
                            millis = round(d * 1000) % 1000
                            return time.strftime("%M:%S.", time.gmtime(d)) + ("%03i" % millis)
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 2 hrs to fix
                          deps/v8/tools/testrunner/local/verbose.py on lines 82..84

                          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

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

                              for entry in timed_tests[:20]:
                                t = FormatTime(entry.duration)
                                sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel()))
                                index += 1
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 2 hrs to fix
                          deps/v8/tools/testrunner/local/verbose.py on lines 96..99

                          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

                            def IsFlaky(o):
                              return (PASS in o) and (FAIL in o) and (not CRASH in o) and (not OKAY in o)
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 1 hr to fix
                          deps/v8/tools/testrunner/local/statusfile.py on lines 77..79

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

                          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 CheckTestMode(name, option):
                              if not option in ["run", "skip", "dontcare"]:
                                print "Unknown %s mode %s" % (name, option)
                                return False
                              return True
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 1 hr to fix
                          deps/v8/tools/run-tests.py on lines 358..362

                          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

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

                          def KillProcessWithID(pid):
                            if utils.IsWindows():
                              os.popen('taskkill /T /F /PID %d' % pid)
                            else:
                              os.kill(pid, signal.SIGTERM)
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 1 hr to fix
                          deps/v8/tools/testrunner/local/commands.py on lines 40..44

                          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

                          def Win32SetErrorMode(mode):
                            prev_error_mode = SEM_INVALID_VALUE
                            try:
                              import ctypes
                              prev_error_mode = ctypes.windll.kernel32.SetErrorMode(mode);
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 1 hr to fix
                          deps/v8/tools/testrunner/local/commands.py on lines 55..63

                          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

                              if (total > 1) and (total % 50 == 1):
                                sys.stdout.write('\n')
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 1 hr to fix
                          deps/v8/tools/testrunner/local/progress.py on lines 136..137

                          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 __init__(self, test, command, output, store_unexpected_output):
                              self.test = test
                              self.command = command
                              self.output = output
                              self.store_unexpected_output = store_unexpected_output
                          Severity: Major
                          Found in tools/test.py and 1 other location - About 1 hr to fix
                          deps/v8/tools/testrunner/objects/output.py on lines 35..39

                          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 __init__(self, exit_code, timed_out, stdout, stderr):
                              self.exit_code = exit_code
                              self.timed_out = timed_out
                              self.stdout = stdout
                              self.stderr = stderr
                          Severity: Minor
                          Found in tools/test.py and 1 other location - About 50 mins to fix
                          deps/v8/tools/testrunner/local/execution.py on lines 40..45

                          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

                          class Everything(Set):
                          
                            def Intersect(self, that):
                              return that
                          
                          
                          Severity: Minor
                          Found in tools/test.py and 1 other location - About 35 mins to fix
                          tools/test.py on lines 859..868

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

                          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

                          class Nothing(Set):
                          
                            def Intersect(self, that):
                              return self
                          
                          
                          Severity: Minor
                          Found in tools/test.py and 1 other location - About 35 mins to fix
                          tools/test.py on lines 847..856

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

                          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