Showing 11 of 11 total issues
Function recognize_face_video
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def recognize_face_video(
self,
video_path: str = None,
detection_interval: int = 15,
save_output: bool = 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
Function register_face_webcam
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def register_face_webcam(
self, name: str = None, detection_interval: int = 5
) -> bool:
if name is None:
raise NoNameProvided
- 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 recognize_faces
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def recognize_faces(
self, image, threshold: float = 0.6, bboxes: List[List[int]] = None
):
"""Finds matching registered users for the
face(s) in the input image. The input image should be cropped to contain
- 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 detect_faces
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def detect_faces(self, image, conf_threshold: float = 0.7) -> List[List[int]]:
"""Performs facial detection on an image. Uses OpenCV DNN based face detector.
Args:
image (numpy array):
conf_threshold (float, optional): Threshold confidence to consider
- 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 recognize_face_video
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def recognize_face_video(
Function detect_faces
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def detect_faces(self, image, conf_threshold: float = 0.7) -> List[List[int]]:
"""Performs facial detection on an image. Uses MTCNN.
Args:
image (numpy array):
conf_threshold (float, optional): Threshold confidence to consider
- 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 delete_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def delete_data(self, face_id: str) -> bool:
"""Deletes the facial record that match the facial
Id from persistent DB.
Args:
- 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 __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, data: List[Dict] = None):
"""Constructor
Args:
data (List[Dict], optional): Initial data to load in the cache.
- 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 register_face
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def register_face(self, image=None, name: str = None, bbox: List[int] = None):
"""Method to register a face via the facial encoding.
Siamese neural network is used to generate 128 numbers
for a given facial region. These encodings can be used to identify a
facial ROI for identification later.
- 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 is_valid_bbox
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def is_valid_bbox(self, bbox: List[int], height: int, width: int) -> bool:
"""Checks if the bounding box exists in the image.
Args:
bbox (List[int]): Bounding box coordinates
- 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 delete_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete_data(self, face_id: str):
"""Deletes the facial record that match the facial
Id from cache.
Args:
- 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"