fossasia/open-event-orga-server

View on GitHub

Showing 1,194 of 1,194 total issues

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

Severity: Major
Found in migrations/versions/96bca587b3ca_.py and 1 other location - About 3 hrs to fix
migrations/versions/rev-2021-02-17-13:01:05-b261c9007716_.py on lines 0..27

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

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

def upgrade():
    # commands auto generated by Alembic - please adjust! #
    op.execute("ALTER TABLE email_notifications ALTER after_ticket_purchase TYPE boolean USING CASE after_ticket_purchase WHEN 1 THEN TRUE\
                ELSE FALSE END", execution_options=None)
    op.execute("ALTER TABLE email_notifications ALTER new_paper TYPE boolean USING CASE new_paper WHEN 1 THEN TRUE\
Severity: Major
Found in migrations/versions/f63b9b9b645b_.py and 2 other locations - About 3 hrs to fix
migrations/versions/43e8c59337ag_.py on lines 19..36
migrations/versions/f63b9b9b645b_.py on lines 34..44

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

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

migrations/versions/caf96244e10b_.py on lines 0..27
migrations/versions/rev-2021-01-01-12:47:36-2d0760003a8a_.py on lines 0..27

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

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

def downgrade():
    # commands auto generated by Alembic - please adjust! #
    op.execute("ALTER TABLE image_sizes ALTER after_ticket_purchase TYPE integer USING CASE after_ticket_purchase WHEN TRUE THEN 1\
                ELSE 0 END", execution_options=None)
    op.execute("ALTER TABLE image_sizes ALTER new_paper TYPE integer USING CASE new_paper WHEN TRUE THEN 1\
Severity: Major
Found in migrations/versions/f63b9b9b645b_.py and 2 other locations - About 3 hrs to fix
migrations/versions/43e8c59337ag_.py on lines 19..36
migrations/versions/f63b9b9b645b_.py on lines 19..29

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

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

@export_routes.route(
    '/events/<string:event_identifier>/export/speakers/pdf',
    methods=['GET'],
    endpoint='export_speakers_pdf',
)
Severity: Major
Found in app/api/exports.py and 8 other locations - About 3 hrs to fix
app/api/exports.py on lines 68..84
app/api/exports.py on lines 94..108
app/api/exports.py on lines 111..125
app/api/exports.py on lines 128..142
app/api/exports.py on lines 145..159
app/api/exports.py on lines 162..176
app/api/exports.py on lines 179..193
app/api/exports.py on lines 266..280

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

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

@export_routes.route(
    '/events/<string:event_identifier>/export/attendees/csv',
    methods=['GET'],
    endpoint='export_attendees_csv',
)
Severity: Major
Found in app/api/exports.py and 8 other locations - About 3 hrs to fix
app/api/exports.py on lines 68..84
app/api/exports.py on lines 94..108
app/api/exports.py on lines 111..125
app/api/exports.py on lines 128..142
app/api/exports.py on lines 145..159
app/api/exports.py on lines 179..193
app/api/exports.py on lines 266..280
app/api/exports.py on lines 283..297

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

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

@export_routes.route(
    '/events/<string:event_identifier>/export/attendees/pdf',
    methods=['GET'],
    endpoint='export_attendees_pdf',
)
Severity: Major
Found in app/api/exports.py and 8 other locations - About 3 hrs to fix
app/api/exports.py on lines 68..84
app/api/exports.py on lines 94..108
app/api/exports.py on lines 111..125
app/api/exports.py on lines 128..142
app/api/exports.py on lines 145..159
app/api/exports.py on lines 162..176
app/api/exports.py on lines 266..280
app/api/exports.py on lines 283..297

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

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

@export_routes.route(
    '/events/<string:event_identifier>/export/pentabarf',
    methods=['GET'],
    endpoint='export_event_pentabarf',
)
Severity: Major
Found in app/api/exports.py and 8 other locations - About 3 hrs to fix
app/api/exports.py on lines 68..84
app/api/exports.py on lines 94..108
app/api/exports.py on lines 128..142
app/api/exports.py on lines 145..159
app/api/exports.py on lines 162..176
app/api/exports.py on lines 179..193
app/api/exports.py on lines 266..280
app/api/exports.py on lines 283..297

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

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

@export_routes.route(
    '/events/<string:event_identifier>/export/sessions/pdf',
    methods=['GET'],
    endpoint='export_sessions_pdf',
)
Severity: Major
Found in app/api/exports.py and 8 other locations - About 3 hrs to fix
app/api/exports.py on lines 68..84
app/api/exports.py on lines 94..108
app/api/exports.py on lines 111..125
app/api/exports.py on lines 128..142
app/api/exports.py on lines 145..159
app/api/exports.py on lines 162..176
app/api/exports.py on lines 179..193
app/api/exports.py on lines 283..297

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

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

@export_routes.route(
    '/events/<string:event_identifier>/export/ical',
    methods=['GET'],
    endpoint='export_event_ical',
)
Severity: Major
Found in app/api/exports.py and 8 other locations - About 3 hrs to fix
app/api/exports.py on lines 68..84
app/api/exports.py on lines 111..125
app/api/exports.py on lines 128..142
app/api/exports.py on lines 145..159
app/api/exports.py on lines 162..176
app/api/exports.py on lines 179..193
app/api/exports.py on lines 266..280
app/api/exports.py on lines 283..297

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

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

@export_routes.route(
    '/events/<string:event_identifier>/export/xcal',
    methods=['GET'],
    endpoint='export_event_xcal',
)
Severity: Major
Found in app/api/exports.py and 8 other locations - About 3 hrs to fix
app/api/exports.py on lines 94..108
app/api/exports.py on lines 111..125
app/api/exports.py on lines 128..142
app/api/exports.py on lines 145..159
app/api/exports.py on lines 162..176
app/api/exports.py on lines 179..193
app/api/exports.py on lines 266..280
app/api/exports.py on lines 283..297

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

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

@export_routes.route(
    '/events/<string:event_identifier>/export/orders/csv',
    methods=['GET'],
    endpoint='export_orders_csv',
)
Severity: Major
Found in app/api/exports.py and 8 other locations - About 3 hrs to fix
app/api/exports.py on lines 68..84
app/api/exports.py on lines 94..108
app/api/exports.py on lines 111..125
app/api/exports.py on lines 145..159
app/api/exports.py on lines 162..176
app/api/exports.py on lines 179..193
app/api/exports.py on lines 266..280
app/api/exports.py on lines 283..297

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

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

@export_routes.route(
    '/events/<string:event_identifier>/export/orders/pdf',
    methods=['GET'],
    endpoint='export_orders_pdf',
)
Severity: Major
Found in app/api/exports.py and 8 other locations - About 3 hrs to fix
app/api/exports.py on lines 68..84
app/api/exports.py on lines 94..108
app/api/exports.py on lines 111..125
app/api/exports.py on lines 128..142
app/api/exports.py on lines 162..176
app/api/exports.py on lines 179..193
app/api/exports.py on lines 266..280
app/api/exports.py on lines 283..297

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

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 users.py has 311 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from flask_jwt_extended import current_user
from marshmallow import pre_dump
from marshmallow_jsonapi import fields
from marshmallow_jsonapi.flask import Relationship

Severity: Minor
Found in app/api/schema/users.py - About 3 hrs to fix

Function to_ical has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def to_ical(event, include_sessions=False, my_schedule=False, user_id=None):
    cal = Calendar()
    cal.add('version', '2.0')
    cal.add('METHOD', 'PUBLISH')
    cal.add('X-WR-CALNAME', event.name)
Severity: Minor
Found in app/api/helpers/calendar/ical.py - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function create_save_image_sizes has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def create_save_image_sizes(
    image_file, image_sizes_type, unique_identifier=None, folder=None
):
    """
    Save the resized version of the background image
Severity: Minor
Found in app/api/helpers/files.py - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function validate_custom_form_constraints has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def validate_custom_form_constraints(form, obj, excluded):
    """
    The validate custom form constraints.
    """
    conditions = {
Severity: Minor
Found in app/api/helpers/custom_forms.py - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

migrations/versions/rev-2020-07-19-08:30:08-8aef207c014f_.py on lines 0..29
migrations/versions/rev-2020-12-10-05:21:29-f6bd6bce0205_.py on lines 0..26
migrations/versions/rev-2021-01-21-21:02:25-6874747d4c65_.py on lines 0..29

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

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 data.get('system_image_url'):
            try:
                uploaded_image = create_system_image(
                    data['system_image_url'], unique_identifier=event_topic.id
                )
Severity: Major
Found in app/api/event_topics.py and 1 other location - About 3 hrs to fix
app/api/event_topics.py on lines 106..117

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

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

migrations/versions/rev-2020-08-08-16:56:27-61bec04ae010_.py on lines 0..29
migrations/versions/rev-2020-12-10-05:21:29-f6bd6bce0205_.py on lines 0..26
migrations/versions/rev-2021-01-21-21:02:25-6874747d4c65_.py on lines 0..29

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

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

Severity
Category
Status
Source
Language