fossasia/open-event-orga-server

View on GitHub

Showing 300 of 1,194 total issues

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 create_event has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def create_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

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

def is_speaker_itself_or_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_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 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_organizer has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def is_organizer(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 auth_required has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def auth_required(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 is_coorganizer_or_user_itself has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def is_coorganizer_or_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 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_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 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 create_service_from_json has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def create_service_from_json(task_handle, data, srv, event_id, service_ids=None):
Severity: Minor
Found in app/api/helpers/import_helpers.py - About 35 mins to fix

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

def send_email_with_action(user, action, template_name, bcc=None, **kwargs):
Severity: Minor
Found in app/api/helpers/mail.py - About 35 mins to fix

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

def import_event_task(self, email, file, source_type, creator_id):
Severity: Minor
Found in app/api/helpers/tasks.py - About 35 mins to fix

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

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

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

def validate_custom_form_constraints_request(form, schema, obj, data, excluded=None):
Severity: Minor
Found in app/api/helpers/custom_forms.py - About 35 mins to fix

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

    def before_get_object(self, view_kwargs):

        if view_kwargs.get('id') is not None:
            try:
                user_favourite_event = find_user_favourite_event_by_id(
Severity: Minor
Found in app/api/user_favourite_events.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language