tensorflow/models

View on GitHub

Showing 5,006 of 11,538 total issues

File encoders.py has 703 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/configs/encoders.py - About 1 day to fix

    File controller_test.py has 702 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # Copyright 2024 The Orbit 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 orbit/controller_test.py - About 1 day to fix

      File coco_evaluator.py has 699 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/evaluation/coco_evaluator.py - About 1 day to fix

        File kernel_attention.py has 695 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/layers/kernel_attention.py - About 1 day to fix

          File universal_detector.py has 687 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/unified_detector/modeling/universal_detector.py - About 1 day to fix

            Function convert_examples_to_features has a Cognitive Complexity of 78 (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.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 spatial_transform_ops.py has 678 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/ops/spatial_transform_ops.py - About 1 day to fix

              Function build has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
              Open

              def build(preprocessor_step_config):
                """Builds preprocessing step based on the configuration.
              
                Args:
                  preprocessor_step_config: PreprocessingStep configuration proto.
              Severity: Minor
              Found in research/object_detection/builders/preprocessor_builder.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

              Function train has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
              Open

              def train(
                  strategy: tf.distribute.Strategy,
                  model_fn: Callable,
                  input_meta_data: Dict,
                  train_input_fn: Callable,
              Severity: Minor
              Found in official/legacy/xlnet/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 mobilenet_v3.py has 665 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # Copyright 2019 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/slim/nets/mobilenet/mobilenet_v3.py - About 1 day to fix

                File agent.py has 661 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/efficient-hrl/agent.py - About 1 day to fix

                  File rewards_functions.py has 656 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/efficient-hrl/context/rewards_functions.py - About 1 day to fix

                    File movinet.py has 649 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.py - About 1 day to fix

                      File distributed_executor.py has 639 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/executor/distributed_executor.py - About 1 day to fix

                        File dense_prediction_heads.py has 634 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/heads/dense_prediction_heads.py - About 1 day to fix

                          File ddpg_agent.py has 633 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/efficient-hrl/agents/ddpg_agent.py - About 1 day to fix

                            File visualization_utils.py has 630 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/cognitive_planning/visualization_utils.py - About 1 day to fix

                              File panoptic_deeplab.py has 625 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/panoptic/configs/panoptic_deeplab.py - About 1 day to fix

                                File batch_multiclass_nms_test.py has 624 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                # Copyright 2019 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/batch_multiclass_nms_test.py - About 1 day to fix

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