tensorflow/models

View on GitHub

Showing 5,006 of 11,538 total issues

File box_list_ops.py has 894 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/utils/object_detection/box_list_ops.py - About 2 days to fix

    File config_util_test.py has 880 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/config_util_test.py - About 2 days to fix

      File export_tfhub_lib_test.py has 879 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/tools/export_tfhub_lib_test.py - About 2 days to fix

        File assemblenet.py has 878 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/assemblenet/modeling/assemblenet.py - About 2 days to fix

          Function postprocess_output has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
          Open

          def postprocess_output(all_examples,
                                 all_features,
                                 all_results,
                                 n_best_size,
                                 max_answer_length,
          Severity: Minor
          Found in official/nlp/data/squad_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

          File convolutional_keras_box_predictor_tf2_test.py has 857 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

            File nn_blocks_test.py has 841 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_blocks_test.py - About 2 days to fix

              File convolutional_box_predictor_tf1_test.py has 840 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

                File ssd_spaghettinet_feature_extractor.py has 833 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """SpaghettiNet Feature Extractor."""
                from __future__ import absolute_import
                from __future__ import division
                from __future__ import print_function
                
                
                Severity: Major
                Found in research/object_detection/models/ssd_spaghettinet_feature_extractor.py - About 2 days to fix

                  File coco_tools.py has 833 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/metrics/coco_tools.py - About 2 days to fix

                    File xception.py has 830 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # Lint as: python2, python3
                    # 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.
                    Severity: Major
                    Found in research/deeplab/core/xception.py - About 1 day to fix

                      Function run_customized_training_loop has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def run_customized_training_loop(
                          # pylint: disable=invalid-name
                          _sentinel=None,
                          # pylint: enable=invalid-name
                          strategy=None,
                      Severity: Minor
                      Found in official/legacy/bert/model_training_utils.py - About 1 day 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 nn_layers.py has 828 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/qat/vision/modeling/layers/nn_layers.py - About 1 day to fix

                        File add_context_to_examples.py has 819 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # Copyright 2020 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

                          File maxvit.py has 817 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/maxvit/modeling/maxvit.py - About 1 day to fix

                            File longformer_attention.py has 815 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/longformer/longformer_attention.py - About 1 day to fix

                              File rebar.py has 802 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              # Copyright 2017 Google Inc. 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/rebar/rebar.py - About 1 day to fix

                                Function postprocess_output has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def postprocess_output(all_examples,
                                                       all_features,
                                                       all_results,
                                                       n_best_size,
                                                       max_answer_length,
                                Severity: Minor
                                Found in official/nlp/data/squad_lib_sp.py - About 1 day 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 mosaic_blocks.py has 783 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/mosaic/modeling/mosaic_blocks.py - About 1 day to fix

                                  File squad_lib_sp.py has 773 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/squad_lib_sp.py - About 1 day to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language