inasafe/inasafe

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

Summary

Maintainability
F
2 wks
Test Coverage

File definitions_help.py has 1243 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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


import copy
Severity: Major
Found in safe/gui/tools/help/definitions_help.py - About 3 days to fix

    Function content has 173 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/definitions_help.py - About 6 hrs to fix

      Avoid deeply nested control flow statements.
      Open

                          if isinstance(inasafe_class['numeric_default_min'], dict):
                              bullets = m.BulletedList()
                              minima = inasafe_class['numeric_default_min']
                              for key, value in sorted(minima.items()):
                                  bullets.add('%s : %s' % (key, value))
      Severity: Major
      Found in safe/gui/tools/help/definitions_help.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if isinstance(inasafe_class['numeric_default_max'], dict):
                                bullets = m.BulletedList()
                                maxima = inasafe_class['numeric_default_max']
                                for key, value in sorted(maxima.items()):
                                    bullets.add('%s : %s' % (key, value))
        Severity: Major
        Found in safe/gui/tools/help/definitions_help.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if defaults:
                                  defaults += ',%s' % default
                              else:
                                  defaults = default
                          row.add(m.Cell(defaults))
          Severity: Major
          Found in safe/gui/tools/help/definitions_help.py - About 45 mins to fix

            Function _create_section_header has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def _create_section_header(
            Severity: Minor
            Found in safe/gui/tools/help/definitions_help.py - About 35 mins to fix

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

                          if is_hazard:
                              # Min may be a single value or a dict of values so we need
                              # to check type and deal with it accordingly
                              if 'numeric_default_min' in inasafe_class:
                                  if isinstance(inasafe_class['numeric_default_min'], dict):
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 1 day to fix
              safe/gui/tools/help/definitions_help.py on lines 1275..1288

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

              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

                          if is_hazard:
                              # Max may be a single value or a dict of values so we need
                              # to check type and deal with it accordingly
                              if 'numeric_default_max' in inasafe_class:
                                  if isinstance(inasafe_class['numeric_default_max'], dict):
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 1 day to fix
              safe/gui/tools/help/definitions_help.py on lines 1260..1273

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

              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

                  for exposure in exposure_all:
                      extra_exposure_notes = specific_notes(definition, exposure)
                      if extra_exposure_notes:
                          title = tr('Notes for exposure : {exposure_name}').format(
                              exposure_name=exposure['name'])
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 1 day to fix
              safe/gui/tools/help/definitions_help.py on lines 1143..1155

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

              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

                  for exposure in exposure_all:
                      extra_exposure_actions = specific_actions(definition, exposure)
                      if extra_exposure_actions:
                          title = tr('Actions for exposure : {exposure_name}').format(
                              exposure_name=exposure['name'])
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 1 day to fix
              safe/gui/tools/help/definitions_help.py on lines 1077..1089

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

              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

                  if 'multi_event_notes' in definition:
                      message.add(
                          m.Heading(
                              tr('Notes for multi events / scenarios:'),
                              **DETAILS_STYLE))
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 7 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1109..1118

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

              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

                  if 'single_event_notes' in definition:
                      message.add(
                          m.Heading(tr('Notes for single events'), **DETAILS_STYLE))
                      if len(definition['single_event_notes']) < 1:
                          message.add(m.Paragraph(tr('No single event notes defined.')))
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 7 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1120..1131

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

              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

                  for citation in definition['citations']:
                      if citation['text'] in [None, '']:
                          continue
                      if citation['link'] in [None, '']:
                          bullets.add(m.Paragraph(citation['text']))
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 6 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 190..197

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

              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

                      for citation in value['citations']:
                          if citation['text'] in [None, '']:
                              continue
                          if citation['link'] in [None, '']:
                              description.add(m.Paragraph(citation['text']))
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 6 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1332..1339

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

              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

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                  for unit in definitions.units_all:
                      row = m.Row()
                      row.add(m.Cell(unit['name']))
                      row.add(m.Cell(unit['plural_name']))
                      row.add(m.Cell(unit['abbreviation']))
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 6 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1166..1172

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

              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

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      for unit in definition['continuous_hazard_units']:
                          row = m.Row()
                          row.add(m.Cell(unit['name']))
                          row.add(m.Cell(unit['plural_name']))
                          row.add(m.Cell(unit['abbreviation']))
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 6 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 653..659

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

              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

                  if 'continuous_notes' in definition:
                      message.add(m.Heading(
                          tr('Notes for continuous datasets:'),
                          **DETAILS_SUBGROUP_STYLE))
                      bullets = m.BulletedList()
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 4 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1100..1107

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

              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

                  if 'classified_notes' in definition:
                      message.add(m.Heading(
                          tr('Notes for classified datasets:'),
                          **DETAILS_SUBGROUP_STYLE))
                      bullets = m.BulletedList()
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 4 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1091..1098

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

              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

                  for item in html_frame_elements:
                      row = m.Row()
                      row.add(m.Cell(item['id']))
                      row.add(m.Cell(item['description']))
                      table.add(row)
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 3 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 935..939

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

              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

                  for item in item_list:
                      row = m.Row()
                      row.add(m.Cell(item['key']))
                      row.add(m.Cell(item['description']))
                      table.add(row)
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 3 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 856..860

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

              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

                  if 'affected' in definition:
                      if definition['affected']:
                          message.add(m.Paragraph(tr(
                              'Exposure entities in this class ARE considered affected')))
                      else:
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 2 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1318..1323

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

              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

                  if 'optional' in definition:
                      if definition['optional']:
                          message.add(m.Paragraph(tr(
                              'This class is NOT required in the hazard keywords.')))
                      else:
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 2 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1309..1314

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

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

              def definitions_help():
                  """Help message for Definitions.
              
                  .. versionadded:: 4.0.0
              
              
              Severity: Major
              Found in safe/gui/tools/help/definitions_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/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/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 2 locations. Consider refactoring.
              Open

                      for note in definition['actions']:
                          if isinstance(note, dict):
                              bullets = _add_dict_to_bullets(bullets, note)
                          elif note:
                              bullets.add(m.Text(note))
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 2 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1045..1049

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

              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

                      for note in definition['notes']:
                          if isinstance(note, dict):
                              bullets = _add_dict_to_bullets(bullets, note)
                          elif note:
                              bullets.add(m.Text(note))
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 2 hrs to fix
              safe/gui/tools/help/definitions_help.py on lines 1136..1140

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

              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

                  if exists(svg_image_path):
                      url = resource_url(svg_image_path)
                  elif exists(png_image_path):
                      url = resource_url(png_image_path)
                  else:
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 1 hr to fix
              safe/gui/tools/help/definitions_help.py on lines 1369..1374

              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

                  if exists(jpg_image_path):
                      url = resource_url(jpg_image_path)
                  elif exists(png_image_path):
                      url = resource_url(png_image_path)
                  else:
              Severity: Major
              Found in safe/gui/tools/help/definitions_help.py and 1 other location - About 1 hr to fix
              safe/gui/tools/help/definitions_help.py on lines 1355..1360

              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

              There are no issues that match your filters.

              Category
              Status