fossasia/open-event-orga-server

View on GitHub
app/api/schema/users.py

Summary

Maintainability
D
2 days
Test Coverage

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

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

    feedbacks = Relationship(
        attribute='feedback',
        self_view='v1.user_feedback',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.feedback_list',
Severity: Major
Found in app/api/schema/users.py and 15 other locations - About 1 hr to fix
app/api/schema/events.py on lines 169..174
app/api/schema/events.py on lines 179..184
app/api/schema/events.py on lines 189..194
app/api/schema/events.py on lines 199..204
app/api/schema/events.py on lines 217..222
app/api/schema/events.py on lines 244..249
app/api/schema/events.py on lines 254..259
app/api/schema/events.py on lines 296..301
app/api/schema/events.py on lines 397..402
app/api/schema/events.py on lines 407..412
app/api/schema/events.py on lines 433..438
app/api/schema/tickets.py on lines 141..146
app/api/schema/users.py on lines 136..141
app/api/schema/users.py on lines 180..185
app/api/schema/users.py on lines 298..303

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

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

    speakers = Relationship(
        attribute='speaker',
        self_view='v1.user_speaker',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.speaker_list',
Severity: Major
Found in app/api/schema/users.py and 15 other locations - About 1 hr to fix
app/api/schema/events.py on lines 169..174
app/api/schema/events.py on lines 179..184
app/api/schema/events.py on lines 189..194
app/api/schema/events.py on lines 199..204
app/api/schema/events.py on lines 217..222
app/api/schema/events.py on lines 244..249
app/api/schema/events.py on lines 254..259
app/api/schema/events.py on lines 296..301
app/api/schema/events.py on lines 397..402
app/api/schema/events.py on lines 407..412
app/api/schema/events.py on lines 433..438
app/api/schema/tickets.py on lines 141..146
app/api/schema/users.py on lines 117..122
app/api/schema/users.py on lines 180..185
app/api/schema/users.py on lines 298..303

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

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

    sessions = Relationship(
        attribute='session',
        self_view='v1.user_session',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.session_list',
Severity: Major
Found in app/api/schema/users.py and 15 other locations - About 1 hr to fix
app/api/schema/events.py on lines 169..174
app/api/schema/events.py on lines 179..184
app/api/schema/events.py on lines 189..194
app/api/schema/events.py on lines 199..204
app/api/schema/events.py on lines 217..222
app/api/schema/events.py on lines 244..249
app/api/schema/events.py on lines 254..259
app/api/schema/events.py on lines 296..301
app/api/schema/events.py on lines 397..402
app/api/schema/events.py on lines 407..412
app/api/schema/events.py on lines 433..438
app/api/schema/tickets.py on lines 141..146
app/api/schema/users.py on lines 117..122
app/api/schema/users.py on lines 136..141
app/api/schema/users.py on lines 298..303

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

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

    orders = Relationship(
        attribute='orders',
        self_view='v1.user_orders',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.orders_list',
Severity: Major
Found in app/api/schema/users.py and 15 other locations - About 1 hr to fix
app/api/schema/events.py on lines 169..174
app/api/schema/events.py on lines 179..184
app/api/schema/events.py on lines 189..194
app/api/schema/events.py on lines 199..204
app/api/schema/events.py on lines 217..222
app/api/schema/events.py on lines 244..249
app/api/schema/events.py on lines 254..259
app/api/schema/events.py on lines 296..301
app/api/schema/events.py on lines 397..402
app/api/schema/events.py on lines 407..412
app/api/schema/events.py on lines 433..438
app/api/schema/tickets.py on lines 141..146
app/api/schema/users.py on lines 117..122
app/api/schema/users.py on lines 136..141
app/api/schema/users.py on lines 180..185

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

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

    notifications = Relationship(
        self_view='v1.user_notification',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.notification_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    attendees = Relationship(
        self_view='v1.user_attendees',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.attendee_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    event_invoices = Relationship(
        self_view='v1.user_event_invoices',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_invoice_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    email_notifications = Relationship(
        self_view='v1.user_email_notifications',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.email_notification_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    owner_events = Relationship(
        self_view='v1.user_owner_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_owner_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    track_organizer_events = Relationship(
        self_view='v1.user_track_organizer_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_track_organizer_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    registrar_events = Relationship(
        self_view='v1.user_registrar_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_registrar_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    moderator_events = Relationship(
        self_view='v1.user_moderator_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_moderator_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    alternate_emails = Relationship(
        self_view='v1.user_emails',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.user_emails_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    groups = Relationship(
        self_view='v1.user_group',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.group_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    coorganizer_events = Relationship(
        self_view='v1.user_coorganizer_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_coorganizer_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    followed_groups = Relationship(
        self_view='v1.user_user_follow_groups',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.user_follow_group_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284

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

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

    favourite_sessions = Relationship(
        self_view='v1.user_user_favourite_sessions',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.user_favourite_sessions_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 289..293

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

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

    favourite_events = Relationship(
        self_view='v1.user_user_favourite_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.user_favourite_events_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 262..266
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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

    events = Relationship(
        self_view='v1.user_events',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_list',
        related_view_kwargs={'user_id': '<id>'},
Severity: Major
Found in app/api/schema/users.py and 37 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 103..107
app/api/schema/custom_system_roles.py on lines 24..28
app/api/schema/discount_codes.py on lines 128..132
app/api/schema/discount_codes.py on lines 268..272
app/api/schema/events.py on lines 124..128
app/api/schema/events.py on lines 133..137
app/api/schema/events.py on lines 142..146
app/api/schema/events.py on lines 151..155
app/api/schema/events.py on lines 160..164
app/api/schema/events.py on lines 363..367
app/api/schema/events.py on lines 493..497
app/api/schema/events.py on lines 502..506
app/api/schema/faq_types.py on lines 32..36
app/api/schema/groups.py on lines 81..85
app/api/schema/session_types.py on lines 54..58
app/api/schema/sessions.py on lines 161..165
app/api/schema/sessions.py on lines 207..211
app/api/schema/sessions.py on lines 216..220
app/api/schema/speakers.py on lines 83..87
app/api/schema/ticket_tags.py on lines 25..29
app/api/schema/tickets.py on lines 152..156
app/api/schema/tickets.py on lines 170..174
app/api/schema/tracks.py on lines 54..58
app/api/schema/users.py on lines 108..112
app/api/schema/users.py on lines 127..131
app/api/schema/users.py on lines 162..166
app/api/schema/users.py on lines 171..175
app/api/schema/users.py on lines 190..194
app/api/schema/users.py on lines 199..203
app/api/schema/users.py on lines 217..221
app/api/schema/users.py on lines 226..230
app/api/schema/users.py on lines 235..239
app/api/schema/users.py on lines 244..248
app/api/schema/users.py on lines 253..257
app/api/schema/users.py on lines 271..275
app/api/schema/users.py on lines 280..284
app/api/schema/users.py on lines 289..293

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

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