inasafe/inasafe

View on GitHub
safe/report/expressions/html_report.py

Summary

Maintainability
F
2 wks
Test Coverage

File html_report.py has 516 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding=utf-8

"""QGIS Expressions which are available in the QGIS GUI interface."""

from os.path import dirname, join, exists
Severity: Major
Found in safe/report/expressions/html_report.py - About 1 day to fix

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def minimum_needs_report(feature, parent):
        """Retrieve the minimum needs section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 257..275
    safe/report/expressions/html_report.py on lines 286..304
    safe/report/expressions/html_report.py on lines 315..333
    safe/report/expressions/html_report.py on lines 344..362
    safe/report/expressions/html_report.py on lines 373..391
    safe/report/expressions/html_report.py on lines 402..420
    safe/report/expressions/html_report.py on lines 460..478
    safe/report/expressions/html_report.py on lines 489..508
    safe/report/expressions/html_report.py on lines 519..538

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def analysis_detail_report(feature, parent):
        """Retrieve the analysis detail section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 257..275
    safe/report/expressions/html_report.py on lines 286..304
    safe/report/expressions/html_report.py on lines 315..333
    safe/report/expressions/html_report.py on lines 373..391
    safe/report/expressions/html_report.py on lines 402..420
    safe/report/expressions/html_report.py on lines 431..449
    safe/report/expressions/html_report.py on lines 460..478
    safe/report/expressions/html_report.py on lines 489..508
    safe/report/expressions/html_report.py on lines 519..538

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def action_checklist_report(feature, parent):
        """Retrieve the action checklist section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 257..275
    safe/report/expressions/html_report.py on lines 286..304
    safe/report/expressions/html_report.py on lines 315..333
    safe/report/expressions/html_report.py on lines 344..362
    safe/report/expressions/html_report.py on lines 402..420
    safe/report/expressions/html_report.py on lines 431..449
    safe/report/expressions/html_report.py on lines 460..478
    safe/report/expressions/html_report.py on lines 489..508
    safe/report/expressions/html_report.py on lines 519..538

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def aggregation_postprocessors_report(feature, parent):
        """Retrieve the aggregation postprocessors section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 257..275
    safe/report/expressions/html_report.py on lines 286..304
    safe/report/expressions/html_report.py on lines 315..333
    safe/report/expressions/html_report.py on lines 344..362
    safe/report/expressions/html_report.py on lines 373..391
    safe/report/expressions/html_report.py on lines 402..420
    safe/report/expressions/html_report.py on lines 431..449
    safe/report/expressions/html_report.py on lines 460..478
    safe/report/expressions/html_report.py on lines 519..538

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def mmi_detail_report(feature, parent):
        """Retrieve the mmi detail section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 257..275
    safe/report/expressions/html_report.py on lines 286..304
    safe/report/expressions/html_report.py on lines 344..362
    safe/report/expressions/html_report.py on lines 373..391
    safe/report/expressions/html_report.py on lines 402..420
    safe/report/expressions/html_report.py on lines 431..449
    safe/report/expressions/html_report.py on lines 460..478
    safe/report/expressions/html_report.py on lines 489..508
    safe/report/expressions/html_report.py on lines 519..538

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def general_report(feature, parent):
        """Retrieve the general report section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 257..275
    safe/report/expressions/html_report.py on lines 315..333
    safe/report/expressions/html_report.py on lines 344..362
    safe/report/expressions/html_report.py on lines 373..391
    safe/report/expressions/html_report.py on lines 402..420
    safe/report/expressions/html_report.py on lines 431..449
    safe/report/expressions/html_report.py on lines 460..478
    safe/report/expressions/html_report.py on lines 489..508
    safe/report/expressions/html_report.py on lines 519..538

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def analysis_question_report(feature, parent):
        """Retrieve the analysis question section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 286..304
    safe/report/expressions/html_report.py on lines 315..333
    safe/report/expressions/html_report.py on lines 344..362
    safe/report/expressions/html_report.py on lines 373..391
    safe/report/expressions/html_report.py on lines 402..420
    safe/report/expressions/html_report.py on lines 431..449
    safe/report/expressions/html_report.py on lines 460..478
    safe/report/expressions/html_report.py on lines 489..508
    safe/report/expressions/html_report.py on lines 519..538

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def notes_assumptions_report(feature, parent):
        """Retrieve the notes assumptions section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 257..275
    safe/report/expressions/html_report.py on lines 286..304
    safe/report/expressions/html_report.py on lines 315..333
    safe/report/expressions/html_report.py on lines 344..362
    safe/report/expressions/html_report.py on lines 373..391
    safe/report/expressions/html_report.py on lines 431..449
    safe/report/expressions/html_report.py on lines 460..478
    safe/report/expressions/html_report.py on lines 489..508
    safe/report/expressions/html_report.py on lines 519..538

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def analysis_provenance_details_report(feature, parent):
        """Retrieve the analysis provenance details section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 257..275
    safe/report/expressions/html_report.py on lines 286..304
    safe/report/expressions/html_report.py on lines 315..333
    safe/report/expressions/html_report.py on lines 344..362
    safe/report/expressions/html_report.py on lines 373..391
    safe/report/expressions/html_report.py on lines 402..420
    safe/report/expressions/html_report.py on lines 431..449
    safe/report/expressions/html_report.py on lines 460..478
    safe/report/expressions/html_report.py on lines 489..508

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def aggregation_result_report(feature, parent):
        """Retrieve the aggregation result section from InaSAFE report.
    Severity: Major
    Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
    safe/report/expressions/html_report.py on lines 257..275
    safe/report/expressions/html_report.py on lines 286..304
    safe/report/expressions/html_report.py on lines 315..333
    safe/report/expressions/html_report.py on lines 344..362
    safe/report/expressions/html_report.py on lines 373..391
    safe/report/expressions/html_report.py on lines 402..420
    safe/report/expressions/html_report.py on lines 431..449
    safe/report/expressions/html_report.py on lines 489..508
    safe/report/expressions/html_report.py on lines 519..538

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def land_cover_analysis_summary_report(feature, parent):
        """Retrieve an HTML land cover analysis table report from a multi exposure
    Severity: Major
    Found in safe/report/expressions/html_report.py and 4 other locations - About 4 hrs to fix
    safe/report/expressions/html_report.py on lines 549..560
    safe/report/expressions/html_report.py on lines 571..582
    safe/report/expressions/html_report.py on lines 593..604
    safe/report/expressions/html_report.py on lines 615..626

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def road_analysis_summary_report(feature, parent):
        """Retrieve an HTML road analysis table report from a multi exposure
    Severity: Major
    Found in safe/report/expressions/html_report.py and 4 other locations - About 4 hrs to fix
    safe/report/expressions/html_report.py on lines 549..560
    safe/report/expressions/html_report.py on lines 593..604
    safe/report/expressions/html_report.py on lines 615..626
    safe/report/expressions/html_report.py on lines 637..648

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def place_analysis_summary_report(feature, parent):
        """Retrieve an HTML place analysis table report from a multi exposure
    Severity: Major
    Found in safe/report/expressions/html_report.py and 4 other locations - About 4 hrs to fix
    safe/report/expressions/html_report.py on lines 549..560
    safe/report/expressions/html_report.py on lines 571..582
    safe/report/expressions/html_report.py on lines 593..604
    safe/report/expressions/html_report.py on lines 637..648

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def population_analysis_summary_report(feature, parent):
        """Retrieve an HTML population analysis table report from a multi exposure
    Severity: Major
    Found in safe/report/expressions/html_report.py and 4 other locations - About 4 hrs to fix
    safe/report/expressions/html_report.py on lines 571..582
    safe/report/expressions/html_report.py on lines 593..604
    safe/report/expressions/html_report.py on lines 615..626
    safe/report/expressions/html_report.py on lines 637..648

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

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

    @qgsfunction(
        args='auto', group=group, usesGeometry=False, referencedColumns=[],
        help_text=help_message.to_html(), helpText=help_message.to_html())
    def structure_analysis_summary_report(feature, parent):
        """Retrieve an HTML structure analysis table report from a multi exposure
    Severity: Major
    Found in safe/report/expressions/html_report.py and 4 other locations - About 4 hrs to fix
    safe/report/expressions/html_report.py on lines 549..560
    safe/report/expressions/html_report.py on lines 571..582
    safe/report/expressions/html_report.py on lines 615..626
    safe/report/expressions/html_report.py on lines 637..648

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

    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