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_deprecated_v1
  # Placeholders are TF1. Replacing with tf.function not feasible because of V1
  # variable creation.
  def test_with_1d_unknown_shape_sparse_tensor(self):
    price = fc._numeric_column('price')
Severity: Major
Found in tensorflow/python/feature_column/feature_column_test.py and 1 other location - About 3 days to fix
tensorflow/python/feature_column/feature_column_v2_test.py on lines 2045..2087

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

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 saver.py has 1447 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/training/saver.py - About 3 days to fix

    File function_test.py has 1438 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/function_test.py - About 3 days to fix

      File init_ops.py has 1438 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/init_ops.py - About 3 days to fix

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

          def testFloat(self):
            with ops.Graph().as_default():
              in_tensor = array_ops.placeholder(
                  shape=[1, 16, 16, 3], dtype=dtypes.float32)
              _ = in_tensor + in_tensor
        Severity: Major
        Found in tensorflow/lite/python/lite_test.py and 1 other location - About 3 days to fix
        tensorflow/lite/python/lite_test.py on lines 1762..1796

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

        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 testPbtxt(self):
            with ops.Graph().as_default():
              in_tensor = array_ops.placeholder(
                  shape=[1, 16, 16, 3], dtype=dtypes.float32)
              _ = in_tensor + in_tensor
        Severity: Major
        Found in tensorflow/lite/python/lite_test.py and 1 other location - About 3 days to fix
        tensorflow/lite/python/lite_test.py on lines 1628..1662

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

        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 trt_convert.py has 1412 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/compiler/tensorrt/trt_convert.py - About 3 days to fix

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

          Severity: Major
          Found in tensorflow/lite/testing/op_tests/less.py and 1 other location - About 3 days to fix
          tensorflow/lite/testing/op_tests/greater_equal.py on lines 0..63

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

          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

          Severity: Major
          Found in tensorflow/lite/testing/op_tests/greater_equal.py and 1 other location - About 3 days to fix
          tensorflow/lite/testing/op_tests/less.py on lines 0..63

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

          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.py has 1405 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.py - About 3 days to fix

            File core.py has 1403 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/layers/core.py - About 3 days to fix

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

                def testBigEnqueueMany(self):
                  with self.cached_session() as sess:
                    q = data_flow_ops.PaddingFIFOQueue(5, dtypes_lib.int32, ((),))
                    elem = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
                    enq = q.enqueue_many((elem,))
              tensorflow/python/kernel_tests/data_structures/fifo_queue_test.py on lines 887..931

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

              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 testBigEnqueueMany(self):
                  with self.cached_session() as sess:
                    q = data_flow_ops.FIFOQueue(5, dtypes_lib.int32, ((),))
                    elem = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
                    enq = q.enqueue_many((elem,))
              tensorflow/python/kernel_tests/data_structures/padding_fifo_queue_test.py on lines 1488..1532

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

              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 convolutional.py has 1393 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/legacy_tf_layers/convolutional.py - About 3 days to fix

                File cond_v2_test.py has 1393 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/control_flow/cond_v2_test.py - About 3 days to fix

                  File csr_sparse_matrix_ops_test.py has 1389 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

                    File gradients_test.py has 1388 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/gradients_test.py - About 3 days to fix

                      File concrete_function.py has 1384 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/eager/polymorphic_function/concrete_function.py - About 3 days to fix

                        File summary_ops_test.py has 1383 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/kernel_tests/summary_ops/summary_ops_test.py - About 3 days to fix

                          File session.py has 1373 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/client/session.py - About 3 days to fix
                            Severity
                            Category
                            Status
                            Source
                            Language