Showing 27 of 39 total issues
Function eval_det
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def eval_det(dts, gts, num_classes=1, iou_thr=0.5):
""" Evaluate a given dataset by comparing DT with GT.
Args:
dts (dict or list[list[ndarray]]): detected bounding boxes for
- 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 imshow_bboxes
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def imshow_bboxes(
img,
bboxes,
score_thr=0,
colors=Color.green,
- 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 dsmd2rws_bbox
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def dsmd2rws_bbox(
rws_dir,
dsmd,
class2label,
suffix='.json_A1',
- 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 rws2dsmd_bbox
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def rws2dsmd_bbox(
filepaths,
class2label,
suffix='.json',
num_classes=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 eval_det4binarycls
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def eval_det4binarycls(dts, gts, score_thrs):
""" Evaluate a detector's classification capability.
Only support 1-class detection. If (at least) 1 target is detected in
an image, the image is considered to be 'positive'. Otherwise, the image
- 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 dcmread_dr
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def dcmread_dr(
path: Union[str, Path],
mode: DrReadMode = DrReadMode.MONOCHROME2,
read_header: bool = False,
itk_handler_enabled: bool = True
- 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 imshow_bboxes
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def imshow_bboxes(
Function download_url
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def download_url(
url: str,
dst_dir: str,
*,
filename: Optional[str] = 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 save_det_dsmd
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def save_det_dsmd(
dsmd_path: Union[str, Path],
data: Dict[str, List[np.ndarray]],
class2label: Union[str, Dict[str, int]],
auto_mkdirs: bool = True
- 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 shape_to_mask
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def shape_to_mask(img_shape, points, shape_type=None,
line_width=10, point_size=5):
mask = np.zeros(img_shape[:2], dtype=np.uint8)
mask = PIL.Image.fromarray(mask)
draw = PIL.ImageDraw.Draw(mask)
- 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 download_tree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def download_tree(self, local_dir, remote_dir):
logging.info('remote_dir, %s', remote_dir)
if not os.path.exists(local_dir):
os.makedirs(local_dir)
self.ftp.cwd(remote_dir)
- 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 save_rws_bbox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def save_rws_bbox(
Function imshow
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def imshow(
Function dsmd2rws_bbox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def dsmd2rws_bbox(
Function download_url
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def download_url(
Function save_dsmd
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def save_dsmd(dsmd_path, data, class2label=None, auto_mkdirs=True, mode='cls'):
Function crop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def crop(img, i, j, h, w):
Function draw_froc_curve
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def draw_froc_curve(average_fps,
Function shape_to_mask
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def shape_to_mask(img_shape, points, shape_type=None,
Function load_det_dsmd
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load_det_dsmd(
dsmd_path: Union[str, Path],
class2label: Union[str, Dict[str, int]]
):
""" load detection dataset metadata.
- 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"