inasafe/inasafe

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

Summary

Maintainability
D
1 day
Test Coverage

File dock_help.py has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding=utf-8
"""Help text for the dock widget."""

from safe import messaging as m
from safe.gui.tools.help.impact_report_help import content as report
Severity: Minor
Found in safe/gui/tools/help/dock_help.py - About 2 hrs to fix

    Function content has 53 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/dock_help.py - About 2 hrs to fix

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

      def dock_help():
          """Help message for Dock Widget.
      
          .. versionadded:: 3.2.1
      
      
      Severity: Major
      Found in safe/gui/tools/help/dock_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/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/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

          bullets.add(m.Text(
              # format 'the __questions__ area' for proper i18n
              tr('the %s area') % (
                  m.ImportantText(tr(
      Severity: Major
      Found in safe/gui/tools/help/dock_help.py and 3 other locations - About 1 hr to fix
      safe/gui/tools/help/dock_help.py on lines 103..106
      safe/gui/tools/help/dock_help.py on lines 109..112
      safe/gui/tools/help/osm_downloader_help.py on lines 108..120

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

      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

          bullets.add(m.Text(
              # format 'the __buttons__ area' for proper i18n
              tr('the %s area') % (
                  m.ImportantText(tr(
      Severity: Major
      Found in safe/gui/tools/help/dock_help.py and 3 other locations - About 1 hr to fix
      safe/gui/tools/help/dock_help.py on lines 97..100
      safe/gui/tools/help/dock_help.py on lines 103..106
      safe/gui/tools/help/osm_downloader_help.py on lines 108..120

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

      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

          bullets.add(m.Text(
              # format 'the __results__ area' for proper i18n
              tr('the %s area') % (
                  m.ImportantText(tr(
      Severity: Major
      Found in safe/gui/tools/help/dock_help.py and 3 other locations - About 1 hr to fix
      safe/gui/tools/help/dock_help.py on lines 97..100
      safe/gui/tools/help/dock_help.py on lines 109..112
      safe/gui/tools/help/osm_downloader_help.py on lines 108..120

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

      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

          message.add(m.Paragraph(tr(
              'InaSAFE will combine these two layers in a '
              'mathematical model. The results of this model will show what the '
              'effect of the hazard will be on the exposed infrastructure or '
              'people. The plugin relies on simple keyword metadata '
      Severity: Major
      Found in safe/gui/tools/help/dock_help.py and 1 other location - About 1 hr to fix
      safe/gui/widgets/message.py on lines 136..144

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

      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

          bullets.add(m.Text(
              tr(
                  'You can visualise the area that will be used for the analysis '
                  'by enabling the "Toggle Scenario Outlines" tool. When this tool '
                  'is enabled, a line (green by default) will be drawn around the '
      Severity: Minor
      Found in safe/gui/tools/help/dock_help.py and 1 other location - About 50 mins to fix
      safe/gui/tools/help/dock_help.py on lines 271..277

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

      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

          bullets.add(m.Text(
              tr(
                  'All datasets will be clipped to the behaviours defined in the '
                  'analysis extents dialog if you do not use an aggregation layer.'),
              m.Image(
      Severity: Minor
      Found in safe/gui/tools/help/dock_help.py and 1 other location - About 50 mins to fix
      safe/gui/tools/help/dock_help.py on lines 280..288

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

      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(
              'The InaSAFE \'dock panel\' helps you to run hazard impact analysis '
              'within the QGIS environment. It helps you create your hazard impact '
              'analysis question and shows the results of this analysis. If you are '
              'a new user, you may also consider using the \'Impact Function '
      Severity: Minor
      Found in safe/gui/tools/help/dock_help.py and 2 other locations - About 30 mins to fix
      safe/gui/tools/help/extent_selector_help.py on lines 68..75
      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