File events.py
has 725 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datetime import datetime
import pytz
from flask import g, request
from flask.blueprints import Blueprint
- Create a ticketCreate a ticket
Function query
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def query(self, view_kwargs):
"""
query method for EventList class
:param view_kwargs:
:return:
- Read upRead up
- Create a ticketCreate a ticket
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 before_update_object
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def before_update_object(self, event, data, view_kwargs):
"""
method to save image urls before updating event object
:param event:
:param data:
- Read upRead up
- Create a ticketCreate a ticket
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 validate_date
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def validate_date(event, data):
if event:
if 'starts_at' not in data:
data['starts_at'] = event.starts_at
- Read upRead up
- Create a ticketCreate a ticket
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 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'):
- Create a ticketCreate a ticket
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')
- Read upRead up
- Create a ticketCreate a ticket
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_virtual_room_chat_token
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_virtual_room_chat_token(event_id: int, video_stream_id: int):
"""
Get room chat token for specific room
@param event_id: event identifier
@param video_stream_id: microlocation id
- Read upRead up
- Create a ticketCreate a ticket
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_room_chat_token
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_room_chat_token(event_id: int, microlocation_id: int):
"""
Get room chat token for specific room
@param event_id: event identifier
@param microlocation_id: microlocation id
- Read upRead up
- Create a ticketCreate a ticket
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"