fossasia/open-event-orga-server

View on GitHub

Showing 1,194 of 1,194 total issues

Function before_get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def before_get(self, args, kwargs):
        refresh = request.args.get('refresh')
        if refresh == 'true':
            refresh_settings()
        kwargs['id'] = 1
Severity: Minor
Found in app/api/settings.py - About 35 mins 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 8 locations. Consider refactoring.
Open

    op.alter_column('events_version', 'can_pay_by_paytm',
               existing_type=sa.BOOLEAN(),
               nullable=True,
               autoincrement=False,
               existing_server_default=sa.text('false'))
Severity: Major
Found in migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py and 7 other locations - About 35 mins to fix
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 62..66
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 67..71
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 72..76
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 92..96
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 97..101
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 102..106
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 107..111

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

    op.alter_column('events_version', 'is_billing_info_mandatory',
               existing_type=sa.BOOLEAN(),
               nullable=True,
               autoincrement=False,
               existing_server_default=sa.text('false'))
Severity: Major
Found in migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py and 7 other locations - About 35 mins to fix
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 57..61
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 67..71
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 72..76
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 92..96
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 97..101
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 102..106
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 107..111

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

    op.alter_column('events_version', 'show_remaining_tickets',
               existing_type=sa.BOOLEAN(),
               nullable=False,
               autoincrement=False,
               existing_server_default=sa.text('false'))
Severity: Major
Found in migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py and 7 other locations - About 35 mins to fix
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 57..61
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 62..66
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 67..71
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 72..76
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 97..101
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 102..106
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 107..111

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

        elif k.startswith('user'):
            kwargs[k] = sequence % v.email + id_str % v.id
Severity: Major
Found in app/api/helpers/log.py and 3 other locations - About 35 mins to fix
app/api/helpers/log.py on lines 24..25
app/api/helpers/log.py on lines 26..27
app/api/helpers/log.py on lines 28..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 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 3 locations. Consider refactoring.
Open

class UsersEventsRolesRelationship(ResourceRelationship):
    """
    users_events_roles Relationship
    """

Severity: Minor
Found in app/api/users_events_roles.py and 2 other locations - About 35 mins to fix
app/api/role_invites.py on lines 141..148
app/api/users_groups_roles.py on lines 131..138

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

    def number_of_followers(self, obj):
        unique_follower = db.session.query(UserFollowGroup.user_id).distinct()
        return unique_follower.count()
Severity: Minor
Found in app/api/admin_statistics_api/groups.py and 1 other location - About 35 mins to fix
app/api/admin_statistics_api/users.py on lines 79..81

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

def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('custom_forms', 'is_complex')
    op.drop_column('custom_forms', 'description')
    op.drop_table('custom_form_options')
Severity: Minor
Found in migrations/versions/rev-2019-08-24-20:32:00-ebfe89366d48_.py and 1 other location - About 35 mins to fix
migrations/versions/4e143b2ac72a_.py on lines 32..36

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

    op.alter_column('events_version', 'is_ticket_form_enabled',
               existing_type=sa.BOOLEAN(),
               nullable=True,
               autoincrement=False,
               existing_server_default=sa.text('true'))
Severity: Major
Found in migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py and 7 other locations - About 35 mins to fix
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 57..61
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 62..66
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 72..76
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 92..96
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 97..101
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 102..106
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 107..111

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

    op.alter_column('events_version', 'is_ticket_form_enabled',
               existing_type=sa.BOOLEAN(),
               nullable=False,
               autoincrement=False,
               existing_server_default=sa.text('true'))
Severity: Major
Found in migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py and 7 other locations - About 35 mins to fix
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 57..61
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 62..66
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 67..71
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 72..76
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 92..96
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 102..106
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 107..111

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

        elif k.startswith('session'):
            kwargs[k] = sequence % v.title + id_str % v.id
Severity: Major
Found in app/api/helpers/log.py and 3 other locations - About 35 mins to fix
app/api/helpers/log.py on lines 20..21
app/api/helpers/log.py on lines 26..27
app/api/helpers/log.py on lines 28..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 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 2 locations. Consider refactoring.
Open

    def attendee_count(self, obj):
        unique_attendee_query = db.session.query(TicketHolder.email).distinct()
        return unique_attendee_query.count()
Severity: Minor
Found in app/api/admin_statistics_api/users.py and 1 other location - About 35 mins to fix
app/api/admin_statistics_api/groups.py on lines 41..43

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

    op.alter_column('events_version', 'is_billing_info_mandatory',
               existing_type=sa.BOOLEAN(),
               nullable=False,
               autoincrement=False,
               existing_server_default=sa.text('false'))
Severity: Major
Found in migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py and 7 other locations - About 35 mins to fix
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 57..61
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 62..66
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 67..71
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 72..76
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 92..96
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 97..101
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 107..111

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

    op.alter_column('events_version', 'show_remaining_tickets',
               existing_type=sa.BOOLEAN(),
               nullable=True,
               autoincrement=False,
               existing_server_default=sa.text('false'))
Severity: Major
Found in migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py and 7 other locations - About 35 mins to fix
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 57..61
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 62..66
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 67..71
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 92..96
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 97..101
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 102..106
migrations/versions/rev-2020-10-13-17:03:26-d512ae8422a0_.py on lines 107..111

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

class RoleInviteRelationship(ResourceRelationship):
    """
    Role invite Relationship
    """

Severity: Minor
Found in app/api/role_invites.py and 2 other locations - About 35 mins to fix
app/api/users_events_roles.py on lines 68..75
app/api/users_groups_roles.py on lines 131..138

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

        elif k.startswith('track'):
            kwargs[k] = sequence % v.name + id_str % v.id
Severity: Major
Found in app/api/helpers/log.py and 3 other locations - About 35 mins to fix
app/api/helpers/log.py on lines 20..21
app/api/helpers/log.py on lines 24..25
app/api/helpers/log.py on lines 28..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 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 4 locations. Consider refactoring.
Open

        elif k.startswith('speaker'):
            kwargs[k] = sequence % v.name + id_str % v.id
Severity: Major
Found in app/api/helpers/log.py and 3 other locations - About 35 mins to fix
app/api/helpers/log.py on lines 20..21
app/api/helpers/log.py on lines 24..25
app/api/helpers/log.py on lines 26..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 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 2 locations. Consider refactoring.
Open

    order_expiry_time = fields.Integer(
        allow_none=False, default=15, validate=lambda n: 1 <= n <= 60
Severity: Minor
Found in app/api/schema/settings.py and 1 other location - About 35 mins to fix
app/api/schema/settings.py on lines 43..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 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 2 locations. Consider refactoring.
Open

    def after_create_object(self, exhibitor, data, view_kwargs):
        if data.get('banner_url'):
            start_image_resizing_tasks(exhibitor, data['banner_url'])
Severity: Minor
Found in app/api/exhibitors.py and 1 other location - About 35 mins to fix
app/api/groups.py on lines 59..61

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

    max_complex_custom_fields = fields.Integer(
        allow_none=False, default=30, validate=lambda n: 1 <= n <= 30
Severity: Minor
Found in app/api/schema/settings.py and 1 other location - About 35 mins to fix
app/api/schema/settings.py on lines 34..35

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

Severity
Category
Status
Source
Language