tensorflow/tensorflow

View on GitHub

Showing 21,100 of 21,100 total issues

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

  def testIterators(self):
    save_path = os.path.join(self.get_temp_dir(), "sharded_iterators")

    # Build a graph with 2 parameter nodes on different devices and save.
    with session.Session(
Severity: Major
Found in tensorflow/python/training/saver_test.py and 1 other location - About 5 days to fix
tensorflow/python/training/saver_test.py on lines 1245..1308

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

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 testIteratorsUnshardedRestore(self):
    save_path = os.path.join(self.get_temp_dir(), "restore_unsharded_iterators")

    # Build a graph with 2 parameter nodes on different devices and save.
    with session.Session(
Severity: Major
Found in tensorflow/python/training/saver_test.py and 1 other location - About 5 days to fix
tensorflow/python/training/saver_test.py on lines 1180..1243

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

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 data_flow_ops.py has 1996 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/ops/data_flow_ops.py - About 5 days to fix

    File lookup_ops.py has 1964 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/ops/lookup_ops.py - About 5 days to fix

      File ragged_tensor_test.py has 1941 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/ragged/ragged_tensor_test.py - About 5 days to fix

        File tf_upgrade_v2_test.py has 1913 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/tools/compatibility/tf_upgrade_v2_test.py - About 5 days to fix

          File nn_impl.py has 1879 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_impl.py - About 5 days to fix

            File check_ops_test.py has 1878 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/check_ops_test.py - About 5 days to fix

              File check_ops.py has 1864 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/ops/check_ops.py - About 5 days to fix

                MicroBenchmarks has 252 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class MicroBenchmarks(benchmarks_test_base.MicroBenchmarksBase):
                  def __init__(self):
                    # used for multiply benchmarks
                    self._m_2 = random_ops.random_uniform([2])
                
                
                Severity: Major
                Found in tensorflow/python/eager/benchmarks_test.py - About 5 days to fix

                  File tensor_tracer.py has 1826 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/tpu/tensor_tracer.py - About 4 days to fix

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

                      def test_old_linear_model(self):
                        # Inputs.
                        batch_size = 4
                        vocabulary_size = 3
                        sparse_input = sparse_tensor.SparseTensorValue(
                    Severity: Major
                    Found in tensorflow/python/feature_column/feature_column_v2_test.py and 1 other location - About 4 days to fix
                    tensorflow/python/feature_column/feature_column_v2_test.py on lines 5303..5383

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

                    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 test_old_linear_model_old_categorical(self):
                        # Inputs.
                        batch_size = 4
                        vocabulary_size = 3
                        sparse_input = sparse_tensor.SparseTensorValue(
                    Severity: Major
                    Found in tensorflow/python/feature_column/feature_column_v2_test.py and 1 other location - About 4 days to fix
                    tensorflow/python/feature_column/feature_column_v2_test.py on lines 5221..5301

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

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

                    # pylint: disable=g-bad-file-header
                    # 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.
                    Severity: Major
                    Found in tensorflow/python/training/monitored_session_test.py - About 4 days to fix

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

                        def testScalarBroadcast(self):
                          c = True
                          # where_v2 only
                          x = np.random.rand(1, 3, 2) * 100
                          y = np.random.rand(1, 1, 1) * 100
                      tensorflow/python/kernel_tests/math_ops/cwise_ops_test.py on lines 426..456

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

                      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

                        def testScalarBroadcast(self):
                          c = True
                          # where_v2 only
                          x = np.random.rand(1, 3, 2) * 100
                          y = np.random.rand(1, 1, 1) * 100
                      Severity: Major
                      Found in tensorflow/python/kernel_tests/math_ops/cwise_ops_test.py and 1 other location - About 4 days to fix
                      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 5230..5260

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

                      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 test_fills_cols_to_vars_shared_embedding(self):
                          # Provide 5 DenseColumn's to input_layer: a NumericColumn, a
                          # BucketizedColumn, an EmbeddingColumn, two SharedEmbeddingColumns. The
                          # EmbeddingColumn creates a Variable and the two SharedEmbeddingColumns
                          # shared one variable.
                      Severity: Major
                      Found in tensorflow/python/feature_column/feature_column_v2_test.py and 1 other location - About 4 days to fix
                      tensorflow/python/feature_column/feature_column_test.py on lines 2813..2867

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

                      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 test_fills_cols_to_vars_shared_embedding(self):
                          # Provide 5 DenseColumn's to input_layer: a NumericColumn, a
                          # BucketizedColumn, an EmbeddingColumn, two SharedEmbeddingColumns. The
                          # EmbeddingColumn creates a Variable and the two SharedEmbeddingColumns
                          # shared one variable.
                      Severity: Major
                      Found in tensorflow/python/feature_column/feature_column_test.py and 1 other location - About 4 days to fix
                      tensorflow/python/feature_column/feature_column_v2_test.py on lines 2526..2581

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

                      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 tracing_compilation_test.py has 1790 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

                        File base_layer_v1.py has 1781 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/engine/base_layer_v1.py - About 4 days to fix
                          Severity
                          Category
                          Status
                          Source
                          Language