tensorflow/models

View on GitHub

Showing 5,006 of 11,538 total issues

File model.py has 767 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/model.py - About 1 day to fix

    File augment.py has 766 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/image_classification/augment.py - About 1 day to fix

      File transformer.py has 765 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/detr/modeling/transformer.py - About 1 day to fix

        File data_pipeline.py has 752 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/recommendation/data_pipeline.py - About 1 day to fix

          File feature_map_generators_test.py has 751 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/models/feature_map_generators_test.py - About 1 day to fix

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

              File squad_utils.py has 735 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/xlnet/squad_utils.py - About 1 day to fix

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

                  File preprocess_pretrain_data.py has 733 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/xlnet/preprocess_pretrain_data.py - About 1 day to fix

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

                      File box_ops.py has 716 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/box_ops.py - About 1 day to fix

                        File resnet_v1_beta.py has 714 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/resnet_v1_beta.py - About 1 day to fix

                          File t5_test.py has 714 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_test.py - About 1 day to fix

                            File nn_blocks.py has 712 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/n_bit/nn_blocks.py - About 1 day to fix

                              File preprocessor_builder_test.py has 709 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/preprocessor_builder_test.py - About 1 day to fix

                                File yolov7_loss.py has 708 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/yolo/losses/yolov7_loss.py - About 1 day to fix

                                  File feature_map_generators.py has 707 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/models/feature_map_generators.py - About 1 day to fix

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

                                      File preprocessing_ops.py has 706 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/yolo/ops/preprocessing_ops.py - About 1 day to fix

                                        Function visualize_boxes_and_labels_on_image_array has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        def visualize_boxes_and_labels_on_image_array(
                                            image,
                                            boxes,
                                            classes,
                                            scores,
                                        Severity: Minor
                                        Found in research/object_detection/utils/visualization_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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language