enclose-io/compiler

View on GitHub
lts/deps/v8/tools/testrunner/objects/testcase.py

Summary

Maintainability
F
1 wk
Test Coverage

TestCase has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

class TestCase(object):
  def __init__(self, suite, path, name, test_config):
    self.suite = suite        # TestSuite object

    self.path = path          # string, e.g. 'div-mod', 'test-api/foo'
Severity: Minor
Found in lts/deps/v8/tools/testrunner/objects/testcase.py - About 4 hrs to fix

    File testcase.py has 263 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # Copyright 2012 the V8 project authors. All rights reserved.
    # Redistribution and use in source and binary forms, with or without
    # modification, are permitted provided that the following conditions are
    # met:
    #
    Severity: Minor
    Found in lts/deps/v8/tools/testrunner/objects/testcase.py - About 2 hrs to fix

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

        def _parse_status_file_outcomes(self, outcomes):
          if (statusfile.FAIL_SLOPPY in outcomes and
              '--use-strict' not in self.variant_flags):
            return outproc.OUTCOMES_FAIL
      
      
      Severity: Minor
      Found in lts/deps/v8/tools/testrunner/objects/testcase.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 create_subtest has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def create_subtest(self, processor, subtest_id, variant=None, flags=None,
      Severity: Minor
      Found in lts/deps/v8/tools/testrunner/objects/testcase.py - About 45 mins to fix

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

          def _get_resources(self):
            """Returns the list of files needed by a test case."""
            if not self._get_source_path():
              return []
            result = set()
        Severity: Minor
        Found in lts/deps/v8/tools/testrunner/objects/testcase.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 _get_timeout has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def _get_timeout(self, params):
            timeout = self._test_config.timeout
            if "--stress-opt" in params:
              timeout *= 4
            if "--jitless" in params:
        Severity: Minor
        Found in lts/deps/v8/tools/testrunner/objects/testcase.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 _get_resources_for_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def _get_resources_for_file(self, file):
            """Returns for a given file a list of absolute paths of files needed by the
            given file.
            """
            with open(file) as f:
        Severity: Minor
        Found in lts/deps/v8/tools/testrunner/objects/testcase.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

        class D8TestCase(TestCase):
          def get_shell(self):
            return "d8"
        
          def _get_shell_flags(self):
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 3 days to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 324..375

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

        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 _parse_status_file_outcomes(self, outcomes):
            if (statusfile.FAIL_SLOPPY in outcomes and
                '--use-strict' not in self.variant_flags):
              return outproc.OUTCOMES_FAIL
        
        
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 1 day to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 122..142

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

        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 create_subtest(self, processor, subtest_id, variant=None, flags=None,
                             keep_output=False, random_seed=None):
            subtest = copy.copy(self)
            subtest.origin = self
            subtest.processor = processor
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 1 day to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 92..107

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

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

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

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

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

        Refactorings

        Further Reading

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

          def __init__(self, suite, path, name, test_config):
            self.suite = suite        # TestSuite object
        
            self.path = path          # string, e.g. 'div-mod', 'test-api/foo'
            self.name = name          # string that identifies test in the status file
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 1 day to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 66..90

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

        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 _get_timeout(self, params):
            timeout = self._test_config.timeout
            if "--stress-opt" in params:
              timeout *= 4
            if "--jitless" in params:
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 7 hrs to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 243..257

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

        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 _prepare_outcomes(self, force_update=True):
            if force_update or self._statusfile_outcomes is None:
              def is_flag(outcome):
                return outcome.startswith('--')
              def not_flag(outcome):
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 7 hrs to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 109..120

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

        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 get_command(self):
            params = self._get_cmd_params()
            env = self._get_cmd_env()
            shell = self.get_shell()
            if utils.IsWindows():
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 5 hrs to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 167..175

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

        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 _get_cmd_params(self):
            """Gets command parameters and combines them in the following order:
              - files [empty by default]
              - random seed
              - extra flags (from command line)
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 5 hrs to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 177..199

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

        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 _parse_source_flags(self, source=None):
            source = source or self.get_source()
            flags = []
            for match in re.findall(FLAGS_PATTERN, source):
              flags += shlex.split(match.strip())
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 2 hrs to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 277..282

        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

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

          @property
          def is_pass_or_fail(self):
            return (statusfile.PASS in self._statusfile_outcomes and
                    statusfile.FAIL in self._statusfile_outcomes and
                    statusfile.CRASH not in self._statusfile_outcomes)
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 1 hr to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 157..161

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

        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 __cmp__(self, other):
            # Make sure that test cases are sorted correctly if sorted without
            # key function. But using a key function is preferred for speed.
            return cmp(
                (self.suite.name, self.name, self.variant),
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 1 hr to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 312..317

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 39.

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

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

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

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

        Refactorings

        Further Reading

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

          @property
          def output_proc(self):
            if self.expected_outcomes is outproc.OUTCOMES_PASS:
              return outproc.DEFAULT
            return outproc.OutProc(self.expected_outcomes)
        Severity: Major
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 1 hr to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 306..310

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

          @property
          def do_skip(self):
            return (statusfile.SKIP in self._statusfile_outcomes and
                    not self.suite.test_config.run_skipped)
        Severity: Minor
        Found in lts/deps/v8/tools/testrunner/objects/testcase.py and 1 other location - About 50 mins to fix
        current/deps/v8/tools/testrunner/objects/testcase.py on lines 144..147

        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

        There are no issues that match your filters.

        Category
        Status