File video_stream.py
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
from uuid import uuid4
from flask import jsonify
from flask.blueprints import Blueprint
- Create a ticketCreate a ticket
Function after_update_object
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def after_update_object(self, stream, data, view_kwargs):
if stream.channel and stream.channel.provider == 'bbb':
bbb_options = stream.extra.get('bbb_options')
if bbb_options and bbb_options.get('endCurrentMeeting'):
params_isMeetingRunning = dict(
- 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 join_stream
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def join_stream(stream_id: int):
stream = VideoStream.query.get_or_404(stream_id)
if not stream.user_can_access:
raise NotFoundError({'source': ''}, 'Video Stream Not Found')
if not stream.channel or stream.channel.provider != 'bbb':
- 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 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:
- 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 after_create_object
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def after_create_object(self, stream, data, view_kwargs):
if stream.channel and stream.channel.provider == 'bbb':
params_isMeetingRunning = dict(
meetingID=stream.extra['response']['meetingID'],
)
- 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_chat_token
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_chat_token(stream_id: int):
stream = VideoStream.query.get_or_404(stream_id)
event = stream.event
if not stream.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"