Showing 300 of 1,194 total issues
Function validate_quantity
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def validate_quantity(self, data):
if 'max_order' in data and 'min_order' in data:
if data['max_order'] < data['min_order']:
raise UnprocessableEntityError(
{'pointer': '/data/attributes/max-order'},
- 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_attendee_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_attendee_data(attendee, custom_forms, attendee_form_dict):
"""Get attendee data from attendee object"""
order_ticket_data = get_order_ticket_data(attendee, attendee.order, attendee.ticket)
data = {
**order_ticket_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 is_discount_available
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def is_discount_available(
discount_code,
tickets=None,
ticket_holders=None,
quantity_discount=None,
- 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_after_event_mail
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def send_after_event_mail():
current_time = datetime.datetime.now()
events = (
Event.query.filter_by(state='published', deleted_at=None)
.filter(
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def before_update_object(self, session, data, view_kwargs):
"""
before update method to verify if session is locked before updating session 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 send_email_task_sendgrid
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def send_email_task_sendgrid(payload):
message = Mail(
from_email=From(payload['from'], payload['fromname']),
to_emails=payload['to'],
subject=payload['subject'],
- 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_update_object
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def after_update_object(self, session, data, view_kwargs):
"""Send email if session accepted or rejected"""
if data.get('send_email', None) and g.get('send_email'):
notify_for_session(session)
- 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
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def export(event_id):
"""Takes an event id and returns the event in xCal format"""
event = Event.query.get(event_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 downgrade
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.alter_column('users', 'signup_at',
existing_type=sa.DateTime(timezone=True),
type_=postgresql.TIMESTAMP(),
- Create a ticketCreate a ticket
Function populate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def populate():
"""
Create defined Roles, Services and Permissions.
"""
print('Creating roles...')
- Create a ticketCreate a ticket
Function validate_quantity
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def validate_quantity(self, data, original_data):
if 'id' in original_data['data']:
try:
discount_code = DiscountCode.query.filter_by(
id=original_data['data']['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 validate_quantity
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def validate_quantity(self, data, original_data):
if 'id' in original_data['data']:
try:
discount_code = DiscountCode.query.filter_by(
id=original_data['data']['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 accept_invite
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def accept_invite():
token = request.json['data']['token']
try:
role_invite = RoleInvite.query.filter_by(hash=token).one()
except NoResultFound:
- 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 query
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def query(self, view_kwargs):
"""
query method for resource list
: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 create_onsite_attendees_for_order
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create_onsite_attendees_for_order(data):
"""
Creates on site ticket holders for an order and adds it into the request data.
:param data: data initially passed in the POST request for order.
: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 create_object
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create_object(data, _view_kwargs):
"""
create_object method for the Badge Form Layer
charge the user using paypal or stripe
: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_post
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def before_post(self, args, kwargs, data=None):
"""
method to add user_id to view_kwargs before post
: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 downgrade
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('temp_user',
sa.Column('id', sa.INTEGER(), nullable=False),
- Create a ticketCreate a ticket
Function create_app
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_app():
global app_created
if not app_created:
BlueprintsManager.register(app)
graphql_views.init_app(app)
- Create a ticketCreate a ticket
Function upgrade
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(u'association_ticket_tag_id_fkey', 'association', type_='foreignkey')
op.drop_constraint(u'association_ticket_id_fkey', 'association', type_='foreignkey')
op.create_foreign_key(None, 'association', 'ticket_tag', ['ticket_tag_id'], ['id'], ondelete='CASCADE')
- Create a ticketCreate a ticket