fossasia/open-event-orga-server

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

Summary

Maintainability
F
4 days
Test Coverage

File events.py has 507 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import pytz
from flask_rest_jsonapi.exceptions import ObjectNotFound
from marshmallow import validate, validates_schema
from marshmallow.schema import Schema
from marshmallow_jsonapi import fields
Severity: Major
Found in app/api/schema/events.py - About 1 day to fix

Function validate_timezone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_timezone(self, data, original_data):
        if 'id' in original_data['data']:
            try:
                event = Event.query.filter_by(id=original_data['data']['id']).one()
            except NoResultFound:
Severity: Minor
Found in app/api/schema/events.py - About 25 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 16 locations. Consider refactoring.
Open

    social_links = Relationship(
        attribute='social_link',
        self_view='v1.event_social_link',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.social_link_list',
Severity: Major
Found in app/api/schema/events.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 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
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.event_speaker',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.speaker_list',
Severity: Major
Found in app/api/schema/events.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 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
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

    tracks = Relationship(
        attribute='track',
        self_view='v1.event_tracks',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.track_list',
Severity: Major
Found in app/api/schema/events.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 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
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

    tags = Relationship(
        attribute='tag',
        self_view='v1.event_tags',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.tags_list',
Severity: Major
Found in app/api/schema/events.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 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
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

    microlocations = Relationship(
        attribute='microlocation',
        self_view='v1.event_microlocation',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.microlocation_list',
Severity: Major
Found in app/api/schema/events.py and 15 other locations - About 1 hr to fix
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
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

    badge_forms = Relationship(
        attribute='badge_form',
        self_view='v1.event_badge_forms',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.badge_form_list',
Severity: Major
Found in app/api/schema/events.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 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
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

    event_invoices = Relationship(
        attribute='invoices',
        self_view='v1.event_event_invoice',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_invoice_list',
Severity: Major
Found in app/api/schema/events.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/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
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

    session_types = Relationship(
        attribute='session_type',
        self_view='v1.event_session_types',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.session_type_list',
Severity: Major
Found in app/api/schema/events.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 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
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.event_session',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.session_list',
Severity: Major
Found in app/api/schema/events.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 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
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

    sponsors = Relationship(
        attribute='sponsor',
        self_view='v1.event_sponsor',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.sponsor_list',
Severity: Major
Found in app/api/schema/events.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 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
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

    custom_forms = Relationship(
        attribute='custom_form',
        self_view='v1.event_custom_forms',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.custom_form_list',
Severity: Major
Found in app/api/schema/events.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 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
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 38 locations. Consider refactoring.
Open

    tickets = Relationship(
        self_view='v1.event_ticket',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.ticket_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.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 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
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

    feedbacks = Relationship(
        self_view='v1.event_feedbacks',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.feedback_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.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 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
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

    ticket_tags = Relationship(
        self_view='v1.event_ticket_tag',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.ticket_tag_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.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 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
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.event_attendees',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.attendee_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.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/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
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

    faq_types = Relationship(
        self_view='v1.event_faq_types',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.faq_type_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.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 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
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

    faqs = Relationship(
        self_view='v1.event_faqs',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.faq_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.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 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
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

    access_codes = Relationship(
        self_view='v1.event_access_codes',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.access_code_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.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 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
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

    exhibitors = Relationship(
        self_view='v1.event_exhibitor',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.exhibitor_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.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 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
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 16 locations. Consider refactoring.
Open

    station = Relationship(
        self_view='v1.station',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.station_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.py and 15 other locations - About 55 mins to fix
app/api/schema/attendees.py on lines 89..93
app/api/schema/attendees.py on lines 98..102
app/api/schema/attendees.py on lines 107..111
app/api/schema/attendees.py on lines 141..145
app/api/schema/events.py on lines 379..383
app/api/schema/events.py on lines 476..480
app/api/schema/events.py on lines 511..515
app/api/schema/groups.py on lines 62..66
app/api/schema/orders.py on lines 145..149
app/api/schema/orders.py on lines 166..170
app/api/schema/orders.py on lines 176..180
app/api/schema/speakers.py on lines 74..78
app/api/schema/user_check_in.py on lines 25..29
app/api/schema/user_check_in.py on lines 34..38
app/api/schema/user_check_in.py on lines 43..47

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

    video_stream = GetterRelationship(
        getter='safe_video_stream',
        self_view='v1.video_stream_event',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.video_stream_detail',
Severity: Major
Found in app/api/schema/events.py and 9 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 94..99
app/api/schema/events.py on lines 227..232
app/api/schema/events.py on lines 443..448
app/api/schema/microlocations.py on lines 53..58
app/api/schema/sessions.py on lines 189..194
app/api/schema/user_favourite_sessions.py on lines 21..26
app/api/schema/user_follow_groups.py on lines 22..27
app/api/schema/user_follow_groups.py on lines 32..37
app/api/schema/video_stream.py on lines 71..76

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

    roles = Relationship(
        self_view='v1.event_users_events_roles',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.users_events_roles_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.py and 15 other locations - About 55 mins to fix
app/api/schema/attendees.py on lines 89..93
app/api/schema/attendees.py on lines 98..102
app/api/schema/attendees.py on lines 107..111
app/api/schema/attendees.py on lines 141..145
app/api/schema/events.py on lines 379..383
app/api/schema/events.py on lines 388..392
app/api/schema/events.py on lines 476..480
app/api/schema/groups.py on lines 62..66
app/api/schema/orders.py on lines 145..149
app/api/schema/orders.py on lines 166..170
app/api/schema/orders.py on lines 176..180
app/api/schema/speakers.py on lines 74..78
app/api/schema/user_check_in.py on lines 25..29
app/api/schema/user_check_in.py on lines 34..38
app/api/schema/user_check_in.py on lines 43..47

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

    orders = Relationship(
        self_view='v1.event_orders',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.orders_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.py and 15 other locations - About 55 mins to fix
app/api/schema/attendees.py on lines 89..93
app/api/schema/attendees.py on lines 98..102
app/api/schema/attendees.py on lines 107..111
app/api/schema/attendees.py on lines 141..145
app/api/schema/events.py on lines 379..383
app/api/schema/events.py on lines 388..392
app/api/schema/events.py on lines 511..515
app/api/schema/groups.py on lines 62..66
app/api/schema/orders.py on lines 145..149
app/api/schema/orders.py on lines 166..170
app/api/schema/orders.py on lines 176..180
app/api/schema/speakers.py on lines 74..78
app/api/schema/user_check_in.py on lines 25..29
app/api/schema/user_check_in.py on lines 34..38
app/api/schema/user_check_in.py on lines 43..47

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

    discount_codes = Relationship(
        attribute='discount_code',
        self_view='v1.event_discount_code',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.discount_code_list',
Severity: Major
Found in app/api/schema/events.py and 9 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 94..99
app/api/schema/events.py on lines 227..232
app/api/schema/events.py on lines 354..359
app/api/schema/microlocations.py on lines 53..58
app/api/schema/sessions.py on lines 189..194
app/api/schema/user_favourite_sessions.py on lines 21..26
app/api/schema/user_follow_groups.py on lines 22..27
app/api/schema/user_follow_groups.py on lines 32..37
app/api/schema/video_stream.py on lines 71..76

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

    speaker_invites = Relationship(
        self_view='v1.event_speaker_invites',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.speaker_invite_list',
        related_view_kwargs={'event_id': '<id>'},
Severity: Major
Found in app/api/schema/events.py and 15 other locations - About 55 mins to fix
app/api/schema/attendees.py on lines 89..93
app/api/schema/attendees.py on lines 98..102
app/api/schema/attendees.py on lines 107..111
app/api/schema/attendees.py on lines 141..145
app/api/schema/events.py on lines 388..392
app/api/schema/events.py on lines 476..480
app/api/schema/events.py on lines 511..515
app/api/schema/groups.py on lines 62..66
app/api/schema/orders.py on lines 145..149
app/api/schema/orders.py on lines 166..170
app/api/schema/orders.py on lines 176..180
app/api/schema/speakers.py on lines 74..78
app/api/schema/user_check_in.py on lines 25..29
app/api/schema/user_check_in.py on lines 34..38
app/api/schema/user_check_in.py on lines 43..47

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

    event_copyright = Relationship(
        attribute='copyright',
        self_view='v1.event_copyright',
        self_view_kwargs={'id': '<id>'},
        related_view='v1.event_copyright_detail',
Severity: Major
Found in app/api/schema/events.py and 9 other locations - About 55 mins to fix
app/api/schema/access_codes.py on lines 94..99
app/api/schema/events.py on lines 354..359
app/api/schema/events.py on lines 443..448
app/api/schema/microlocations.py on lines 53..58
app/api/schema/sessions.py on lines 189..194
app/api/schema/user_favourite_sessions.py on lines 21..26
app/api/schema/user_follow_groups.py on lines 22..27
app/api/schema/user_follow_groups.py on lines 32..37
app/api/schema/video_stream.py on lines 71..76

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