Showing 64 of 69 total issues
Function import_modules
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def import_modules(self):
if (
self.config.COMPATIBILITY_LEGACY_LOADER
or self.config.COMPATIBILITY_LEGACY_STORAGE
or self.config.COMPATIBILITY_LEGACY_RESULT_STORAGE
- Read upRead up
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 import_item
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def import_item(
Function signal_handler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def signal_handler(server, config, sig, _):
io_loop = tornado.ioloop.IOLoop.instance()
def stop_loop(now, deadline):
if now < deadline and (
- Read upRead up
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 reload_to_fit_in_kb
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def reload_to_fit_in_kb(
Function draw_rectangle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def draw_rectangle(self, x, y, width, height):
Function apply_blur
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def apply_blur(mode, data, size, radius, sigma=0):
Function load_multiple_item
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def load_multiple_item(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function crop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def crop(self, left, top, right, bottom):
Function from_square
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def from_square(
Function __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, context, importer):
self.context = context
self.importer = importer
self.engine = None
- Read upRead up
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 reload_to_fit_in_kb
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def reload_to_fit_in_kb(
engine, initial_results, extension, initial_quality, max_bytes
):
if (
extension not in [".webp", ".jpg", ".jpeg"]
- Read upRead up
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 normalize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def normalize(self):
width, height = self.size
self.source_width = width
self.source_height = height
- Read upRead up
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_config
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_config(config, server_parameters):
if server_parameters.security_key is None:
server_parameters.security_key = config.SECURITY_KEY
if not isinstance(server_parameters.security_key, (bytes, str)):
- Read upRead up
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 import_item
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def import_item(
self,
config_key=None,
class_name=None,
is_multiple=False,
- Read upRead up
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 too many return
statements within this function. Open
return dst_im
Avoid too many return
statements within this function. Open
return None
Function debug
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def debug(self):
if not self.context.request.focal_points:
return
for point in self.context.request.focal_points:
- Read upRead up
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 ensure_dir
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ensure_dir(self, path):
if not exists(path):
try:
os.makedirs(path)
except OSError as err:
- Read upRead up
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 image_data_as_rgb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def image_data_as_rgb(self, update_image=True):
converted_image = self.image
if converted_image.mode not in ["RGB", "RGBA"]:
if "A" in converted_image.mode:
- Read upRead up
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"