Showing 11,634 of 11,634 total issues
Function _apply_multi_bbox_augmentation_wrapper
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _apply_multi_bbox_augmentation_wrapper(image, bboxes, prob, aug_func,
Function create_detection_test_example
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_detection_test_example(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self,
Function random_crop_image_v2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def random_crop_image_v2(
Function _visualize_boxes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _visualize_boxes(image, boxes, classes, scores, category_index, **kwargs):
Avoid deeply nested control flow statements. Open
Open
if not agnostic_mode:
if classes[i] in category_index.keys():
class_name = category_index[classes[i]]['name']
else:
class_name = 'N/A'
Function crop_image
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def crop_image(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self,
Avoid deeply nested control flow statements. Open
Open
if not display_str:
display_str = '{}%'.format(int(100 * scores[i]))
else:
display_str = '{}: {}%'.format(display_str, int(100 * scores[i]))
box_to_display_str_map[box].append(display_str)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, num_categories, ignored_label, max_instances_per_category,
Function _write_summaries
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def _write_summaries(
self, summary_dict: Dict[str, Any], relative_path: str = ''
):
for name, value in summary_dict.items():
if isinstance(value, dict):
- 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 boolean_mask
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def boolean_mask(boxlist,
Avoid deeply nested control flow statements. Open
Open
if 'counts' in ann['segmentation']:
ann['segmentation']['counts'] = six.ensure_str(
ann['segmentation']['counts'])
if 'areas' not in groundtruths:
Avoid deeply nested control flow statements. Open
Open
if 'areas' not in groundtruths:
ann['area'] = mask_api.area(encoded_mask)
if 'keypoints' in groundtruths:
Avoid deeply nested control flow statements. Open
Open
for z in range(len(keypoints[j, k, :, 1])):
# Convert from [y, x] to [x, y] as mandated by COCO.
x = float(keypoints[j, k, z, 1])
y = float(keypoints[j, k, z, 0])
coco_keypoints.append(x)
Function create_3d_image_test_example
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_3d_image_test_example(
Function random_horizontal_flip
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def random_horizontal_flip(image,
Function scan_and_generator_annotation_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def scan_and_generator_annotation_file(file_pattern: str,
Function _run_experiment_with_preemption_recovery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def _run_experiment_with_preemption_recovery(params, model_dir):
"""Runs experiment and tries to reconnect when encounting a preemption."""
keep_training = True
while keep_training:
preemption_watcher = 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 add_trainer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_trainer(experiment: cfg.ExperimentConfig,