Showing 327 of 327 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
def update_document(self, document):
document.labels = u' '.join(label.get_title() for label in self.labels)
- 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 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
- 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 update_document(self, document):
document.checklists = u'\n'.join(cl.to_indexable() for cl in self.data)
- 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 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
- 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
Function write_extension_data_CardDescription
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_extension_data_CardDescription(self, sheet, row, col, style):
Function render_asset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_asset(self, h, comp, model, *args):
Function write_extension_data_CardWeightEditor
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_extension_data_CardWeightEditor(self, sheet, row, col, style):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, field_id, completion_func, delimiter=None,
Function write_extension_data_Comments
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_extension_data_Comments(self, sheet, row, col, style):
Function write_extension_data_CardDescription
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_extension_data_CardDescription(self, sheet, row, col, style):
Function render_asset_anonymous
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_asset_anonymous(self, h, comp, model, *args):
Function init_app__new_mail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def init_app__new_mail(self, url, comp, http_method, request):
Function add_history
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_history(cls, board, card, user, action, data):
Function create_cover
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_cover(self, file_id, left, top, width, height):
Function make_cover
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_cover(self, asset, left, top, width, height):
Function init_app__reset
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def init_app__reset(self, url, comp, http_method, request):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, app_title, app_banner, theme, get_user, confirmation_base_url):
Function write_extension_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_extension_data(card_extension, worksheet, row, col, style):
Function init_app__board
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def init_app__board(self, url, comp, http_method, request):
Function init_app__assets
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def init_app__assets(self, url, comp, http_method, request):
Function define_field
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def define_field(self, schema_name, field_type, name, indexed, stored):
Function render_Asset_thumb
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def render_Asset_thumb(self, h, comp, model, *args):