official/projects/yolo/ops/preprocessing_ops.py
File preprocessing_ops.py
has 706 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# Copyright 2024 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function resize_and_jitter_image
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def resize_and_jitter_image(image,
desired_size,
jitter=0.0,
letter_box=None,
random_pad=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 mosaic_cut
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def mosaic_cut(image, original_width, original_height, width, height, center,
Function resize_and_jitter_image
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def resize_and_jitter_image(image,
Function affine_warp_image
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def affine_warp_image(image,
Function _build_transform
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _build_transform(image,
Function _build_transform
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def _build_transform(image,
perspective=0.00,
degrees=0.0,
scale_min=1.0,
scale_max=1.0,
Function transform_and_clip_boxes
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def transform_and_clip_boxes(boxes,
Function image_rand_hsv
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def image_rand_hsv(image, rh, rs, rv, seed=None, darknet=False):
Function boxes_candidates
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def boxes_candidates(clipped_boxes,
Function random_uniform_strong
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def random_uniform_strong(minval,
Function resize_and_crop_boxes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def resize_and_crop_boxes(boxes, image_scale, output_size, offset, box_history):
Function _augment_hsv_darknet
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _augment_hsv_darknet(image, rh, rs, rv, seed=None):
Function _augment_hsv_torch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _augment_hsv_torch(image, rh, rs, rv, seed=None):