Showing 300 of 1,194 total issues
Function query
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def query(self, view_kwargs):
"""
query method for speakers list 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
Avoid deeply nested control flow statements. Open
for recording in recordings:
get_or_create(
VideoRecording,
bbb_record_id=recording['recordID'],
participants=recording['participants'],
- Create a ticketCreate a ticket
Function get_discount_data
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_discount_data(
- Create a ticketCreate a ticket
Function create_permissions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_permissions():
ownr = Role.query.filter_by(name=Role.OWNER).first()
orgr = Role.query.filter_by(name=Role.ORGANIZER).first()
coorgr = Role.query.filter_by(name=Role.COORGANIZER).first()
track_orgr = Role.query.filter_by(name=TRACK_ORGANIZER).first()
- 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 send_email_to_attendees
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def send_email_to_attendees(order):
attachments = None
if current_app.config['ATTACH_ORDER_PDF']:
attachments = [order.ticket_pdf_path, order.invoice_pdf_path]
- 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 deeply nested control flow statements. Open
if (
element not in relationships
and data[element] != getattr(order, element, None)
and element not in get_updatable_fields()
):
- Create a ticketCreate a ticket
Function db_drop_everything
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def db_drop_everything(db):
# From http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DropEverything
conn = db.engine.connect()
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def after_create_object(self, event_topic, data, view_kwargs):
"""
after create method to save roles for users and add the user as an accepted role(organizer)
:param event_topic:
: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 before_update_object
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def before_update_object(self, event_topic, data, view_kwargs):
"""
method to save image urls before updating event object
:param event_topic:
: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
Consider simplifying this complex logical expression. Open
if mode == 'stripe':
return (
(order.paid_via == 'stripe')
and order.brand
and order.transaction_id
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if data.get('is_billing_enabled') and not (
data.get('company')
and data.get('address')
and data.get('city')
and data.get('zipcode')
- Create a ticketCreate a ticket
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):
- Create a ticketCreate a ticket
Function is_user_itself
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def is_user_itself(view, view_args, view_kwargs, *args, **kwargs):
- Create a ticketCreate a ticket
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 is_coorganizer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def is_coorganizer(view, view_args, view_kwargs, *args, **kwargs):
- Create a ticketCreate a ticket
Function is_super_admin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def is_super_admin(view, view_args, view_kwargs, *args, **kwargs):
- Create a ticketCreate a ticket
Function is_admin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def is_admin(view, view_args, view_kwargs, *args, **kwargs):
- Create a ticketCreate a ticket
Function is_owner
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def is_owner(view, view_args, view_kwargs, *args, **kwargs):
- Create a ticketCreate a ticket
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):
- Create a ticketCreate a ticket
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):
- Create a ticketCreate a ticket