tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

def format_filename(prefix, bsz_per_host, seq_len, bi_data, suffix,
                    mask_alpha=5, mask_beta=1, reuse_len=None, uncased=False,
                    fixed_num_predict=None):
  """docs."""
  if reuse_len is None:
Severity: Minor
Found in official/legacy/xlnet/preprocess_pretrain_data.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 get_callbacks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def get_callbacks(pruning_method=None,
                  enable_checkpoint_and_export=False,
                  model_dir=None):
  """Returns common callbacks."""
  time_callback = keras_utils.TimeHistory(
Severity: Minor
Found in official/legacy/image_classification/resnet/common.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 preprocess_image has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def preprocess_image(image_buffer,
Severity: Minor
Found in official/legacy/image_classification/resnet/imagenet_preprocessing.py - About 45 mins to fix

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

    def convert_single_example(example_index, example, label_list, max_seq_length,
    Severity: Minor
    Found in official/legacy/xlnet/classifier_utils.py - About 45 mins to fix

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

      def translate_and_compute_bleu(model,
      Severity: Minor
      Found in official/legacy/transformer/transformer_main.py - About 45 mins to fix

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

        def _generate_subtokens_with_target_vocab_size(token_counts,
        Severity: Minor
        Found in official/legacy/transformer/utils/tokenizer.py - About 45 mins to fix

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

          def resnet50(num_classes,
          Severity: Minor
          Found in official/legacy/image_classification/resnet/resnet_model.py - About 45 mins to fix

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

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

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

                def testAnchorGenerationAreCentered(self, min_level, max_level, num_scales,
              Severity: Minor
              Found in official/vision/ops/anchor_test.py - About 45 mins to fix

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

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

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

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

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

                    def preprocess_for_train(image_bytes: tf.Tensor,
                    Severity: Minor
                    Found in official/legacy/image_classification/preprocessing.py - About 45 mins to fix

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

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

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

                        def eval_squad(strategy,
                        Severity: Minor
                        Found in official/legacy/bert/run_squad_helper.py - About 45 mins to fix

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

                          def bilinear_resize_to_bbox(
                              images: tf.Tensor, bbox: tf.Tensor, output_size: tf.Tensor
                          ) -> tf.Tensor:
                            """Bilinear resizes the images to fit into the bounding boxes in the output.
                          
                          
                          Severity: Minor
                          Found in official/vision/ops/spatial_transform_ops.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 testLabelAnchors has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            def testLabelAnchors(self, min_level, max_level, num_scales, aspect_ratios,
                          Severity: Minor
                          Found in official/vision/ops/anchor_test.py - About 45 mins to fix

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

                            def classifier_model(bert_config,
                            Severity: Minor
                            Found in official/legacy/bert/bert_models.py - About 45 mins to fix

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

                              def _parse_policy_info(name: Text, prob: float, level: float,
                              Severity: Minor
                              Found in official/legacy/image_classification/augment.py - About 45 mins to fix

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

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

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

                                    def testAnchorGenerationWithImageSizeAsTensor(self,
                                  Severity: Minor
                                  Found in official/vision/ops/anchor_test.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language