Function export_orders_csv
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
def export_orders_csv(orders):
headers = [
'Order#',
'Order Date',
'Status',
- 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_sessions_csv
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
def export_sessions_csv(sessions):
headers = [
'Session Title',
'Session Starts At',
'Session Ends 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 export_speakers_csv
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def export_speakers_csv(speakers):
headers = [
'Speaker Name',
'Speaker Email',
'Speaker Session(s)',
- 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
File csv_jobs_util.py
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytz
from app.api.admin_sales.utils import event_type, summary
from app.api.helpers.group_user_role import get_user_group_role
from app.models import db
- Create a ticketCreate a ticket
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 get_order_ticket_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_order_ticket_data(attendee, order, ticket):
"""Get order ticket data"""
data = {}
if not 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 export_sales_csv
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def export_sales_csv(sales):
headers = [
'Event Name',
'Owner Name',
'Owner Email',
- 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_order_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_order_data(order):
"""Get order data from order object"""
if not order:
return {
'Tax 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
Avoid deeply nested control flow statements. Open
if access_code:
access_code_value = access_code.code
break
- Create a ticketCreate a ticket
Function export_group_followers_csv
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def export_group_followers_csv(followers):
headers = [
'Public Profile Name',
'Email',
'Group Join Date',
- 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"