tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

  def testAffineWarpImage(self,
Severity: Minor
Found in official/projects/yolo/ops/preprocessing_ops_test.py - About 45 mins to fix

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

    def _scale_boxes(encoded_boxes, width, height, anchor_grid, grid_points,
    Severity: Minor
    Found in official/projects/yolo/ops/loss_utils.py - About 45 mins to fix

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

        def __init__(
            self,
            model_id: int,
            input_channel_dims: int,
            input_specs=tf_keras.layers.InputSpec(shape=[None, None, None, 3]),
      Severity: Minor
      Found in official/projects/centernet/modeling/backbones/hourglass.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 image_rand_hsv has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def image_rand_hsv(image, rh, rs, rv, seed=None, darknet=False):
      Severity: Minor
      Found in official/projects/yolo/ops/preprocessing_ops.py - About 45 mins to fix

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

        def _new_coord_scale_boxes(encoded_boxes, width, height, anchor_grid,
        Severity: Minor
        Found in official/projects/yolo/ops/loss_utils.py - About 45 mins to fix

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

            def read(self,
          Severity: Minor
          Found in official/projects/yolo/ops/kmeans_anchors.py - About 45 mins to fix

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

            def _anchor_free_scale_boxes(encoded_boxes,
            Severity: Minor
            Found in official/projects/yolo/ops/loss_utils.py - About 45 mins to fix

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

              def convert(checkpoint_from_path,
              Severity: Minor
              Found in official/projects/mobilebert/tf2_model_checkpoint_converter.py - About 45 mins to fix

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

                  def get_boxes(self,
                Severity: Minor
                Found in official/projects/centernet/modeling/layers/detection_generator.py - About 45 mins to fix

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

                    def _get_centers(self, boxes, classes, anchors, width, height, scale_xy):
                  Severity: Minor
                  Found in official/projects/yolo/ops/anchor.py - About 45 mins to fix

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

                    def convert_checkpoint(model_id: int,
                    Severity: Minor
                    Found in official/projects/centernet/utils/tf2_centernet_checkpoint_converter.py - About 45 mins to fix

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

                        def build_label_per_path(self,
                      Severity: Minor
                      Found in official/projects/yolo/ops/anchor.py - About 45 mins to fix

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

                        def build_grid(indexes, truths, preds, ind_mask, update=False, grid=None):
                        Severity: Minor
                        Found in official/projects/yolo/ops/loss_utils.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                      if not self.is_train or ent_type != "O":
                                        spans.append((i, j, "mask", ent_type))
                                      else:
                                        negative_spans.append((i, j, "mask", ent_type))
                                        intersection_size = (is_token_entity_prefix[j + 1] -
                          Severity: Major
                          Found in official/projects/fffner/utils/create_data.py - About 45 mins to fix

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

                              def __call__(self, true_counts, inds, y_true, boxes, classes, y_pred):
                            Severity: Minor
                            Found in official/projects/yolo/losses/yolo_loss.py - About 45 mins to fix

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

                              def build_bert_pretrainer(pretrainer_cfg: params.PretrainerModelParams,
                                                        encoder: Optional[tf_keras.Model] = None,
                                                        masked_lm: Optional[tf_keras.Model] = None,
                                                        quantization_friendly: Optional[bool] = False,
                                                        name: Optional[str] = None) -> tf_keras.Model:
                              Severity: Minor
                              Found in official/projects/edgetpu/nlp/modeling/model_builder.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 _compute_loss has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                def _compute_loss(self, true_counts, inds, y_true, boxes, classes, y_pred):
                              Severity: Minor
                              Found in official/projects/yolo/losses/yolo_loss.py - About 45 mins to fix

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

                                  def _compute_loss(self, true_counts, inds, y_true, boxes, classes, y_pred):
                                Severity: Minor
                                Found in official/projects/yolo/losses/yolo_loss.py - About 45 mins to fix

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

                                    def __init__(self,
                                                 filters=1,
                                                 kernel_size=(1, 1),
                                                 strides=(1, 1),
                                                 padding='same',
                                  Severity: Minor
                                  Found in official/projects/yolo/modeling/layers/nn_blocks.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 test_parser has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def test_parser(self, output_size, dtype, is_training, aug_name,
                                                    is_multilabel, decode_jpeg_only, image_format):
                                  
                                      serialized_example = tfexample_utils.create_classification_example(
                                          output_size[0], output_size[1], image_format, is_multilabel)

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language