inasafe/inasafe

View on GitHub

Showing 1,474 of 1,497 total issues

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

File aggregate_postprocessors.py has 563 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding=utf-8
"""Module used to generate context for aggregation postprocessors sections.
"""

from collections import OrderedDict
Severity: Major
Found in safe/report/extractors/aggregate_postprocessors.py - About 1 day to fix

    File base_metadata.py has 560 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # coding=utf-8
    """This module base metadata implementation."""
    
    
    import abc
    Severity: Major
    Found in safe/metadata/base_metadata.py - About 1 day to fix

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

          'classes': [
              {
                  'key': 'high',
                  'value': 4,
                  'color': red,
      Severity: Major
      Found in safe/definitions/hazard_classifications.py and 1 other location - About 1 day to fix
      safe/definitions/hazard_classifications.py on lines 676..730

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

      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

          'classes': [
              {
                  'key': 'inundation_3',
                  'value': 3,
                  'color': red,
      Severity: Major
      Found in safe/definitions/hazard_classifications.py and 1 other location - About 1 day to fix
      safe/definitions/hazard_classifications.py on lines 1037..1116

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

      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

          def inasafe_fields_for_the_layer(self):
              """Return a list of inasafe fields the current layer.
      
              :returns: A list where each value represents inasafe field.
              :rtype: list
      Severity: Major
      Found in safe/gui/tools/wizard/step_kw45_inasafe_fields.py and 1 other location - About 1 day to fix
      safe/gui/tools/wizard/step_kw47_default_inasafe_fields.py on lines 74..103

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

      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

          def inasafe_fields_for_the_layer(self):
              """Return a list of inasafe fields the current layer.
      
              :returns: A list where each value represents inasafe field.
              :rtype: list
      Severity: Major
      Found in safe/gui/tools/wizard/step_kw47_default_inasafe_fields.py and 1 other location - About 1 day to fix
      safe/gui/tools/wizard/step_kw45_inasafe_fields.py on lines 87..116

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def general_report(feature, parent):
          """Retrieve the general report section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 257..275
      safe/report/expressions/html_report.py on lines 315..333
      safe/report/expressions/html_report.py on lines 344..362
      safe/report/expressions/html_report.py on lines 373..391
      safe/report/expressions/html_report.py on lines 402..420
      safe/report/expressions/html_report.py on lines 431..449
      safe/report/expressions/html_report.py on lines 460..478
      safe/report/expressions/html_report.py on lines 489..508
      safe/report/expressions/html_report.py on lines 519..538

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def analysis_detail_report(feature, parent):
          """Retrieve the analysis detail section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 257..275
      safe/report/expressions/html_report.py on lines 286..304
      safe/report/expressions/html_report.py on lines 315..333
      safe/report/expressions/html_report.py on lines 373..391
      safe/report/expressions/html_report.py on lines 402..420
      safe/report/expressions/html_report.py on lines 431..449
      safe/report/expressions/html_report.py on lines 460..478
      safe/report/expressions/html_report.py on lines 489..508
      safe/report/expressions/html_report.py on lines 519..538

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def aggregation_postprocessors_report(feature, parent):
          """Retrieve the aggregation postprocessors section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 257..275
      safe/report/expressions/html_report.py on lines 286..304
      safe/report/expressions/html_report.py on lines 315..333
      safe/report/expressions/html_report.py on lines 344..362
      safe/report/expressions/html_report.py on lines 373..391
      safe/report/expressions/html_report.py on lines 402..420
      safe/report/expressions/html_report.py on lines 431..449
      safe/report/expressions/html_report.py on lines 460..478
      safe/report/expressions/html_report.py on lines 519..538

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def notes_assumptions_report(feature, parent):
          """Retrieve the notes assumptions section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 257..275
      safe/report/expressions/html_report.py on lines 286..304
      safe/report/expressions/html_report.py on lines 315..333
      safe/report/expressions/html_report.py on lines 344..362
      safe/report/expressions/html_report.py on lines 373..391
      safe/report/expressions/html_report.py on lines 431..449
      safe/report/expressions/html_report.py on lines 460..478
      safe/report/expressions/html_report.py on lines 489..508
      safe/report/expressions/html_report.py on lines 519..538

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def analysis_provenance_details_report(feature, parent):
          """Retrieve the analysis provenance details section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 257..275
      safe/report/expressions/html_report.py on lines 286..304
      safe/report/expressions/html_report.py on lines 315..333
      safe/report/expressions/html_report.py on lines 344..362
      safe/report/expressions/html_report.py on lines 373..391
      safe/report/expressions/html_report.py on lines 402..420
      safe/report/expressions/html_report.py on lines 431..449
      safe/report/expressions/html_report.py on lines 460..478
      safe/report/expressions/html_report.py on lines 489..508

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def analysis_question_report(feature, parent):
          """Retrieve the analysis question section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 286..304
      safe/report/expressions/html_report.py on lines 315..333
      safe/report/expressions/html_report.py on lines 344..362
      safe/report/expressions/html_report.py on lines 373..391
      safe/report/expressions/html_report.py on lines 402..420
      safe/report/expressions/html_report.py on lines 431..449
      safe/report/expressions/html_report.py on lines 460..478
      safe/report/expressions/html_report.py on lines 489..508
      safe/report/expressions/html_report.py on lines 519..538

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def action_checklist_report(feature, parent):
          """Retrieve the action checklist section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 257..275
      safe/report/expressions/html_report.py on lines 286..304
      safe/report/expressions/html_report.py on lines 315..333
      safe/report/expressions/html_report.py on lines 344..362
      safe/report/expressions/html_report.py on lines 402..420
      safe/report/expressions/html_report.py on lines 431..449
      safe/report/expressions/html_report.py on lines 460..478
      safe/report/expressions/html_report.py on lines 489..508
      safe/report/expressions/html_report.py on lines 519..538

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def aggregation_result_report(feature, parent):
          """Retrieve the aggregation result section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 257..275
      safe/report/expressions/html_report.py on lines 286..304
      safe/report/expressions/html_report.py on lines 315..333
      safe/report/expressions/html_report.py on lines 344..362
      safe/report/expressions/html_report.py on lines 373..391
      safe/report/expressions/html_report.py on lines 402..420
      safe/report/expressions/html_report.py on lines 431..449
      safe/report/expressions/html_report.py on lines 489..508
      safe/report/expressions/html_report.py on lines 519..538

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def minimum_needs_report(feature, parent):
          """Retrieve the minimum needs section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 257..275
      safe/report/expressions/html_report.py on lines 286..304
      safe/report/expressions/html_report.py on lines 315..333
      safe/report/expressions/html_report.py on lines 344..362
      safe/report/expressions/html_report.py on lines 373..391
      safe/report/expressions/html_report.py on lines 402..420
      safe/report/expressions/html_report.py on lines 460..478
      safe/report/expressions/html_report.py on lines 489..508
      safe/report/expressions/html_report.py on lines 519..538

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

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

      @qgsfunction(
          args='auto', group=group, usesGeometry=False, referencedColumns=[],
          help_text=help_message.to_html(), helpText=help_message.to_html())
      def mmi_detail_report(feature, parent):
          """Retrieve the mmi detail section from InaSAFE report.
      Severity: Major
      Found in safe/report/expressions/html_report.py and 9 other locations - About 1 day to fix
      safe/report/expressions/html_report.py on lines 257..275
      safe/report/expressions/html_report.py on lines 286..304
      safe/report/expressions/html_report.py on lines 344..362
      safe/report/expressions/html_report.py on lines 373..391
      safe/report/expressions/html_report.py on lines 402..420
      safe/report/expressions/html_report.py on lines 431..449
      safe/report/expressions/html_report.py on lines 460..478
      safe/report/expressions/html_report.py on lines 489..508
      safe/report/expressions/html_report.py on lines 519..538

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

      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

      File hazard.py has 529 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # coding=utf-8
      
      """Definitions relating to hazards."""
      
      from safe.definitions.caveats import (
      Severity: Major
      Found in safe/definitions/hazard.py - About 1 day to fix

        File html_report.py has 516 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # coding=utf-8
        
        """QGIS Expressions which are available in the QGIS GUI interface."""
        
        from os.path import dirname, join, exists
        Severity: Major
        Found in safe/report/expressions/html_report.py - About 1 day to fix

          File keyword_io.py has 507 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # coding=utf-8
          """Keyword IO implementation."""
          
          
          import logging
          Severity: Major
          Found in safe/utilities/keyword_io.py - About 1 day to fix
            Severity
            Category
            Status
            Source
            Language