inasafe/inasafe

View on GitHub
safe/gui/tools/help/extent_selector_help.py

Summary

Maintainability
A
3 hrs
Test Coverage

Function extent_mode_content has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def extent_mode_content():
    """Helper method that returns just the content in extent mode.

    This method was added so that the text could be reused in the
    wizard.
Severity: Minor
Found in safe/gui/tools/help/extent_selector_help.py - About 1 hr to fix

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

    def extent_selector_help():
        """Help message for extent selector dialog.
    
        .. versionadded:: 3.2.1
    
    
    Severity: Major
    Found in safe/gui/tools/help/extent_selector_help.py and 16 other locations - About 2 hrs to fix
    safe/gui/tools/help/batch_help.py on lines 14..27
    safe/gui/tools/help/definitions_help.py on lines 84..96
    safe/gui/tools/help/developer_help.py on lines 33..46
    safe/gui/tools/help/dock_help.py on lines 20..33
    safe/gui/tools/help/field_mapping_help.py on lines 20..32
    safe/gui/tools/help/function_options_help.py on lines 18..31
    safe/gui/tools/help/impact_report_help.py on lines 18..31
    safe/gui/tools/help/metadata_converter_help.py on lines 19..31
    safe/gui/tools/help/multi_buffer_help.py on lines 12..24
    safe/gui/tools/help/needs_calculator_help.py on lines 14..27
    safe/gui/tools/help/needs_manager_help.py on lines 15..28
    safe/gui/tools/help/options_help.py on lines 19..32
    safe/gui/tools/help/osm_downloader_help.py on lines 12..25
    safe/gui/tools/help/peta_bencana_help.py on lines 13..26
    safe/gui/tools/help/shakemap_converter_help.py on lines 14..27
    safe/gui/tools/help/welcome_message.py on lines 30..43

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

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

        paragraph = m.Paragraph(tr(
            'This tool allows you to specify which geographical region should be '
            'used for your analysis. If you want to check what area will be '
            'included in your analysis, enable the \'Toggle scenario outlines\' '
            'tool on the InaSAFE toolbar:'),
    Severity: Minor
    Found in safe/gui/tools/help/extent_selector_help.py and 2 other locations - About 30 mins to fix
    safe/gui/tools/help/dock_help.py on lines 71..82
    safe/gui/tools/help/field_mapping_help.py on lines 70..76

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

    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