ArturSpirin/test_junkie

View on GitHub
test_junkie/runner.py

Summary

Maintainability
C
1 day
Test Coverage

File runner.py has 671 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

import copy
import inspect
import threading
import time
import traceback
Severity: Major
Found in test_junkie/runner.py - About 1 day to fix

    Function __process_event has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Wontfix

        def __process_event(event, suite, test=None, param=None, class_param=None, error=None, formatted_traceback=None):
    Severity: Minor
    Found in test_junkie/runner.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if suite_retry_attempt > 1:
                                  unsuccessful_tests = suite.get_unsuccessful_tests()
                                  LogJunkie.debug("There are {} unsuccessful tests that need to be retried"
                                                  .format(len(unsuccessful_tests)))
                                  if not unsuccessful_tests:
      Severity: Major
      Found in test_junkie/runner.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                while tests:
                                    for test in list(tests):
        
                                        test_start_time = time.time()  # will use in case of a failure in context of this loop
        
        
        Severity: Major
        Found in test_junkie/runner.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if inspect.getsource(test.get_function_object()) == inspect.getsource(t):
                                      requested = True
                                      break
                              else:
          Severity: Major
          Found in test_junkie/runner.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if self.__processor.suite_multithreading() and suite_object.is_parallelized():
                                            while True:
                                                if self.__processor.suite_qualifies(suite_object):
                                                    time.sleep(Limiter.get_suite_throttling())
                                                    self.__executed_suites.append(suite_object)
            Severity: Major
            Found in test_junkie/runner.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if test.get_function_name() in self.__settings.tests:
                                          requested = True
                                          break
                          else:
              Severity: Major
              Found in test_junkie/runner.py - About 45 mins to fix

                Function __run_test has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Wontfix

                    def __run_test(suite, test, parameter=None, class_parameter=None, before_class_error=None, cancel=False):
                Severity: Minor
                Found in test_junkie/runner.py - About 35 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return
                  Severity: Major
                  Found in test_junkie/runner.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Wontfix

                            return True
                    Severity: Major
                    Found in test_junkie/runner.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                                  return
                      Severity: Major
                      Found in test_junkie/runner.py - About 30 mins to fix

                        Refactor this function to reduce its Cognitive Complexity from 28 to the 15 allowed.
                        Open

                            def __positive_skip_condition(self, test):
                        Severity: Critical
                        Found in test_junkie/runner.py by sonar-python

                        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                        See

                        Refactor this function to reduce its Cognitive Complexity from 41 to the 15 allowed.
                        Open

                            def __runnable_tags(test, tag_config):
                        Severity: Critical
                        Found in test_junkie/runner.py by sonar-python

                        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                        See

                        Refactor this function to reduce its Cognitive Complexity from 22 to the 15 allowed.
                        Open

                            def __prioritize(suites=None, suite_object=None):
                        Severity: Critical
                        Found in test_junkie/runner.py by sonar-python

                        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                        See

                        Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
                        Open

                            def __process_decorator(decorator_type, suite, test=None, parameter=None,  class_parameter=None):
                        Severity: Critical
                        Found in test_junkie/runner.py by sonar-python

                        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                        See

                        Refactor this function to reduce its Cognitive Complexity from 38 to the 15 allowed.
                        Open

                            def run(self, **kwargs):
                        Severity: Critical
                        Found in test_junkie/runner.py by sonar-python

                        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                        See

                        Refactor this function to reduce its Cognitive Complexity from 142 to the 15 allowed.
                        Open

                            def __run_suite(self, suite):
                        Severity: Critical
                        Found in test_junkie/runner.py by sonar-python

                        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                        See

                        Refactor this function to reduce its Cognitive Complexity from 77 to the 15 allowed.
                        Open

                            def __run_test(suite, test, parameter=None, class_parameter=None, before_class_error=None, cancel=False):
                        Severity: Critical
                        Found in test_junkie/runner.py by sonar-python

                        Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                        See

                        Either merge this branch with the identical one on line "426" or change one of the implementations.
                        Open

                                            return  # fixes ticket: #27
                        Severity: Major
                        Found in test_junkie/runner.py by sonar-python

                        Having two branches in the same if structure with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then they should be combined.

                        Noncompliant Code Example

                        if 0 <= a < 10:
                            do_the_thing()
                        elif 10 <= a < 20:
                            do_the_other_thing()
                        elif 20 <= a < 50:
                            do_the_thing()  # Noncompliant; duplicates first condition
                        else:
                            do_the_rest()
                        
                        b = 4 if a > 12 else 4
                        

                        Compliant Solution

                        if (0 <= a < 10) or (20 <= a < 50):
                            do_the_thing()
                        elif 10 <= a < 20:
                            do_the_other_thing()
                        else:
                            do_the_rest()
                        
                        b = 4
                        

                        or

                        if 0 <= a < 10:
                            do_the_thing()
                        elif 10 <= a < 20:
                            do_the_other_thing()
                        elif 20 <= a < 50:
                            do_the_third_thing()
                        else:
                            do_the_rest()
                        
                        b = 8 if a > 12 else 4
                        

                        Rename field "__stats" to prevent any misunderstanding/clash with field "__STATS" defined on line 24
                        Open

                                self.__stats = {}
                        Severity: Blocker
                        Found in test_junkie/runner.py by sonar-python

                        Looking at the set of methods and fields in a class and finding two that differ only by capitalization is confusing to users of the class.

                        This situation may simply indicate poor naming. Method names should be action-oriented, and thus contain a verb, which is unlikely in the case where both a method and a field have the same name (with or without capitalization differences). However, renaming a public method could be disruptive to callers. Therefore renaming the member is the recommended action.

                        Noncompliant Code Example

                        class SomeClass:
                            lookUp = false
                            def lookup():       # Non-compliant; method name differs from field name only by capitalization
                                pass
                        

                        Compliant Solution

                        class SomeClass:
                            lookUp = false
                            def getLookUp():
                                pass
                        

                        Merge this if statement with the enclosing one.
                        Open

                                                if record_test_failure:  # Test failed and failure was already recorded thus can't pass it
                        Severity: Major
                        Found in test_junkie/runner.py by sonar-python

                        Merging collapsible if statements increases the code's readability.

                        Noncompliant Code Example

                        if condition1:
                            if condition2:
                                # ...
                        

                        Compliant Solution

                        if condition1 and condition2:
                            # ...
                        

                        Merge this if statement with the enclosing one.
                        Open

                                                if suite.get_decorated_definition(DecoratorType.AFTER_TEST):
                        Severity: Major
                        Found in test_junkie/runner.py by sonar-python

                        Merging collapsible if statements increases the code's readability.

                        Noncompliant Code Example

                        if condition1:
                            if condition2:
                                # ...
                        

                        Compliant Solution

                        if condition1 and condition2:
                            # ...
                        

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

                                try:
                                    suite.get_rules().before_class()
                                    before_class_error = Runner.__process_decorator(decorator_type=DecoratorType.BEFORE_CLASS,
                                                                                    suite=suite, class_parameter=class_parameter)
                                    if before_class_error is not None:
                        Severity: Major
                        Found in test_junkie/runner.py and 1 other location - About 3 hrs to fix
                        test_junkie/runner.py on lines 516..527

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

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

                                try:
                                    after_class_error = Runner.__process_decorator(decorator_type=DecoratorType.AFTER_CLASS,
                                                                                   suite=suite, class_parameter=class_parameter)
                                    if after_class_error is not None:
                                        raise after_class_error
                        Severity: Major
                        Found in test_junkie/runner.py and 1 other location - About 3 hrs to fix
                        test_junkie/runner.py on lines 500..512

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

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

                                        if not test.skip_after_test():
                                            after_test_error = Runner.__process_decorator(decorator_type=DecoratorType.AFTER_TEST,
                                                                                          suite=suite, class_parameter=class_parameter,
                                                                                          test=test, parameter=parameter)
                                            if after_test_error is not None:  # updating **test** metrics (no decorator passed in)
                        Severity: Major
                        Found in test_junkie/runner.py and 1 other location - About 3 hrs to fix
                        test_junkie/runner.py on lines 359..365

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

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

                                        if not test.skip_before_test():
                                            before_test_error = Runner.__process_decorator(decorator_type=DecoratorType.BEFORE_TEST,
                                                                                           suite=suite, class_parameter=class_parameter,
                                                                                           test=test, parameter=parameter)
                                            if before_test_error is not None:  # updating **test** metrics (no decorator passed in)
                        Severity: Major
                        Found in test_junkie/runner.py and 1 other location - About 3 hrs to fix
                        test_junkie/runner.py on lines 401..407

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

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

                                if can_skip is False and self.__settings.components is not None:
                                    can_skip = not test.get_component() in self.__settings.components
                        Severity: Major
                        Found in test_junkie/runner.py and 1 other location - About 1 hr to fix
                        test_junkie/runner.py on lines 753..754

                        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

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

                                if can_skip is False and self.__settings.owners is not None:
                                    can_skip = not test.get_owner() in self.__settings.owners
                        Severity: Major
                        Found in test_junkie/runner.py and 1 other location - About 1 hr to fix
                        test_junkie/runner.py on lines 749..750

                        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

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

                                                            if not test.is_parallelized():
                                                                LogJunkie.debug("Cant run test: {} in parallel with any other tests"
                                                                                .format(test.get_function_object()))
                                                                ParallelProcessor.wait_currently_active_tests_to_finish()
                        Severity: Major
                        Found in test_junkie/runner.py and 1 other location - About 1 hr to fix
                        test_junkie/runner.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 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

                                                        if not suite_object.is_parallelized():
                                                            LogJunkie.debug("Cant run suite: {} in parallel with any other suites. Waiting for "
                                                                            "parallel suites to finish so I can run it by itself."
                                                                            .format(suite_object.get_class_object()))
                                                            ParallelProcessor.wait_currently_active_suites_to_finish()
                        Severity: Major
                        Found in test_junkie/runner.py and 1 other location - About 1 hr to fix
                        test_junkie/runner.py on lines 277..280

                        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

                                for test in tests:
                                    if test.get_owner() is None:
                                        test.get_kwargs().update({"owner": suite_object.get_owner()})
                        Severity: Minor
                        Found in test_junkie/runner.py and 1 other location - About 45 mins to fix
                        test_junkie/cli/cli_audit.py on lines 120..121

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

                                        if not test.skip_before_test_rule():
                                            suite.get_rules().before_test(test=copy.deepcopy(test))
                        Severity: Minor
                        Found in test_junkie/runner.py and 1 other location - About 35 mins to fix
                        test_junkie/runner.py on lines 408..409

                        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

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

                                        if sys.version_info[0] < 3:
                                            trace = "\n\n{}".format(traceback.format_exc())
                        Severity: Minor
                        Found in test_junkie/runner.py and 1 other location - About 35 mins to fix
                        test_junkie/runner.py on lines 643..644

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

                                        if not test.skip_after_test_rule():
                                            suite.get_rules().after_test(test=copy.deepcopy(test))
                        Severity: Minor
                        Found in test_junkie/runner.py and 1 other location - About 35 mins to fix
                        test_junkie/runner.py on lines 357..358

                        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

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

                                    if sys.version_info[0] < 3:
                                        trace = "\n\n{}".format(traceback.format_exc())
                        Severity: Minor
                        Found in test_junkie/runner.py and 1 other location - About 35 mins to fix
                        test_junkie/runner.py on lines 706..707

                        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