fossasia/open-event-orga-server

View on GitHub

Showing 1,194 of 1,194 total issues

Consider simplifying this complex logical expression.
Open

    if mode == 'stripe':
        return (
            (order.paid_via == 'stripe')
            and order.brand
            and order.transaction_id
Severity: Major
Found in app/api/orders.py - About 40 mins to fix

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

    class Meta:
        """
        Meta class for Microlocation Api Schema
        """

Severity: Major
Found in app/api/schema/microlocations.py and 3 other locations - About 40 mins to fix
app/api/schema/event_role_permissions.py on lines 14..23
app/api/schema/mails.py on lines 13..22
app/api/schema/services.py on lines 15..24

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    try:
        db.session.commit()
    except Exception:
        logger.exception('UER or Role Invite delete exception!')
        db.session.rollback()
Severity: Major
Found in app/api/helpers/role_invite.py and 2 other locations - About 40 mins to fix
app/api/helpers/feedback.py on lines 15..19
app/api/helpers/role_invite.py on lines 29..33

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    class Meta:
        """
        Meta class for Notification API schema
        """

Severity: Major
Found in app/api/schema/event_role_permissions.py and 3 other locations - About 40 mins to fix
app/api/schema/mails.py on lines 13..22
app/api/schema/microlocations.py on lines 13..22
app/api/schema/services.py on lines 15..24

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    try:
        db.session.commit()
    except Exception:
        logger.exception('Feedback delete exception!')
        db.session.rollback()
Severity: Major
Found in app/api/helpers/feedback.py and 2 other locations - About 40 mins to fix
app/api/helpers/role_invite.py on lines 29..33
app/api/helpers/role_invite.py on lines 50..54

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    class Meta:
        """
        Meta class for Service API schema
        """

Severity: Major
Found in app/api/schema/services.py and 3 other locations - About 40 mins to fix
app/api/schema/event_role_permissions.py on lines 14..23
app/api/schema/mails.py on lines 13..22
app/api/schema/microlocations.py on lines 13..22

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    class Meta:
        """
        Meta class for mail Api Schema
        """

Severity: Major
Found in app/api/schema/mails.py and 3 other locations - About 40 mins to fix
app/api/schema/event_role_permissions.py on lines 14..23
app/api/schema/microlocations.py on lines 13..22
app/api/schema/services.py on lines 15..24

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    try:
        db.session.commit()
    except Exception:
        logger.exception('UER or Role Invite delete exception!')
        db.session.rollback()
Severity: Major
Found in app/api/helpers/role_invite.py and 2 other locations - About 40 mins to fix
app/api/helpers/feedback.py on lines 15..19
app/api/helpers/role_invite.py on lines 50..54

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

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

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

def accessible_role_based_events(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def is_registrar(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def is_moderator(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def is_coorganizer(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def is_track_organizer(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def permission_manager(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def is_super_admin(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def is_user_itself(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def is_discount_available(
Severity: Minor
Found in app/api/helpers/ticketing.py - About 35 mins to fix

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

def is_coorganizer_endpoint_related_to_event(
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def user_event(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix

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

def is_speaker_for_session(view, view_args, view_kwargs, *args, **kwargs):
Severity: Minor
Found in app/api/helpers/permission_manager.py - About 35 mins to fix
Severity
Category
Status
Source
Language