ArturSpirin/test_junkie

View on GitHub

Showing 113 of 184 total issues

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

        print(". Test Junkie {} (Python{}) {} .".format(
            pkg_resources.require("test-junkie")[0].version, sys.version_info[0], DocumentationLinks.DOMAIN)
Severity: Minor
Found in test_junkie/metrics.py and 1 other location - About 45 mins to fix
test_junkie/cli/cli.py on lines 198..201

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

Avoid deeply nested control flow statements.
Open

                        if status not in not_defined:
                            not_defined.update({status: metrics[status]})
                        else:
                            not_defined[status] += metrics[status]
                else:
Severity: Major
Found in test_junkie/reporter/html_reporter.py - About 45 mins to fix

    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

    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

                              for param, param_data in class_param_data.items():
                                  if param != "None":
                                      print("\t    |__ parameter: {parameter}".format(parameter=param))
                                  for index in range(param_data["retry"]):
                                      trace = param_data["tracebacks"][index]
      Severity: Major
      Found in test_junkie/metrics.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                for i in CliAudit.__SECTIONS:
                                    if i in context:
                                        msg = "\t"
                                        counter = 0
                                        _sorted_context = sorted(context[i].items(), key=lambda x: x[1])
        Severity: Major
        Found in test_junkie/cli/cli_audit.py - About 45 mins to fix

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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

                  if active >= self.__test_limit:
                      LogJunkie.debug("Test limit: {}/{}".format(active, self.__test_limit))
                      return True
          Severity: Minor
          Found in test_junkie/parallels.py and 1 other location - About 35 mins to fix
          test_junkie/parallels.py on lines 78..80

          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

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

                  if active >= self.__suite_limit:
                      LogJunkie.debug("Suite limit: {}/{}".format(active, self.__suite_limit))
                      return True
          Severity: Minor
          Found in test_junkie/parallels.py and 1 other location - About 35 mins to fix
          test_junkie/parallels.py on lines 92..94

          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

          Avoid too many return statements within this function.
          Open

                          return True
          Severity: Major
          Found in test_junkie/objects.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

              Avoid too many return statements within this function.
              Open

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

                Avoid too many return statements within this function.
                Open

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

                  Avoid too many return statements within this function.
                  Open

                              return True
                  Severity: Major
                  Found in test_junkie/objects.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

                      Avoid too many return statements within this function.
                      Open

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

                        Avoid too many return statements within this function.
                        Open

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

                          Remove this commented out code.
                          Open

                                              # tb = traceback.replace("\n", "<br>").replace("    ", "&emsp;")

                          Programmers should not comment out code as it bloats programs and reduces readability.

                          Unused code should be deleted and can be retrieved from source control history if required.

                          See

                          • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
                          • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
                          • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
                          • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"
                          Severity
                          Category
                          Status
                          Source
                          Language