Showing 300 of 1,194 total issues
Function before_get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def before_get(self, args, kwargs):
refresh = request.args.get('refresh')
if refresh == 'true':
refresh_settings()
kwargs['id'] = 1
- 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_event_user_ticket_holders
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_event_user_ticket_holders(order, data, element):
if element in ['event', 'user'] and data[element] != str(
getattr(order, element, None).id
):
raise ForbiddenError(
- 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 _upload_media_queue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _upload_media_queue(srv, obj):
"""
Add media uploads to queue
"""
global UPLOAD_QUEUE
- 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 export_xcal_task
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def export_xcal_task(self, event_id, temp=True):
event = safe_query(Event, 'id', event_id, 'event_id')
try:
if temp:
- 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
Avoid too many return
statements within this function. Open
return None
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return True, 'celery ok'
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return True, None
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return False, 'Payment already been verified'
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return False, 'Payment Not Found'
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return False, 'celery not ok'
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return None
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return None
- Create a ticketCreate a ticket
Function validate_date
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_date(self, data, original_data):
if 'id' in original_data['data']:
ticket = Ticket.query.filter_by(id=original_data['data']['id']).one()
if 'sales_starts_at' not in 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 configure_paypal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def configure_paypal():
"""
Configure the paypal sdk
:return: Credentials
"""
- 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 add_in_room
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_in_room(
self, event: Event, rocket_user_id, microlocation: Optional[Microlocation] = None
):
bot = self.check_or_create_bot()
data = self.get_token(bot)
- 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_get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def after_get(custom_forms):
"""
query method for different view_kwargs
: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_patch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def before_patch(_args, _kwargs, data):
"""
before patch method
:param _args:
:param kwargs:
- 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 _email_message
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _email_message(cls, action, attr=None):
message = {}
if action in MailType.entries():
message = MAILS.get(action)
else:
- 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 reject_invite
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reject_invite(speaker_invite_id):
try:
speaker_invite = SpeakerInvite.query.filter_by(id=speaker_invite_id).one()
except NoResultFound:
raise NotFoundError({'source': ''}, 'Speaker Invite 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"