inasafe/inasafe

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

Summary

Maintainability
C
1 day
Test Coverage

File options_help.py has 352 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding=utf-8
"""Help text for options dialog."""

from safe import messaging as m
from safe.messaging import styles
Severity: Minor
Found in safe/gui/tools/help/options_help.py - About 4 hrs to fix

    Function content has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def content():
        """Helper method that returns just the content.
    
        This method was added so that the text could be reused in the
        dock_help module.
    Severity: Major
    Found in safe/gui/tools/help/options_help.py - About 3 hrs to fix

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

      def options_help():
          """Help message for options dialog.
      
          .. versionadded:: 3.2.1
      
      
      Severity: Major
      Found in safe/gui/tools/help/options_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/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/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

      There are no issues that match your filters.

      Category
      Status