inasafe/inasafe

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

Summary

Maintainability
C
1 day
Test Coverage

Function field_mapping_help_content has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def field_mapping_help_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/field_mapping_help.py - About 1 hr to fix

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

    def field_mapping_help():
        """Help message for field mapping Dialog.
    
        .. versionadded:: 4.1.0
    
    
    Severity: Major
    Found in safe/gui/tools/help/field_mapping_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/extent_selector_help.py on lines 16..29
    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 4 locations. Consider refactoring.
    Open

        row = m.Row([
            tr('No aggregation'),
            tr('Use global default ratio'),
            tr('Use global default ratio'),
            tr('Use count to determine ratio'),
    Severity: Major
    Found in safe/gui/tools/help/field_mapping_help.py and 3 other locations - About 55 mins to fix
    safe/gui/tools/help/field_mapping_help.py on lines 226..231
    safe/gui/tools/help/field_mapping_help.py on lines 234..239
    safe/gui/tools/help/field_mapping_help.py on lines 242..247

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

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

        row = m.Row([
            tr('Aggregation, ratio field mapping set'),
            tr('Use aggregation layer ratio'),
            tr('Use aggregation layer ratio'),
            tr('Use count to determine ratio'),
    Severity: Major
    Found in safe/gui/tools/help/field_mapping_help.py and 3 other locations - About 55 mins to fix
    safe/gui/tools/help/field_mapping_help.py on lines 218..223
    safe/gui/tools/help/field_mapping_help.py on lines 226..231
    safe/gui/tools/help/field_mapping_help.py on lines 234..239

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

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

        row = m.Row([
            tr('Aggregation, ratio value set'),
            tr('Use aggregation layer ratio'),
            tr('Use aggregation layer ratio'),
            tr('Use count to determine ratio'),
    Severity: Major
    Found in safe/gui/tools/help/field_mapping_help.py and 3 other locations - About 55 mins to fix
    safe/gui/tools/help/field_mapping_help.py on lines 218..223
    safe/gui/tools/help/field_mapping_help.py on lines 226..231
    safe/gui/tools/help/field_mapping_help.py on lines 242..247

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

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

        row = m.Row([
            tr('Aggregation, ratio not set'),
            tr('Use global default ratio'),
            tr('Do nothing'),
            tr('Use count to determine ratio'),
    Severity: Major
    Found in safe/gui/tools/help/field_mapping_help.py and 3 other locations - About 55 mins to fix
    safe/gui/tools/help/field_mapping_help.py on lines 218..223
    safe/gui/tools/help/field_mapping_help.py on lines 234..239
    safe/gui/tools/help/field_mapping_help.py on lines 242..247

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

    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 define field mappings to use for demographic '
            'breakdowns of your analysis results. You can activate the '
            'tool on the InaSAFE toolbar:'),
            m.Image(
    Severity: Minor
    Found in safe/gui/tools/help/field_mapping_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/extent_selector_help.py on lines 68..75

    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