KarrLab/test_history_server

View on GitHub
test_history_server/html/views.py

Summary

Maintainability
F
2 wks
Test Coverage

File views.py has 716 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" HTML GUI views
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2016-11-01
:Copyright: 2016, Karr Lab
:License: MIT
Severity: Major
Found in test_history_server/html/views.py - About 1 day to fix

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

    def sitemap(request):
        ''' Returns site map in XML
    
        Args:
            request (:obj:`django.http.request.HttpRequest`): HTTP request
    Severity: Minor
    Found in test_history_server/html/views.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 classname has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    def classname(request, owner, repo, classname):
        ''' Returns HTML for test class page which displays a list of builds/reports
        which includes the test class and the test cases within the class.
    
        Args:
    Severity: Minor
    Found in test_history_server/html/views.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 repo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def repo(request, owner, repo):
        ''' Returns HTML for repository page which displays tables of builds/reports
        and test classes.
    
        Args:
    Severity: Minor
    Found in test_history_server/html/views.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 branch has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    def branch(request, owner, repo, branch):
        repo = Repository.objects.get(owner=owner, name=repo)
    
        #statistics
        report_objs = repo.reports.filter(repository_branch=branch)
    Severity: Minor
    Found in test_history_server/html/views.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 build has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def build(request, owner, repo, build):
        ''' Returns HTML for build page which displays a list of reports which
        includes build and the test classes included in the build.
    
        Args:
    Severity: Minor
    Found in test_history_server/html/views.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 report has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def report(request, owner, repo, build, report):
    Severity: Minor
    Found in test_history_server/html/views.py - About 35 mins to fix

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

      def case(request, owner, repo, classname, case):
      Severity: Minor
      Found in test_history_server/html/views.py - About 35 mins to fix

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

        def case(request, owner, repo, classname, case):
            ''' Returns HTML for test case page which displays a list of builds/reports
            which include the test case.
        
            Args:
        Severity: Minor
        Found in test_history_server/html/views.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

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

            for report in repo.reports.order_by('-build_number', 'name').annotate(time=Sum('test_suite__test_cases__time')):
                suite = report.test_suite
        
                tests = suite.test_cases.count()
                passes = suite.test_cases.filter(result='pass').count()
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 2 days to fix
        test_history_server/html/views.py on lines 298..328

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

        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 report in report_objs.order_by('-build_number', 'name').annotate(time=Sum('test_suite__test_cases__time')):
                suite = report.test_suite
        
                tests = suite.test_cases.count()
                passes = suite.test_cases.filter(result='pass').count()
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 2 days to fix
        test_history_server/html/views.py on lines 162..192

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

        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 report in reports:
                passes = report.test_suite.test_cases.filter(result='pass').count()
                failures = report.test_suite.test_cases.filter(result='failure').count()
                errors = report.test_suite.test_cases.filter(result='error').count()
        
        
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 2 days to fix
        test_history_server/html/views.py on lines 144..158

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

        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 report in reports:
                passes = report.test_suite.test_cases.filter(result='pass').count()
                failures = report.test_suite.test_cases.filter(result='failure').count()
                errors = report.test_suite.test_cases.filter(result='error').count()
        
        
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 2 days to fix
        test_history_server/html/views.py on lines 280..294

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

        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 module in modules:
                last_case = TestCase.objects.filter(test_suite__report__repository=repo, classname=module['classname'])\
                    .order_by('-test_suite__report__build_number', 'test_suite__report__name')[0]
        
                modules_html.append({
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 6 hrs to fix
        test_history_server/html/views.py on lines 203..213

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

        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 module in modules:
                last_case = TestCase.objects.filter(test_suite__report__repository=repo, classname=module['classname'])\
                    .order_by('-test_suite__report__build_number', 'test_suite__report__name')[0]
        
                modules_html.append({
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 6 hrs to fix
        test_history_server/html/views.py on lines 339..349

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 98.

        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

            statistics = {
                'builds': report_objs.aggregate(builds=Count('build_number', distinct=True))['builds'],
                'reports': report_objs.count(),
                'classes': report_objs.values('test_suite__test_cases__classname').distinct().count(),
                'cases': report_objs.values('test_suite__test_cases__classname', 'test_suite__test_cases__name').distinct().count(),
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 5 hrs to fix
        test_history_server/html/views.py on lines 115..125

        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

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

            statistics = {
                'builds': reports.aggregate(builds=Count('build_number', distinct=True))['builds'],
                'reports': reports.count(),
                'classes': reports.values('test_suite__test_cases__classname').distinct().count(),
                'cases': reports.values('test_suite__test_cases__classname', 'test_suite__test_cases__name').distinct().count(),
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 5 hrs to fix
        test_history_server/html/views.py on lines 251..261

        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

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

            if fails.count() > 0:
                last_fail = fails[0]
                last_fail_build = last_fail.build_number
                last_fail_date = last_fail.date
            else:
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 2 hrs to fix
        test_history_server/html/views.py on lines 98..104
        test_history_server/html/views.py on lines 107..113
        test_history_server/html/views.py on lines 234..240
        test_history_server/html/views.py on lines 243..249
        test_history_server/html/views.py on lines 387..393
        test_history_server/html/views.py on lines 558..564
        test_history_server/html/views.py on lines 567..573

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            if passes.count() > 0:
                last_pass = passes[0]
                last_pass_build = last_pass.build_number
                last_pass_date = last_pass.date
            else:
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 2 hrs to fix
        test_history_server/html/views.py on lines 98..104
        test_history_server/html/views.py on lines 107..113
        test_history_server/html/views.py on lines 234..240
        test_history_server/html/views.py on lines 243..249
        test_history_server/html/views.py on lines 387..393
        test_history_server/html/views.py on lines 396..402
        test_history_server/html/views.py on lines 567..573

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            if passes.count() > 0:
                last_pass = passes[0]
                last_pass_build = last_pass.build_number
                last_pass_date = last_pass.date
            else:
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 2 hrs to fix
        test_history_server/html/views.py on lines 98..104
        test_history_server/html/views.py on lines 107..113
        test_history_server/html/views.py on lines 243..249
        test_history_server/html/views.py on lines 387..393
        test_history_server/html/views.py on lines 396..402
        test_history_server/html/views.py on lines 558..564
        test_history_server/html/views.py on lines 567..573

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            if fails.count() > 0:
                last_fail = fails[0]
                last_fail_build = last_fail.build_number
                last_fail_date = last_fail.date
            else:
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 2 hrs to fix
        test_history_server/html/views.py on lines 98..104
        test_history_server/html/views.py on lines 107..113
        test_history_server/html/views.py on lines 234..240
        test_history_server/html/views.py on lines 243..249
        test_history_server/html/views.py on lines 387..393
        test_history_server/html/views.py on lines 396..402
        test_history_server/html/views.py on lines 558..564

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            if passes.count() > 0:
                last_pass = passes[0]
                last_pass_build = last_pass.build_number
                last_pass_date = last_pass.date
            else:
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 2 hrs to fix
        test_history_server/html/views.py on lines 107..113
        test_history_server/html/views.py on lines 234..240
        test_history_server/html/views.py on lines 243..249
        test_history_server/html/views.py on lines 387..393
        test_history_server/html/views.py on lines 396..402
        test_history_server/html/views.py on lines 558..564
        test_history_server/html/views.py on lines 567..573

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            if fails.count() > 0:
                last_fail = fails[0]
                last_fail_build = last_fail.build_number
                last_fail_date = last_fail.date
            else:
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 2 hrs to fix
        test_history_server/html/views.py on lines 98..104
        test_history_server/html/views.py on lines 107..113
        test_history_server/html/views.py on lines 234..240
        test_history_server/html/views.py on lines 387..393
        test_history_server/html/views.py on lines 396..402
        test_history_server/html/views.py on lines 558..564
        test_history_server/html/views.py on lines 567..573

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            if fails.count() > 0:
                last_fail = fails[0]
                last_fail_build = last_fail.build_number
                last_fail_date = last_fail.date
            else:
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 2 hrs to fix
        test_history_server/html/views.py on lines 98..104
        test_history_server/html/views.py on lines 234..240
        test_history_server/html/views.py on lines 243..249
        test_history_server/html/views.py on lines 387..393
        test_history_server/html/views.py on lines 396..402
        test_history_server/html/views.py on lines 558..564
        test_history_server/html/views.py on lines 567..573

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            if passes.count() > 0:
                last_pass = passes[0]
                last_pass_build = last_pass.build_number
                last_pass_date = last_pass.date
            else:
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 2 hrs to fix
        test_history_server/html/views.py on lines 98..104
        test_history_server/html/views.py on lines 107..113
        test_history_server/html/views.py on lines 234..240
        test_history_server/html/views.py on lines 243..249
        test_history_server/html/views.py on lines 396..402
        test_history_server/html/views.py on lines 558..564
        test_history_server/html/views.py on lines 567..573

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

            modules = cases.values('classname').annotate(
                cases=Count('name', distinct=True),
                builds=Count('test_suite__report__build_number', distinct=True),
                reports=Count('test_suite__report', distinct=True),
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 1 hr to fix
        test_history_server/html/views.py on lines 197..200

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

        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

            modules = cases.values('classname').annotate(
                cases=Count('name', distinct=True),
                builds=Count('test_suite__report__build_number', distinct=True),
                reports=Count('test_suite__report', distinct=True),
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 1 hr to fix
        test_history_server/html/views.py on lines 333..336

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

        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 report.build_number not in repo_dict['builds']:
                            repo_dict['builds'][report.build_number] = set()
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 1 hr to fix
        test_history_server/html/views.py on lines 825..826

        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

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

                        if case.classname not in repo_dict['classnames']:
                            repo_dict['classnames'][case.classname] = set()
        Severity: Major
        Found in test_history_server/html/views.py and 1 other location - About 1 hr to fix
        test_history_server/html/views.py on lines 820..821

        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

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

            passes = reports.exclude(Q(test_suite__test_cases__result='failure') | Q(test_suite__test_cases__result='error')).order_by('-build_number')
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 45 mins to fix
        test_history_server/html/views.py on lines 106..106
        test_history_server/html/views.py on lines 233..233
        test_history_server/html/views.py on lines 242..242
        test_history_server/html/views.py on lines 386..386
        test_history_server/html/views.py on lines 395..395
        test_history_server/html/views.py on lines 557..557
        test_history_server/html/views.py on lines 566..566

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

            fails = reports.filter(Q(test_suite__test_cases__result='failure') | Q(test_suite__test_cases__result='error')).order_by('-build_number')
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 45 mins to fix
        test_history_server/html/views.py on lines 97..97
        test_history_server/html/views.py on lines 233..233
        test_history_server/html/views.py on lines 242..242
        test_history_server/html/views.py on lines 386..386
        test_history_server/html/views.py on lines 395..395
        test_history_server/html/views.py on lines 557..557
        test_history_server/html/views.py on lines 566..566

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

            passes = reports.exclude(Q(test_suite__test_cases__result='failure') | Q(test_suite__test_cases__result='error')).order_by('-build_number')
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 45 mins to fix
        test_history_server/html/views.py on lines 97..97
        test_history_server/html/views.py on lines 106..106
        test_history_server/html/views.py on lines 233..233
        test_history_server/html/views.py on lines 242..242
        test_history_server/html/views.py on lines 395..395
        test_history_server/html/views.py on lines 557..557
        test_history_server/html/views.py on lines 566..566

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

            passes = reports.exclude(Q(test_suite__test_cases__result='failure') | Q(test_suite__test_cases__result='error')).order_by('-build_number')
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 45 mins to fix
        test_history_server/html/views.py on lines 97..97
        test_history_server/html/views.py on lines 106..106
        test_history_server/html/views.py on lines 233..233
        test_history_server/html/views.py on lines 242..242
        test_history_server/html/views.py on lines 386..386
        test_history_server/html/views.py on lines 395..395
        test_history_server/html/views.py on lines 566..566

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

            fails = reports.filter(Q(test_suite__test_cases__result='failure') | Q(test_suite__test_cases__result='error')).order_by('-build_number')
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 45 mins to fix
        test_history_server/html/views.py on lines 97..97
        test_history_server/html/views.py on lines 106..106
        test_history_server/html/views.py on lines 233..233
        test_history_server/html/views.py on lines 242..242
        test_history_server/html/views.py on lines 386..386
        test_history_server/html/views.py on lines 557..557
        test_history_server/html/views.py on lines 566..566

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

            passes = report_objs.exclude(Q(test_suite__test_cases__result='failure') | Q(test_suite__test_cases__result='error')).order_by('-build_number')
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 45 mins to fix
        test_history_server/html/views.py on lines 97..97
        test_history_server/html/views.py on lines 106..106
        test_history_server/html/views.py on lines 242..242
        test_history_server/html/views.py on lines 386..386
        test_history_server/html/views.py on lines 395..395
        test_history_server/html/views.py on lines 557..557
        test_history_server/html/views.py on lines 566..566

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

            fails = report_objs.filter(Q(test_suite__test_cases__result='failure') | Q(test_suite__test_cases__result='error')).order_by('-build_number')
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 45 mins to fix
        test_history_server/html/views.py on lines 97..97
        test_history_server/html/views.py on lines 106..106
        test_history_server/html/views.py on lines 233..233
        test_history_server/html/views.py on lines 386..386
        test_history_server/html/views.py on lines 395..395
        test_history_server/html/views.py on lines 557..557
        test_history_server/html/views.py on lines 566..566

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

            fails = reports.filter(Q(test_suite__test_cases__result='failure') | Q(test_suite__test_cases__result='error')).order_by('-build_number')
        Severity: Major
        Found in test_history_server/html/views.py and 7 other locations - About 45 mins to fix
        test_history_server/html/views.py on lines 97..97
        test_history_server/html/views.py on lines 106..106
        test_history_server/html/views.py on lines 233..233
        test_history_server/html/views.py on lines 242..242
        test_history_server/html/views.py on lines 386..386
        test_history_server/html/views.py on lines 395..395
        test_history_server/html/views.py on lines 557..557

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 35.

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

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

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

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

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status