tensorflow/models

View on GitHub

Showing 4,999 of 11,531 total issues

File losses_test.py has 1393 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2017 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
Severity: Major
Found in research/object_detection/core/losses_test.py - About 3 days to fix

    File t5.py has 1392 lines of code (exceeds 250 allowed). Consider refactoring.
    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
    Severity: Major
    Found in official/nlp/modeling/models/t5.py - About 3 days to fix

      File movinet_layers.py has 1391 lines of code (exceeds 250 allowed). Consider refactoring.
      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
      Severity: Major
      Found in official/projects/movinet/modeling/movinet_layers.py - About 3 days to fix

        File mobilenet.py has 1350 lines of code (exceeds 250 allowed). Consider refactoring.
        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
        Severity: Major
        Found in official/vision/modeling/backbones/mobilenet.py - About 3 days to fix

          File classifier_data_lib.py has 1329 lines of code (exceeds 250 allowed). Consider refactoring.
          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
          Severity: Major
          Found in official/nlp/data/classifier_data_lib.py - About 3 days to fix

            File visualization_utils.py has 1327 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # Copyright 2017 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
            Severity: Major
            Found in research/object_detection/utils/visualization_utils.py - About 3 days to fix

              File ops_test.py has 1327 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # Copyright 2017 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
              Severity: Major
              Found in research/object_detection/utils/ops_test.py - About 3 days to fix

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

                  def __init__(self, hps, kind="train", datasets=None):
                    """Create an LFADS model.
                
                       train - a model for training, sampling of posteriors is used
                       posterior_sample_and_average - sample from the posterior, this is used
                Severity: Minor
                Found in research/lfads/lfads.py - About 3 days 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

                File object_detection_evaluation.py has 1222 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # Copyright 2017 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
                Severity: Major
                Found in research/object_detection/utils/object_detection_evaluation.py - About 3 days to fix

                  File tasks.py has 1184 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # Copyright 2018 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
                  Severity: Major
                  Found in research/cognitive_planning/tasks.py - About 3 days to fix

                    File ssd_meta_arch.py has 1184 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # Copyright 2017 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
                    Severity: Major
                    Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 3 days to fix

                      Function convert_examples_to_features has a Cognitive Complexity of 147 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def convert_examples_to_features(examples,
                                                       tokenizer,
                                                       max_seq_length,
                                                       doc_stride,
                                                       max_query_length,
                      Severity: Minor
                      Found in official/nlp/data/squad_lib_sp.py - About 2 days 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

                      File autoaugment_utils.py has 1155 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # Copyright 2017 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
                      Severity: Major
                      Found in research/object_detection/utils/autoaugment_utils.py - About 2 days to fix

                        File nn_layers.py has 1132 lines of code (exceeds 250 allowed). Consider refactoring.
                        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
                        Severity: Major
                        Found in official/vision/modeling/layers/nn_layers.py - About 2 days to fix

                          File model_builder.py has 1103 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # Copyright 2017 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
                          Severity: Major
                          Found in research/object_detection/builders/model_builder.py - About 2 days to fix

                            File post_processing.py has 1102 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # Copyright 2017 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
                            Severity: Major
                            Found in research/object_detection/core/post_processing.py - About 2 days to fix

                              File exporter_tf1_test.py has 1094 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              # Copyright 2017 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
                              Severity: Major
                              Found in research/object_detection/exporter_tf1_test.py - About 2 days to fix

                                File heads.py has 1069 lines of code (exceeds 250 allowed). Consider refactoring.
                                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
                                Severity: Major
                                Found in official/legacy/detection/modeling/architecture/heads.py - About 2 days to fix

                                  File eval_util.py has 1067 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  # Copyright 2017 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
                                  Severity: Major
                                  Found in research/object_detection/eval_util.py - About 2 days to fix

                                    Function create_model_fn has a Cognitive Complexity of 132 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    def create_model_fn(detection_model_fn,
                                                        configs,
                                                        hparams=None,
                                                        use_tpu=False,
                                                        postprocess_on_cpu=False):
                                    Severity: Minor
                                    Found in research/object_detection/model_lib.py - About 2 days 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language