File files.py
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
import base64
import io
import os
import urllib.parse
import urllib.request
- Create a ticketCreate a ticket
Function create_save_image_sizes
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def create_save_image_sizes(
image_file, image_sizes_type, unique_identifier=None, folder=None
):
"""
Save the resized version of the background image
- 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_save_resized_image
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_save_resized_image(
- Create a ticketCreate a ticket
Function create_save_resized_image
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_save_resized_image(
image_file,
basewidth=None,
maintain_aspect=None,
height_size=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 uploaded_file
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def uploaded_file(files, multiple=False):
if multiple:
files_uploaded = []
for file in files:
extension = file.filename.split('.')[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 create_save_pdf
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_save_pdf(
- Create a ticketCreate a ticket
Function create_system_image
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_system_image(
image_file=None, upload_path=None, unique_identifier=None, ext='jpg'
):
"""
Create System Images for Event Topics
- 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"