tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

Function _apply_multi_bbox_augmentation_wrapper has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def _apply_multi_bbox_augmentation_wrapper(image, bboxes, prob, aug_func,
Severity: Minor
Found in official/vision/ops/augment.py - About 45 mins to fix

    Function create_detection_test_example has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def create_detection_test_example(
    Severity: Minor
    Found in official/vision/dataloaders/tfexample_utils.py - About 45 mins to fix

      Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def __init__(self,
      Severity: Minor
      Found in official/vision/utils/object_detection/target_assigner.py - About 45 mins to fix

        Function random_crop_image_v2 has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def random_crop_image_v2(
        Severity: Minor
        Found in official/vision/ops/preprocess_ops.py - About 45 mins to fix

          Function _visualize_boxes has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def _visualize_boxes(image, boxes, classes, scores, category_index, **kwargs):
          Severity: Minor
          Found in official/vision/utils/object_detection/visualization_utils.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if not agnostic_mode:
                        if classes[i] in category_index.keys():
                          class_name = category_index[classes[i]]['name']
                        else:
                          class_name = 'N/A'
            Severity: Major
            Found in official/vision/utils/object_detection/visualization_utils.py - About 45 mins to fix

              Function crop_image has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def crop_image(
              Severity: Minor
              Found in official/vision/ops/preprocess_ops_3d.py - About 45 mins to fix

                Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def __init__(self,
                Severity: Minor
                Found in official/vision/evaluation/segmentation_metrics.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  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)
                  Severity: Major
                  Found in official/vision/utils/object_detection/visualization_utils.py - About 45 mins to fix

                    Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def __init__(self, num_categories, ignored_label, max_instances_per_category,
                    Severity: Minor
                    Found in official/vision/evaluation/panoptic_quality_evaluator.py - About 45 mins to fix

                      Function _write_summaries has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def _write_summaries(
                            self, summary_dict: Dict[str, Any], relative_path: str = ''
                        ):
                          for name, value in summary_dict.items():
                            if isinstance(value, dict):
                      Severity: Minor
                      Found in official/vision/utils/summary_manager.py - About 45 mins to fix

                      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

                      def boolean_mask(boxlist,
                      Severity: Minor
                      Found in official/vision/utils/object_detection/box_list_ops.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  if 'counts' in ann['segmentation']:
                                    ann['segmentation']['counts'] = six.ensure_str(
                                        ann['segmentation']['counts'])
                                  if 'areas' not in groundtruths:
                        Severity: Major
                        Found in official/vision/evaluation/coco_utils.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    if 'areas' not in groundtruths:
                                      ann['area'] = mask_api.area(encoded_mask)
                                  if 'keypoints' in groundtruths:
                          Severity: Major
                          Found in official/vision/evaluation/coco_utils.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            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)
                            Severity: Major
                            Found in official/vision/evaluation/coco_utils.py - About 45 mins to fix

                              Function create_3d_image_test_example has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def create_3d_image_test_example(
                              Severity: Minor
                              Found in official/vision/dataloaders/tfexample_utils.py - About 45 mins to fix

                                Function random_horizontal_flip has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def random_horizontal_flip(image,
                                Severity: Minor
                                Found in official/vision/utils/object_detection/preprocessor.py - About 45 mins to fix

                                  Function scan_and_generator_annotation_file has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def scan_and_generator_annotation_file(file_pattern: str,
                                  Severity: Minor
                                  Found in official/vision/evaluation/coco_utils.py - About 45 mins to fix

                                    Function _run_experiment_with_preemption_recovery has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    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
                                    Severity: Minor
                                    Found in official/vision/train.py - About 45 mins to fix

                                    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

                                    def add_trainer(experiment: cfg.ExperimentConfig,
                                    Severity: Minor
                                    Found in official/vision/configs/video_classification.py - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language