tensorflow/models

View on GitHub

Showing 5,006 of 11,538 total issues

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

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

      File bifpn_head.py has 616 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/edgetpu/vision/modeling/heads/bifpn_head.py - About 1 day to fix

        File darknet.py has 616 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/modeling/backbones/darknet.py - About 1 day to fix

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

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

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

                def __init__(
                    self,
                    maze_id=None,
                    maze_height=0.5,
                    maze_size_scaling=8,
              Severity: Minor
              Found in research/efficient-hrl/environments/maze_env.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 text_layers.py has 606 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/text_layers.py - About 1 day to fix

                File encoder_scaffold_test.py has 603 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/networks/encoder_scaffold_test.py - About 1 day to fix

                  File processors.py has 601 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/videoglue/datasets/common/processors.py - About 1 day to fix

                    File pix2seq_model.py has 596 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/pix2seq/modeling/pix2seq_model.py - About 1 day to fix

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

                        File assemblenet_plus.py has 592 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_plus.py - About 1 day to fix

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

                            File transformer_layers.py has 583 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
                            Severity: Major
                            Found in research/seq_flow_lite/layers/transformer_layers.py - About 1 day to fix

                              File xlnet_base.py has 582 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/networks/xlnet_base.py - About 1 day to fix

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

                                  File bert_encoder_test.py has 581 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/networks/bert_encoder_test.py - About 1 day to fix

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

                                      Function extract_features has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      def extract_features(images,
                                                           model_options,
                                                           weight_decay=0.0001,
                                                           reuse=None,
                                                           is_training=False,
                                      Severity: Minor
                                      Found in research/deeplab/model.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