Showing 11,634 of 11,634 total issues
Function ssd_random_crop_pad_fixed_aspect_ratio
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def ssd_random_crop_pad_fixed_aspect_ratio(
image,
boxes,
labels,
label_weights,
- 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 assign_center_targets_from_keypoints
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assign_center_targets_from_keypoints(self,
Function assign_keypoints_offset_targets
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assign_keypoints_offset_targets(self,
Function batch_assign
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def batch_assign(target_assigner,
Function random_image_scale
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def random_image_scale(image,
Avoid deeply nested control flow statements. Open
Open
if image_id not in keypoint_annotations_index:
keypoint_annotations_index[image_id] = {}
keypoint_annotations_index[image_id][annotation['id']] = annotation
Function random_black_patches
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def random_black_patches(image,
Function random_jpeg_quality
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def random_jpeg_quality(image,
Function assign_part_and_coordinate_targets
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assign_part_and_coordinate_targets(self,
Avoid deeply nested control flow statements. Open
Open
if image_id not in densepose_annotations_index:
densepose_annotations_index[image_id] = {}
densepose_annotations_index[image_id][annotation['id']] = annotation
Function __call__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __call__(self,
Function batch_assign
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def batch_assign(self,
Function graph_fn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def graph_fn(anchor_means, groundtruth_boxlist1, groundtruth_boxlist2,
Avoid deeply nested control flow statements. Open
Open
if ((int(global_step.value()) - checkpointed_step) >=
checkpoint_every_n):
manager.save()
checkpointed_step = int(global_step.value())
Avoid deeply nested control flow statements. Open
Open
if base_network_scope + '_' not in var_name: # LSTM and FeatureMap
variables_to_restore[var_name] = variable
if scope_to_replace in var_name:
Function get_configs_from_multiple_files
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_configs_from_multiple_files(model_config_path="",
Avoid deeply nested control flow statements. Open
Open
for key, val in logged_dict.items():
tf.compat.v2.summary.scalar(key, val, step=global_step)
Avoid deeply nested control flow statements. Open
Open
for tensor in tensor_dict.values():
self.assertAllEqual(tensor, np.arange(i * i).reshape((i, i)))
i += 1
with self.assertRaises(tf.errors.OutOfRangeError):
Avoid deeply nested control flow statements. Open
Open
if soft_nms_sigma != 0:
raise ValueError('Soft NMS not supported in current TF version!')
selected_indices = tf.image.non_max_suppression(
Function get_from_replay_buffer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_from_replay_buffer(self, batch_size):
"""Sample a batch of episodes from the replay buffer."""
if self.replay_buffer is None or len(self.replay_buffer) < 1 * batch_size:
return None, 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"