Showing 300 of 1,194 total issues
File routes.py
has 2070 lines of code (exceeds 250 allowed). Consider refactoring. Open
from app.api.access_codes import (
AccessCodeDetail,
AccessCodeList,
AccessCodeListPost,
AccessCodeRelationshipOptional,
- Create a ticketCreate a ticket
File tasks.py
has 834 lines of code (exceeds 250 allowed). Consider refactoring. Open
import base64
import csv
import logging
import os
import urllib.error
- Create a ticketCreate a ticket
Function permission_manager
has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring. Open
def permission_manager(view, view_args, view_kwargs, *args, **kwargs):
"""The function use to check permissions
:param callable view: the view
:param list view_args: view args
- 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 orders.py
has 760 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import logging
import time
import omise
- Create a ticketCreate a ticket
File mail.py
has 746 lines of code (exceeds 250 allowed). Consider refactoring. Open
import base64
import datetime
import logging
import os
from itertools import groupby
- Create a ticketCreate a ticket
Function before_update_object
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
def before_update_object(self, order, data, view_kwargs):
"""
before update object method of order details
1. admin can update all the fields.
2. event organizer
- 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 events.py
has 725 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datetime import datetime
import pytz
from flask import g, request
from flask.blueprints import Blueprint
- Create a ticketCreate a ticket
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 before_get_object
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
def before_get_object(self, view_kwargs):
"""
before get method for user object
: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
File static.py
has 563 lines of code (exceeds 250 allowed). Consider refactoring. Open
##
# Module for helper static variables
##
# Event Licences
- Create a ticketCreate a ticket
File events.py
has 507 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pytz
from flask_rest_jsonapi.exceptions import ObjectNotFound
from marshmallow import validate, validates_schema
from marshmallow.schema import Schema
from marshmallow_jsonapi import fields
- Create a ticketCreate a ticket
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
File event.py
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
import re
from argparse import Namespace
from datetime import datetime
import flask_login as login
- Create a ticketCreate a ticket
File discount_codes.py
has 460 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datetime import datetime
from flask_jwt_extended import current_user
from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship
from flask_rest_jsonapi.exceptions import ObjectNotFound
- Create a ticketCreate a ticket
Function before_get
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def before_get(self, args, kwargs):
if kwargs.get('ticket_id'):
if has_access('is_coorganizer'):
ticket = safe_query_kwargs(Ticket, kwargs, 'ticket_id')
if ticket.discount_code_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
User
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
class User(SoftDeletionModel):
"""User model class"""
__tablename__ = 'users'
- Create a ticketCreate a ticket
Function query
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def query(self, view_kwargs):
"""
query method for EventList 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
File permission_manager.py
has 432 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
from typing import Union
from flask import request
from flask_jwt_extended import current_user, verify_jwt_in_request
- Create a ticketCreate a ticket
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 auth.py
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
import base64
import logging
import random
import string
from datetime import timedelta
- Create a ticketCreate a ticket