fossasia/open-event-orga-server

View on GitHub

Showing 1,194 of 1,194 total issues

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

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

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

def set_event_id(model, identifier, kwargs, attr='event_id', column_name='id'):
Severity: Minor
Found in app/api/events.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_owner has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

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

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

def is_registrar_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 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 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 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 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 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 before_update_object has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def before_update_object(self, discount, data, view_kwargs):
        """
        Method to edit object
        :param discount:
        :param data:
Severity: Minor
Found in app/api/discount_codes.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

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

    def check_extra(obj, data):
        if not data.get('extra'):
            return
        channel_id = data.get('channel') or obj.channel_id
        if not channel_id:
Severity: Minor
Found in app/api/video_stream.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

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

def get_chat_token(event_id: int):
    event = Event.query.get_or_404(event_id)

    if not VideoStream(event_id=event.id).user_can_access:
        raise NotFoundError({'source': ''}, 'Video Stream Not Found')
Severity: Minor
Found in app/api/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

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

    def create_room_virtual_room(
        self, event: Event, videoStream: Optional[VideoStream], data
    ):
        bot_token = data['token']
        bot_id = data['res']['data']['userId']
Severity: Minor
Found in app/api/chat/rocket_chat.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