tensorflow/tensorflow

View on GitHub

Showing 21,127 of 21,127 total issues

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

@test_util.run_all_in_graph_and_eager_modes
class FresnelSinTest(test.TestCase, parameterized.TestCase):

  @test_util.run_in_graph_and_eager_modes
  def test_fresnel_sin_boundary(self):
Severity: Major
Found in tensorflow/python/ops/special_math_ops_test.py and 1 other location - About 4 days to fix
tensorflow/python/ops/special_math_ops_test.py on lines 263..305

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 452.

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

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

@test_util.run_all_in_graph_and_eager_modes
class FresnelCosTest(test.TestCase, parameterized.TestCase):

  @test_util.run_in_graph_and_eager_modes
  def test_fresnel_cos_boundary(self):
Severity: Major
Found in tensorflow/python/ops/special_math_ops_test.py and 1 other location - About 4 days to fix
tensorflow/python/ops/special_math_ops_test.py on lines 308..350

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 452.

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 structured_tensor_test.py has 1644 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/python/ops/structured/structured_tensor_test.py - About 4 days to fix

    File variables.py has 1637 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/variables.py - About 4 days to fix

      FunctionTest has 218 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class FunctionTest(test.TestCase, parameterized.TestCase):
      
        def setUp(self):
          super().setUp()
          cpus = config.list_physical_devices('CPU')

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

        class MatrixExponentialBenchmark(test.Benchmark):
        
          shapes = [
              (4, 4),
              (10, 10),
        tensorflow/python/kernel_tests/linalg/determinant_op_test.py on lines 209..259

        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 438.

        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

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

        class MatrixDeterminantBenchmark(test.Benchmark):
        
          shapes = [
              (4, 4),
              (10, 10),
        Severity: Major
        Found in tensorflow/python/kernel_tests/linalg/determinant_op_test.py and 1 other location - About 4 days to fix
        tensorflow/python/kernel_tests/linalg/matrix_exponential_op_test.py on lines 166..216

        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 438.

        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

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

          def testPrepareSessionFails(self):
            checkpoint_dir = os.path.join(self.get_temp_dir(), "prepare_session")
            checkpoint_dir2 = os.path.join(self.get_temp_dir(), "prepare_session2")
            try:
              gfile.DeleteRecursively(checkpoint_dir)
        Severity: Major
        Found in tensorflow/python/training/session_manager_test.py and 1 other location - About 4 days to fix
        tensorflow/python/training/session_manager_test.py on lines 86..145

        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 435.

        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

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

          def testPrepareSessionFails(self):
            checkpoint_dir = os.path.join(self.get_temp_dir(), "prepare_session")
            checkpoint_dir2 = os.path.join(self.get_temp_dir(), "prepare_session2")
            try:
              gfile.DeleteRecursively(checkpoint_dir)
        Severity: Major
        Found in tensorflow/python/training/session_manager_test.py and 1 other location - About 4 days to fix
        tensorflow/python/training/session_manager_test.py on lines 713..772

        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 435.

        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 resource_variable_ops_test.py has 1579 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # Copyright 2016 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/kernel_tests/variables/resource_variable_ops_test.py - About 4 days to fix

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

          third_party/gpus/check_cuda_libs.py on lines 0..88

          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 429.

          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/check_cuda_libs.py and 1 other location - About 4 days to fix
          third_party/xla/third_party/tsl/third_party/gpus/check_cuda_libs.py on lines 0..88

          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 429.

          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 nest_test.py has 1560 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # Copyright 2016 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/util/nest_test.py - About 4 days to fix

            File list_ops_test.py has 1560 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/kernel_tests/data_structures/list_ops_test.py - About 4 days to fix

              File input_lib.py has 1555 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/distribute/input_lib.py - About 4 days to fix

                File math_grad.py has 1553 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_grad.py - About 4 days to fix

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

                    @combinations.generate(test_base.graph_only_combinations())
                    def testIteratorStringHandle(self):
                      dataset_3 = dataset_ops.Dataset.from_tensor_slices([1, 2, 3])
                      dataset_4 = dataset_ops.Dataset.from_tensor_slices([10, 20, 30, 40])
                  
                  
                  Severity: Major
                  Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 4 days to fix
                  tensorflow/python/data/kernel_tests/iterator_test.py on lines 491..554

                  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 422.

                  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

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

                    @combinations.generate(test_base.graph_only_combinations())
                    def testIteratorStringHandleFuture(self):
                      dataset_3 = dataset_ops.Dataset.from_tensor_slices([1, 2, 3])
                      dataset_4 = dataset_ops.Dataset.from_tensor_slices([10, 20, 30, 40])
                  
                  
                  Severity: Major
                  Found in tensorflow/python/data/kernel_tests/iterator_test.py and 1 other location - About 4 days to fix
                  tensorflow/python/data/kernel_tests/iterator_test.py on lines 433..489

                  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 422.

                  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 training_utils_v1.py has 1538 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/keras/engine/training_utils_v1.py - About 4 days to fix

                    File collective_ops_test.py has 1523 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 tensorflow/python/kernel_tests/collective_ops_test.py - About 4 days to fix
                      Severity
                      Category
                      Status
                      Source
                      Language