tensorflow/tensorflow

View on GitHub

Showing 21,192 of 21,192 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

third_party/gpus/find_cuda_config.py on lines 0..652

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 3485.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

Severity: Major
Found in third_party/gpus/find_cuda_config.py and 1 other location - About 1 mo to fix
third_party/xla/third_party/tsl/third_party/gpus/find_cuda_config.py on lines 0..652

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 3485.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

Severity: Major
Found in third_party/gpus/find_rocm_config.py and 1 other location - About 3 wks to fix
third_party/xla/third_party/tsl/third_party/gpus/find_rocm_config.py on lines 0..446

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 2141.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

third_party/gpus/find_rocm_config.py on lines 0..446

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 2141.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File quantize_model_test.py has 5917 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2022 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 feature_column_test.py has 5643 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 tensorflow/python/feature_column/feature_column_test.py - About 2 wks to fix

      File nn_ops.py has 5596 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # Copyright 2015 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 tensorflow/python/ops/nn_ops.py - About 2 wks to fix

        File tensorflow_metal_plugin_test.py has 5339 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """Copyright 2023 The TensorFlow Authors.
        
        All Rights Reserved.
        
        Licensed under the Apache License, Version 2.0 (the "License");
        Severity: Major
        Found in tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py - About 2 wks to fix

          File feature_column_v2_test.py has 5284 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 tensorflow/python/feature_column/feature_column_v2_test.py - About 2 wks to fix

            File image_ops_test.py has 5118 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # Copyright 2015 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 tensorflow/python/ops/image_ops_test.py - About 2 wks to fix

              File array_ops.py has 5079 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # Copyright 2015 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 tensorflow/python/ops/array_ops.py - About 2 wks to fix

                File backend.py has 4969 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # Copyright 2015 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 tensorflow/python/keras/backend.py - About 2 wks to fix

                  File image_ops_impl.py has 4819 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # Copyright 2015 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 tensorflow/python/ops/image_ops_impl.py - About 1 wk to fix

                    File ops.py has 4545 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # Copyright 2015 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 tensorflow/python/framework/ops.py - About 1 wk to fix

                      File math_ops.py has 4418 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # Copyright 2015 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 tensorflow/python/ops/math_ops.py - About 1 wk to fix

                        File lite_v2_test.py has 4391 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 tensorflow/lite/python/lite_v2_test.py - About 1 wk to fix

                          File dataset_ops.py has 4042 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 tensorflow/python/data/ops/dataset_ops.py - About 1 wk to fix

                            File control_flow_ops_py_test.py has 4014 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            # Copyright 2015 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 pfor.py has 3878 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 tensorflow/python/ops/parallel_for/pfor.py - About 1 wk to fix

                                File polymorphic_function_test.py has 3844 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
                                  Category
                                  Status
                                  Source
                                  Language