inasafe/inasafe

View on GitHub
safe/definitions/exposure_classifications.py

Summary

Maintainability
F
3 days
Test Coverage

File exposure_classifications.py has 828 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding=utf-8

"""Definitions relating to exposure classifications."""

from safe.utilities.i18n import tr
Severity: Major
Found in safe/definitions/exposure_classifications.py - About 1 day to fix

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

            {
                'key': 'other',
                'name': tr('Other'),
                'description': tr(
                    'A road that services residential or local traffic '
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 1 other location - About 1 hr to fix
    safe/definitions/exposure_classifications.py on lines 46..62

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

    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

            {
                'key': 'residential',
                'name': tr('Residential'),
                'description': tr(
                    'A structure used to provide shelter for people.'),
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 1 other location - About 1 hr to fix
    safe/definitions/exposure_classifications.py on lines 454..473

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

    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

            {
                # IF YOU UPDATE THIS ONE, PLEASE UPDATE THE OTHER ONE TOO
                'key': 'evacuation centre',
                'name': tr('Evacuation Centre'),
                'description': tr(
    Severity: Minor
    Found in safe/definitions/exposure_classifications.py and 1 other location - About 50 mins to fix
    safe/definitions/exposure_classifications.py on lines 557..576

    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

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

            {
                # IF YOU UPDATE THIS ONE, PLEASE UPDATE THE OTHER ONE TOO
                'key': 'evacuation centre',
                'name': tr('Evacuation Centre'),
                'description': tr(
    Severity: Minor
    Found in safe/definitions/exposure_classifications.py and 1 other location - About 50 mins to fix
    safe/definitions/exposure_classifications.py on lines 277..296

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

            {
                'key': 'rice_field',
                'name': tr('Rice Field'),
                'description': tr('Rice Field'),
                'osm_downloader': [],
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 6 other locations - About 40 mins to fix
    safe/definitions/exposure_classifications.py on lines 626..636
    safe/definitions/exposure_classifications.py on lines 682..693
    safe/definitions/exposure_classifications.py on lines 697..707
    safe/definitions/exposure_classifications.py on lines 741..750
    safe/definitions/exposure_classifications.py on lines 767..776
    safe/definitions/exposure_classifications.py on lines 807..816

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

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

            {
                'key': 'farm',
                'name': tr('Farm'),
                'description': tr(
                    'An area of farmland used for tillage and pasture (animals, '
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 6 other locations - About 40 mins to fix
    safe/definitions/exposure_classifications.py on lines 626..636
    safe/definitions/exposure_classifications.py on lines 697..707
    safe/definitions/exposure_classifications.py on lines 741..750
    safe/definitions/exposure_classifications.py on lines 754..763
    safe/definitions/exposure_classifications.py on lines 767..776
    safe/definitions/exposure_classifications.py on lines 807..816

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

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

            {
                'key': 'plantation',
                'name': tr('Plantation'),
                'description': tr('Plantation'),
                'osm_downloader': [],
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 6 other locations - About 40 mins to fix
    safe/definitions/exposure_classifications.py on lines 626..636
    safe/definitions/exposure_classifications.py on lines 682..693
    safe/definitions/exposure_classifications.py on lines 697..707
    safe/definitions/exposure_classifications.py on lines 741..750
    safe/definitions/exposure_classifications.py on lines 754..763
    safe/definitions/exposure_classifications.py on lines 807..816

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

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

            {
                'key': 'forest',
                'name': tr('Forest'),
                'description': tr('Forest'),
                'osm_downloader': [],
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 6 other locations - About 40 mins to fix
    safe/definitions/exposure_classifications.py on lines 626..636
    safe/definitions/exposure_classifications.py on lines 682..693
    safe/definitions/exposure_classifications.py on lines 697..707
    safe/definitions/exposure_classifications.py on lines 741..750
    safe/definitions/exposure_classifications.py on lines 754..763
    safe/definitions/exposure_classifications.py on lines 767..776

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

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

            {
                'key': 'residential',
                'name': tr('Residential'),
                'description': tr(
                    'Predominantly houses or apartment buildings.'),
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 6 other locations - About 40 mins to fix
    safe/definitions/exposure_classifications.py on lines 682..693
    safe/definitions/exposure_classifications.py on lines 697..707
    safe/definitions/exposure_classifications.py on lines 741..750
    safe/definitions/exposure_classifications.py on lines 754..763
    safe/definitions/exposure_classifications.py on lines 767..776
    safe/definitions/exposure_classifications.py on lines 807..816

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

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

            {
                'key': 'settlement',
                'name': tr('Settlement'),
                'description': tr('Settlement'),
                'osm_downloader': [],
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 6 other locations - About 40 mins to fix
    safe/definitions/exposure_classifications.py on lines 626..636
    safe/definitions/exposure_classifications.py on lines 682..693
    safe/definitions/exposure_classifications.py on lines 697..707
    safe/definitions/exposure_classifications.py on lines 754..763
    safe/definitions/exposure_classifications.py on lines 767..776
    safe/definitions/exposure_classifications.py on lines 807..816

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

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

            {
                'key': 'water',
                'name': tr('Water'),
                'description': tr(
                    'Water bodies both natural and man-made.'),
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 6 other locations - About 40 mins to fix
    safe/definitions/exposure_classifications.py on lines 626..636
    safe/definitions/exposure_classifications.py on lines 682..693
    safe/definitions/exposure_classifications.py on lines 741..750
    safe/definitions/exposure_classifications.py on lines 754..763
    safe/definitions/exposure_classifications.py on lines 767..776
    safe/definitions/exposure_classifications.py on lines 807..816

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

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

            {
                'key': 'other',
                'name': tr('Other'),
                'description': tr('Other'),
                'osm_downloader': [],
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 494..505
    safe/definitions/exposure_classifications.py on lines 580..592
    safe/definitions/exposure_classifications.py on lines 711..721
    safe/definitions/exposure_classifications.py on lines 820..830

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

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

            {
                'key': 'city',
                'name': tr('City'),
                'description': tr(
                    'The largest urban settlements in the territory, normally '
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 580..592
    safe/definitions/exposure_classifications.py on lines 596..605
    safe/definitions/exposure_classifications.py on lines 711..721
    safe/definitions/exposure_classifications.py on lines 820..830

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

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

            {
                'key': 'airport',
                'name': tr('Airport'),
                'description': tr(
                    'A complex of runways and buildings for the takeoff, landing, '
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 494..505
    safe/definitions/exposure_classifications.py on lines 596..605
    safe/definitions/exposure_classifications.py on lines 711..721
    safe/definitions/exposure_classifications.py on lines 820..830

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

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

            {
                'key': 'hamlet',
                'name': tr('Hamlet'),
                'description': tr(
                    'A smaller rural community typically with fewer than 100-200 '
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 509..522
    safe/definitions/exposure_classifications.py on lines 526..538
    safe/definitions/exposure_classifications.py on lines 640..650
    safe/definitions/exposure_classifications.py on lines 654..664

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

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

            {
                'key': 'other',
                'name': tr('Other'),
                'description': tr(
                    'Any other land use type.'),
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 494..505
    safe/definitions/exposure_classifications.py on lines 580..592
    safe/definitions/exposure_classifications.py on lines 596..605
    safe/definitions/exposure_classifications.py on lines 820..830

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

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

            {
                'key': 'retail',
                'name': tr('Retail'),
                'description': tr(
                    'Predominantly shops.'),
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 509..522
    safe/definitions/exposure_classifications.py on lines 526..538
    safe/definitions/exposure_classifications.py on lines 542..553
    safe/definitions/exposure_classifications.py on lines 640..650

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

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

            {
                'key': 'other',
                'name': tr('Other'),
                'description': tr(
                    'Any other land use type.'),
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 494..505
    safe/definitions/exposure_classifications.py on lines 580..592
    safe/definitions/exposure_classifications.py on lines 596..605
    safe/definitions/exposure_classifications.py on lines 711..721

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

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

            {
                'key': 'industrial',
                'name': tr('Industrial'),
                'description': tr(
                    'Predominantly workshops, factories or warehouses.'),
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 509..522
    safe/definitions/exposure_classifications.py on lines 526..538
    safe/definitions/exposure_classifications.py on lines 542..553
    safe/definitions/exposure_classifications.py on lines 654..664

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

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

            {
                'key': 'Village',
                'name': tr('Village'),
                'description': tr(
                    'A smaller distinct settlement, smaller than a town with few '
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 509..522
    safe/definitions/exposure_classifications.py on lines 542..553
    safe/definitions/exposure_classifications.py on lines 640..650
    safe/definitions/exposure_classifications.py on lines 654..664

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

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

            {
                'key': 'Town',
                'name': tr('Town'),
                'description': tr(
                    'A second tier urban settlement of local importance, often '
    Severity: Major
    Found in safe/definitions/exposure_classifications.py and 4 other locations - About 35 mins to fix
    safe/definitions/exposure_classifications.py on lines 526..538
    safe/definitions/exposure_classifications.py on lines 542..553
    safe/definitions/exposure_classifications.py on lines 640..650
    safe/definitions/exposure_classifications.py on lines 654..664

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

    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