Showing 1,474 of 1,497 total issues
File fields.py
has 2644 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""Definitions relating to fields."""
from qgis.PyQt.QtCore import QVariant
File impact_function.py
has 2411 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""Impact Function."""
File hazard_classifications.py
has 1902 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""Definitions relating to hazards classifications.
See https://github.com/inasafe/inasafe/issues/2920#issuecomment-229874044
to have a table showing you classes of each kind of hazard.
File dock.py
has 1321 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""InaSAFE Dock."""
import codecs
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
File multi_exposure_wrapper.py
has 1192 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""
Multi-exposure wrapper.
Identical blocks of code found in 2 locations. Consider refactoring. Open
if isinstance(output_format, list):
component_output = []
for i in range(len(output_format)):
each_format = output_format[i]
each_path = component_output_path[i]
- Read upRead up
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 295.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
if isinstance(output_format, list):
component_output = []
for i in range(len(output_format)):
each_format = output_format[i]
each_path = component_output_path[i]
- Read upRead up
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 295.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File step_kw33_multi_classifications.py
has 970 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""InaSAFE Wizard Step Multi Classifications."""
import logging
File components.py
has 875 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""Contains definitions about Report components.
"""
File plugin.py
has 850 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""InaSAFE Plugin."""
import sys
import os
File shake_grid.py
has 833 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""A converter for USGS shakemap grid.xml files."""
import codecs
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
File population_post_processors.py
has 811 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""Postprocessors about population and demographics."""
from collections import OrderedDict
Similar blocks of code found in 2 locations. Consider refactoring. Open
if thresholds.get(self.active_exposure['key']):
exposure_thresholds = thresholds.get(
self.active_exposure['key'])
if exposure_thresholds.get(classification['key']):
exposure_thresholds_classifications = exposure_thresholds\
- Read upRead up
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 197.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if thresholds.get(self.active_exposure['key']):
exposure_thresholds = thresholds.get(
self.active_exposure['key'])
if exposure_thresholds.get(classification['key']):
exposure_thresholds_classifications = exposure_thresholds \
- Read upRead up
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 197.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File options_dialog.py
has 760 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""InaSAFE Options Dialog."""
import logging
Similar blocks of code found in 2 locations. Consider refactoring. Open
def set_widgets(self):
"""Set widgets on the Exposure Layer From Canvas tab."""
# The list is already populated in the previous step, but now we
# need to do it again in case we're back from the Keyword Wizard.
# First, preserve self.parent.layer before clearing the list
- Read upRead up
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 190.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def set_widgets(self):
"""Set widgets on the Hazard Layer From TOC tab."""
# The list is already populated in the previous step, but now we
# need to do it again in case we're back from the Keyword Wizard.
# First, preserve self.parent.layer before clearing the list
- Read upRead up
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 190.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File concepts.py
has 736 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
"""Concepts used in various places in InaSAFE.
Where possible please supply citations. Concepts are used in reporting display
and in other places like the wizard to ensure that the user will have adequate