eventoL/eventoL

View on GitHub
eventol/manager/admin/filters.py

Summary

Maintainability
F
1 wk
Test Coverage

Function get_lookups_tuple has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def get_lookups_tuple(user, source_model, target_model, order_field, id_field):
Severity: Minor
Found in eventol/manager/admin/filters.py - About 35 mins to fix

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

    class EventFromEventUserFilter(admin.SimpleListFilter):
        title = _('Event')
        parameter_name = 'event_from_event_user'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class EventFromEventUserSetFilter(admin.SimpleListFilter):
        title = _('Event')
        parameter_name = 'event_from_event_user'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class HardwareFilter(admin.SimpleListFilter):
        title = _('Hardware')
        parameter_name = 'hardware'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class RoomFilter(admin.SimpleListFilter):
        title = _('Room')
        parameter_name = 'room'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class EventFromAttendeeFilter(admin.SimpleListFilter):
        title = _('Event')
        parameter_name = 'event_from_attendee'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199

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

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

    class OwnerFilter(admin.SimpleListFilter):
        title = _('Owner')
        parameter_name = 'owner_user'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class EventFilter(admin.SimpleListFilter):
        title = _('Event')
        parameter_name = 'event'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class UserFromEventUserFilter(admin.SimpleListFilter):
        title = _('User')
        parameter_name = 'user_form_event_user'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class SoftwareFilter(admin.SimpleListFilter):
        title = _('Software')
        parameter_name = 'software'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class AttendeeFilter(admin.SimpleListFilter):
        title = _('Attendee')
        parameter_name = 'attendee'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class EventFromInstallerFilter(admin.SimpleListFilter):
        title = _('Event')
        parameter_name = 'event_from_installer'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 154..167
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 202..215

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

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

    class InstallerFilter(admin.SimpleListFilter):
        title = _('Installer')
        parameter_name = 'installer'
    
        def lookups(self, request, model_admin):
    Severity: Major
    Found in eventol/manager/admin/filters.py and 11 other locations - About 5 hrs to fix
    eventol/manager/admin/filters.py on lines 17..30
    eventol/manager/admin/filters.py on lines 33..46
    eventol/manager/admin/filters.py on lines 62..75
    eventol/manager/admin/filters.py on lines 78..91
    eventol/manager/admin/filters.py on lines 94..105
    eventol/manager/admin/filters.py on lines 108..119
    eventol/manager/admin/filters.py on lines 122..135
    eventol/manager/admin/filters.py on lines 138..151
    eventol/manager/admin/filters.py on lines 170..183
    eventol/manager/admin/filters.py on lines 186..199
    eventol/manager/admin/filters.py on lines 202..215

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

    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