tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/check_ops_test.py

Summary

Maintainability
F
2 mos
Test Coverage

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

    AssertShapesTest has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class AssertShapesTest(test.TestCase):
    
      @test_util.run_in_graph_and_eager_modes
      def test_raise_static_shape_mismatch(self):
        x = array_ops.ones([3, 2], name="x")
    Severity: Minor
    Found in tensorflow/python/kernel_tests/check_ops_test.py - About 2 hrs to fix

      Function _run has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def _run(self, op, feed_dict=None, num_iters=5000, name=None, **kwargs):
      Severity: Minor
      Found in tensorflow/python/kernel_tests/check_ops_test.py - About 35 mins to fix

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

        class IsStrictlyIncreasingTest(test.TestCase):
        
          @test_util.run_in_graph_and_eager_modes
          def test_constant_tensor_is_not_strictly_increasing(self):
            self.assertFalse(self.evaluate(check_ops.is_strictly_increasing([1, 1, 1])))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 2 days to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2122..2152

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

        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 IsNonDecreasingTest(test.TestCase):
        
          @test_util.run_in_graph_and_eager_modes
          def test_constant_tensor_is_non_decreasing(self):
            self.assertTrue(self.evaluate(check_ops.is_non_decreasing([1, 1, 1])))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 2 days to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2088..2119

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

        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_in_graph_and_eager_modes
          def test_doesnt_raise_when_close_enough_64_bit_due_to_default_atol(self):
            eps = np.finfo(np.float64).eps
            # Default rtol/atol is 10*eps
            x = constant_op.constant(0., name="x", dtype=np.float64)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 439..448

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

        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_in_graph_and_eager_modes
          def test_doesnt_raise_when_close_enough_64_bit_due_to_default_rtol(self):
            eps = np.finfo(np.float64).eps
            # Default rtol/atol is 10*eps
            x = constant_op.constant(1., name="x", dtype=np.float64)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 450..459

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

        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_in_graph_and_eager_modes
          def test_doesnt_raise_when_close_enough_32_bit_due_to_default_rtol(self):
            eps = np.finfo(np.float32).eps
            # Default rtol/atol is 10*eps
            x = constant_op.constant(1., name="x")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 7 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 428..437

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

        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_in_graph_and_eager_modes
          def test_doesnt_raise_when_close_enough_32_bit_due_to_default_atol(self):
            eps = np.finfo(np.float32).eps
            # Default rtol/atol is 10*eps
            x = constant_op.constant(0., name="x")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 7 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 417..426

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_greater(self):
            small = constant_op.constant([1, 2], name="small")
            big = constant_op.constant([3, 4], name="big")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 759..770

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_less(self):
            small = constant_op.constant([1, 2], name="small")
            big = constant_op.constant([3, 4], name="big")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 617..628

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

        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_in_graph_and_eager_modes
          def test_raises_when_less_equal_but_non_broadcastable_shapes(self):
            small = constant_op.constant([1, 1, 1], name="big")
            big = constant_op.constant([3, 1], name="small")
            # The exception in eager and non-eager mode is different because
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 719..732

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

        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_in_graph_and_eager_modes
          def test_raises_when_greater_but_non_broadcastable_shapes(self):
            small = constant_op.constant([1, 1, 1], name="small")
            big = constant_op.constant([3, 2], name="big")
            # The exception in eager and non-eager mode is different because
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 790..804

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

        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_in_graph_and_eager_modes
          def test_raises_when_less_but_non_broadcastable_shapes(self):
            small = constant_op.constant([1, 1, 1], name="small")
            big = constant_op.constant([3, 2], name="big")
            # The exception in eager and non-eager mode is different because
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 345..357

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

        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_in_graph_and_eager_modes
          def test_raises_when_not_equal_but_non_broadcastable_shapes(self):
            small = constant_op.constant([1, 1, 1], name="small")
            big = constant_op.constant([10, 10], name="big")
            # The exception in eager and non-eager mode is different because
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 572..583

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_greater(self):
            small = constant_op.constant([1, 2], name="small")
            big = constant_op.constant([3, 4], name="big")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 692..701

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_less(self):
            small = constant_op.constant([1, 2], name="small")
            big = constant_op.constant([3, 4], name="big")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 545..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 98.

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_deprecated_v1
          def test_rank_one_tensor_raises_if_rank_too_large_dynamic_rank(self):
            with self.cached_session():
              tensor = array_ops.placeholder(dtypes.float32, name="my_tensor")
              desired_rank = 0
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 5 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1170..1178
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1413..1421

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_deprecated_v1
          def test_rank_one_tensor_raises_if_rank_too_small_dynamic_rank(self):
            with self.cached_session():
              tensor = array_ops.placeholder(dtypes.float32, name="my_tensor")
              desired_rank = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 5 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1134..1142
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1413..1421

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_deprecated_v1
          def test_rank_one_tensor_raises_if_rank_too_small_dynamic_rank(self):
            with self.cached_session():
              tensor = array_ops.placeholder(dtypes.float32, name="my_tensor")
              desired_rank = 2
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 5 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1134..1142
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1170..1178

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_less_equal(self):
            small = constant_op.constant([1, 2], name="small")
            big = constant_op.constant([3, 2], name="big")
            with ops.control_dependencies([check_ops.assert_less_equal(small, big)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 317..324
        tensorflow/python/kernel_tests/check_ops_test.py on lines 556..562
        tensorflow/python/kernel_tests/check_ops_test.py on lines 703..709
        tensorflow/python/kernel_tests/check_ops_test.py on lines 772..779

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_not_equal(self):
            small = constant_op.constant([1, 2], name="small")
            big = constant_op.constant([10, 20], name="small")
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 556..562
        tensorflow/python/kernel_tests/check_ops_test.py on lines 630..636
        tensorflow/python/kernel_tests/check_ops_test.py on lines 703..709
        tensorflow/python/kernel_tests/check_ops_test.py on lines 772..779

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_greater(self):
            small = constant_op.constant([3, 1], name="small")
            big = constant_op.constant([4, 2], name="big")
            with ops.control_dependencies([check_ops.assert_greater(big, small)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 317..324
        tensorflow/python/kernel_tests/check_ops_test.py on lines 556..562
        tensorflow/python/kernel_tests/check_ops_test.py on lines 630..636
        tensorflow/python/kernel_tests/check_ops_test.py on lines 772..779

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_less(self):
            small = constant_op.constant([3, 1], name="small")
            big = constant_op.constant([4, 2], name="big")
            with ops.control_dependencies([check_ops.assert_less(small, big)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 317..324
        tensorflow/python/kernel_tests/check_ops_test.py on lines 630..636
        tensorflow/python/kernel_tests/check_ops_test.py on lines 703..709
        tensorflow/python/kernel_tests/check_ops_test.py on lines 772..779

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_greater_equal(self):
            small = constant_op.constant([1, 2], name="small")
            big = constant_op.constant([3, 2], name="big")
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 317..324
        tensorflow/python/kernel_tests/check_ops_test.py on lines 556..562
        tensorflow/python/kernel_tests/check_ops_test.py on lines 630..636
        tensorflow/python/kernel_tests/check_ops_test.py on lines 703..709

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

        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 4 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_less_and_broadcastable_shapes(self):
            small = constant_op.constant([1], name="small")
            big = constant_op.constant([3, 2], name="big")
            with ops.control_dependencies([check_ops.assert_less(small, big)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 638..644
        tensorflow/python/kernel_tests/check_ops_test.py on lines 711..717
        tensorflow/python/kernel_tests/check_ops_test.py on lines 781..788

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

        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 4 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_less_equal_and_broadcastable_shapes(self):
            small = constant_op.constant([1], name="small")
            big = constant_op.constant([3, 1], name="big")
            with ops.control_dependencies([check_ops.assert_less_equal(small, big)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 564..570
        tensorflow/python/kernel_tests/check_ops_test.py on lines 711..717
        tensorflow/python/kernel_tests/check_ops_test.py on lines 781..788

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

        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 4 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_greater_equal_and_broadcastable_shapes(self):
            small = constant_op.constant([1], name="small")
            big = constant_op.constant([3, 1], name="big")
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 564..570
        tensorflow/python/kernel_tests/check_ops_test.py on lines 638..644
        tensorflow/python/kernel_tests/check_ops_test.py on lines 711..717

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

        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 4 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_greater_and_broadcastable_shapes(self):
            small = constant_op.constant([1], name="small")
            big = constant_op.constant([3, 2], name="big")
            with ops.control_dependencies([check_ops.assert_greater(big, small)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 564..570
        tensorflow/python/kernel_tests/check_ops_test.py on lines 638..644
        tensorflow/python/kernel_tests/check_ops_test.py on lines 781..788

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_equal(self):
            small = constant_op.constant([1, 2], name="small")
            with self.assertRaisesOpError(  # pylint:disable=g-error-prone-assert-raises
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 533..543

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_equal(self):
            small = constant_op.constant([1, 2], name="small")
            with self.assertRaisesOpError(  # pylint:disable=g-error-prone-assert-raises
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 680..690

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_deprecated_v1
          def test_rank_one_tensor_doesnt_raise_if_rank_just_right_dynamic_rank(self):
            with self.cached_session():
              tensor = array_ops.placeholder(dtypes.float32, name="my_tensor")
              desired_rank = 1
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1378..1385
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1395..1402

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_deprecated_v1
          def test_rank_one_ten_doesnt_raise_if_rank_too_large_dynamic_rank(self):
            with self.cached_session():
              tensor = array_ops.placeholder(dtypes.float32, name="my_tensor")
              desired_rank = 0
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1152..1159
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1395..1402

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_deprecated_v1
          def test_rank_one_tensor_doesnt_raise_if_rank_just_right_dynamic_rank(self):
            with self.cached_session():
              tensor = array_ops.placeholder(dtypes.float32, name="my_tensor")
              desired_rank = 1
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1152..1159
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1378..1385

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_positive(self):
            doug = constant_op.constant([1, 2], name="doug")
            with self.assertRaisesOpError(  # pylint:disable=g-error-prone-assert-raises
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 874..883

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_negative(self):
            freddie = constant_op.constant([-1, -2], name="freddie")
            with self.assertRaisesOpError("fail"):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 831..841

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

        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_deprecated_v1
          def test_rank_zero_tensor_doesnt_raise_if_rank_just_right_dynamic_rank(self):
            with self.cached_session():
              tensor = array_ops.placeholder(dtypes.float32, name="my_tensor")
              desired_rank = 0
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1116..1123

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

        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_deprecated_v1
          def test_rank_zero_tensor_doesnt_raise_if_rank_just_right_dynamic_rank(self):
            with self.cached_session():
              tensor = array_ops.placeholder(dtypes.float32, name="my_tensor")
              desired_rank = 0
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1361..1368

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_positive(self):
            rachel = constant_op.constant([0, 2], name="rachel")
            with self.assertRaisesOpError("x <= 0 did not hold"):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1426..1433

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_negative(self):
            zoe = constant_op.constant([-1, -2], name="zoe")
            with self.assertRaisesOpError("x >= 0 did not hold"):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1469..1476

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_rank_one_tensor_raises_if_rank_too_small_static_rank(self):
            tensor = constant_op.constant([1, 2], name="my_tensor")
            desired_rank = 2
            with self.assertRaisesRegex(ValueError, "rank"):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1125..1132
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1404..1411

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_rank_one_tensor_raises_if_rank_too_large_static_rank(self):
            tensor = constant_op.constant([1, 2], name="my_tensor")
            desired_rank = 0
            with self.assertRaisesRegex(ValueError, "rank"):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1161..1168
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1404..1411

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_rank_one_tensor_raises_if_rank_too_small_static_rank(self):
            tensor = constant_op.constant([1, 2], name="my_tensor")
            desired_rank = 2
            with self.assertRaisesRegex(ValueError, "rank at least 2"):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1125..1132
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1161..1168

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_zero(self):
            claire = constant_op.constant([0], name="claire")
            with self.assertRaisesOpError(  # pylint:disable=g-error-prone-assert-raises
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 892..899

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_zero(self):
            meechum = constant_op.constant([0], name="meechum")
            with self.assertRaisesOpError("x > 0 did not hold"):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 843..851

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_greater(self):
            # Static check
            static_small = constant_op.constant([1, 2], name="small")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 251..258

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

        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_in_graph_and_eager_modes
          @test_util.run_deprecated_v1
          def test_raises_when_less(self):
            # Static check
            static_small = constant_op.constant([3, 1], name="small")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 174..181

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

        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 7 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_both_empty(self):
            larry = constant_op.constant([])
            curly = constant_op.constant([])
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 297..303
        tensorflow/python/kernel_tests/check_ops_test.py on lines 481..487
        tensorflow/python/kernel_tests/check_ops_test.py on lines 585..591
        tensorflow/python/kernel_tests/check_ops_test.py on lines 662..669
        tensorflow/python/kernel_tests/check_ops_test.py on lines 734..740
        tensorflow/python/kernel_tests/check_ops_test.py on lines 806..813

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

        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 7 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_both_empty(self):
            larry = constant_op.constant([])
            curly = constant_op.constant([])
            with ops.control_dependencies([check_ops.assert_greater(larry, curly)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 297..303
        tensorflow/python/kernel_tests/check_ops_test.py on lines 359..366
        tensorflow/python/kernel_tests/check_ops_test.py on lines 481..487
        tensorflow/python/kernel_tests/check_ops_test.py on lines 585..591
        tensorflow/python/kernel_tests/check_ops_test.py on lines 662..669
        tensorflow/python/kernel_tests/check_ops_test.py on lines 806..813

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

        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 7 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_both_empty(self):
            larry = constant_op.constant([])
            curly = constant_op.constant([])
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 297..303
        tensorflow/python/kernel_tests/check_ops_test.py on lines 359..366
        tensorflow/python/kernel_tests/check_ops_test.py on lines 481..487
        tensorflow/python/kernel_tests/check_ops_test.py on lines 585..591
        tensorflow/python/kernel_tests/check_ops_test.py on lines 734..740
        tensorflow/python/kernel_tests/check_ops_test.py on lines 806..813

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

        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 7 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_both_empty(self):
            larry = constant_op.constant([])
            curly = constant_op.constant([])
            with ops.control_dependencies([check_ops.assert_near(larry, curly)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 297..303
        tensorflow/python/kernel_tests/check_ops_test.py on lines 359..366
        tensorflow/python/kernel_tests/check_ops_test.py on lines 585..591
        tensorflow/python/kernel_tests/check_ops_test.py on lines 662..669
        tensorflow/python/kernel_tests/check_ops_test.py on lines 734..740
        tensorflow/python/kernel_tests/check_ops_test.py on lines 806..813

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

        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 7 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_both_empty(self):
            larry = constant_op.constant([])
            curly = constant_op.constant([])
            with ops.control_dependencies([check_ops.assert_less(larry, curly)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 297..303
        tensorflow/python/kernel_tests/check_ops_test.py on lines 359..366
        tensorflow/python/kernel_tests/check_ops_test.py on lines 481..487
        tensorflow/python/kernel_tests/check_ops_test.py on lines 662..669
        tensorflow/python/kernel_tests/check_ops_test.py on lines 734..740
        tensorflow/python/kernel_tests/check_ops_test.py on lines 806..813

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

        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 7 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_both_empty(self):
            larry = constant_op.constant([])
            curly = constant_op.constant([])
            with ops.control_dependencies([check_ops.assert_equal(larry, curly)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 359..366
        tensorflow/python/kernel_tests/check_ops_test.py on lines 481..487
        tensorflow/python/kernel_tests/check_ops_test.py on lines 585..591
        tensorflow/python/kernel_tests/check_ops_test.py on lines 662..669
        tensorflow/python/kernel_tests/check_ops_test.py on lines 734..740
        tensorflow/python/kernel_tests/check_ops_test.py on lines 806..813

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

        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 7 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_both_empty(self):
            larry = constant_op.constant([])
            curly = constant_op.constant([])
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 6 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 297..303
        tensorflow/python/kernel_tests/check_ops_test.py on lines 359..366
        tensorflow/python/kernel_tests/check_ops_test.py on lines 481..487
        tensorflow/python/kernel_tests/check_ops_test.py on lines 585..591
        tensorflow/python/kernel_tests/check_ops_test.py on lines 662..669
        tensorflow/python/kernel_tests/check_ops_test.py on lines 734..740

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_equal(self):
            small = constant_op.constant([1, 2], name="small")
            with ops.control_dependencies([check_ops.assert_equal(small, small)]):
              out = array_ops.identity(small)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 609..615
        tensorflow/python/kernel_tests/check_ops_test.py on lines 751..757

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_rank_one_tensor_doesnt_raise_if_rank_just_right_static_rank(self):
            tensor = constant_op.constant([1, 2], name="my_tensor")
            desired_rank = 1
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1144..1150
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1370..1376

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_equal(self):
            small = constant_op.constant([1, 2], name="small")
            with ops.control_dependencies(
                [check_ops.assert_less_equal(small, small)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 154..159
        tensorflow/python/kernel_tests/check_ops_test.py on lines 751..757

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_equal(self):
            small = constant_op.constant([1, 2], name="small")
            with ops.control_dependencies(
                [check_ops.assert_greater_equal(small, small)]):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 154..159
        tensorflow/python/kernel_tests/check_ops_test.py on lines 609..615

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_rank_one_tensor_doesnt_raise_if_rank_just_right_static_rank(self):
            tensor = constant_op.constant([1, 2], name="my_tensor")
            desired_rank = 1
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1370..1376
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1387..1393

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

        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 3 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_rank_one_ten_doesnt_raise_raise_if_rank_too_large_static_rank(self):
            tensor = constant_op.constant([1, 2], name="my_tensor")
            desired_rank = 0
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1144..1150
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1387..1393

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_zero_and_positive(self):
            lucas = constant_op.constant([0, 2], name="lucas")
            with ops.control_dependencies([check_ops.assert_non_negative(lucas)]):
              out = array_ops.identity(lucas)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 824..829
        tensorflow/python/kernel_tests/check_ops_test.py on lines 885..890
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1462..1467
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1498..1503

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_negative(self):
            frank = constant_op.constant([-1, -2], name="frank")
            with ops.control_dependencies([check_ops.assert_negative(frank)]):
              out = array_ops.identity(frank)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 885..890
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1435..1440
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1462..1467
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1498..1503

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_positive(self):
            remmy = constant_op.constant([1, 2], name="remmy")
            with ops.control_dependencies([check_ops.assert_positive(remmy)]):
              out = array_ops.identity(remmy)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 824..829
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1435..1440
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1462..1467
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1498..1503

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_integer(self):
            integers = constant_op.constant([1, 2], name="integers")
            with ops.control_dependencies([check_ops.assert_integer(integers)]):
              out = array_ops.identity(integers)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 824..829
        tensorflow/python/kernel_tests/check_ops_test.py on lines 885..890
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1435..1440
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1462..1467

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

        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 5 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_doesnt_raise_when_zero_and_negative(self):
            tom = constant_op.constant([0, -2], name="tom")
            with ops.control_dependencies([check_ops.assert_non_positive(tom)]):
              out = array_ops.identity(tom)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 824..829
        tensorflow/python/kernel_tests/check_ops_test.py on lines 885..890
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1435..1440
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1498..1503

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

        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

            with self.assertRaisesRegexp(ValueError, r"dimension 1 must have size 30"):
              assertion = check_ops.assert_shapes([(sparse_scalar, []),
                                                   (sparse_2d, ["N", "N"])])
              with ops.control_dependencies([assertion]):
                out = array_ops.identity(sparse_2d)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2080..2085

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

        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

            with self.assertRaisesRegexp(ValueError, r"dimension 1 must have size 30"):
              assertion = check_ops.assert_shapes([(dense_scalar, []),
                                                   (sparse_2d, ["N", "N"])])
              with ops.control_dependencies([assertion]):
                out = array_ops.identity(sparse_2d)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2053..2058

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

        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_in_graph_and_eager_modes
          def test_rank_zero_tensor_doesnt_raise_if_rank_just_right_static_rank(self):
            tensor = constant_op.constant(1, name="my_tensor")
            desired_rank = 0
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1353..1359

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

        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_in_graph_and_eager_modes
          def test_rank_zero_tensor_doesnt_raise_if_rank_just_right_static_rank(self):
            tensor = constant_op.constant(1, name="my_tensor")
            desired_rank = 0
            with ops.control_dependencies(
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1108..1114

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

        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 4 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_empty_tensor_doesnt_raise(self):
            # A tensor is negative when it satisfies:
            #   For every element x_i in x, x_i < 0
            # and an empty tensor has no elements, so this is trivially satisfied.
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 901..910
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1442..1451
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1478..1487

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

        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 4 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_empty_tensor_doesnt_raise(self):
            # A tensor is positive when it satisfies:
            #   For every element x_i in x, x_i > 0
            # and an empty tensor has no elements, so this is trivially satisfied.
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 853..862
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1442..1451
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1478..1487

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

        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 4 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_empty_tensor_doesnt_raise(self):
            # A tensor is non-negative when it satisfies:
            #   For every element x_i in x, x_i >= 0
            # and an empty tensor has no elements, so this is trivially satisfied.
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 853..862
        tensorflow/python/kernel_tests/check_ops_test.py on lines 901..910
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1478..1487

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

        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 4 locations. Consider refactoring.
        Open

          @test_util.run_in_graph_and_eager_modes
          def test_empty_tensor_doesnt_raise(self):
            # A tensor is non-positive when it satisfies:
            #   For every element x_i in x, x_i <= 0
            # and an empty tensor has no elements, so this is trivially satisfied.
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 853..862
        tensorflow/python/kernel_tests/check_ops_test.py on lines 901..910
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1442..1451

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

        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 3 locations. Consider refactoring.
        Open

          def test_returns_none_with_eager(self):
            with context.eager_mode():
              t1 = constant_op.constant([1, 2])
              t2 = constant_op.constant([3, 4])
              x = check_ops.assert_less(t1, t2)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 368..373
        tensorflow/python/kernel_tests/check_ops_test.py on lines 512..517

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

        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 3 locations. Consider refactoring.
        Open

          def test_returns_none_with_eager(self):
            with context.eager_mode():
              t1 = constant_op.constant([1., 2.])
              t2 = constant_op.constant([1., 2.])
              x = check_ops.assert_near(t1, t2)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 368..373
        tensorflow/python/kernel_tests/check_ops_test.py on lines 593..598

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

        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 3 locations. Consider refactoring.
        Open

          def test_returns_none_with_eager(self):
            with context.eager_mode():
              t1 = constant_op.constant([1, 2])
              t2 = constant_op.constant([3, 4])
              x = check_ops.assert_none_equal(t1, t2)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 3 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 512..517
        tensorflow/python/kernel_tests/check_ops_test.py on lines 593..598

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

        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

            for desired_ranks in ((0, 1, 2), (1, 0, 2), (1, 2, 0)):
              with ops.control_dependencies([
                  check_ops.assert_rank_in(tensor_rank0, desired_ranks)]):
                self.evaluate(array_ops.identity(tensor_rank0))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1254..1257

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

        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

            for desired_ranks in ((0, 1, 2), (1, 0, 2), (1, 2, 0)):
              with ops.control_dependencies([
                  check_ops.assert_rank_in(tensor_rank1, desired_ranks)]):
                self.evaluate(array_ops.identity(tensor_rank1))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1237..1240

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

        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 9 locations. Consider refactoring.
        Open

            sparse_int = sparse_tensor.SparseTensor(
                constant_op.constant([[5, 6], [7, 8]], dtypes.int64),
                constant_op.constant([23, -43], dtypes.int32),
                constant_op.constant([30, 40], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 8 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1970..1973
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1992..1995
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2017..2020
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2033..2036
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2049..2052
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2063..2066
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2076..2079
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 89..92

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

        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 9 locations. Consider refactoring.
        Open

            sparse_2d = sparse_tensor.SparseTensor(
                constant_op.constant([[5, 6], [7, 8]], dtypes.int64),
                constant_op.constant([23, -43], dtypes.int32),
                constant_op.constant([30, 30], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 8 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1970..1973
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1992..1995
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2004..2007
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2017..2020
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2033..2036
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2049..2052
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2076..2079
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 89..92

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

        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 9 locations. Consider refactoring.
        Open

            sparse_int = sparse_tensor.SparseTensor(
                constant_op.constant([[5, 6], [7, 8]], dtypes.int64),
                constant_op.constant([23, -43], dtypes.int32),
                constant_op.constant([30, 40], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 8 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1970..1973
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2004..2007
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2017..2020
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2033..2036
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2049..2052
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2063..2066
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2076..2079
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 89..92

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

        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 9 locations. Consider refactoring.
        Open

            sparse_int = sparse_tensor.SparseTensor(
                constant_op.constant([[5, 6], [7, 8]], dtypes.int64),
                constant_op.constant([23, -43], dtypes.int32),
                constant_op.constant([30, 40], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 8 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1970..1973
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1992..1995
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2004..2007
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2033..2036
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2049..2052
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2063..2066
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2076..2079
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 89..92

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

        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 9 locations. Consider refactoring.
        Open

            sparse_2d = sparse_tensor.SparseTensor(
                constant_op.constant([[5, 6], [7, 8]], dtypes.int64),
                constant_op.constant([23, -43], dtypes.int32),
                constant_op.constant([30, 40], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 8 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1970..1973
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1992..1995
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2004..2007
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2017..2020
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2033..2036
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2049..2052
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2063..2066
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 89..92

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

        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 9 locations. Consider refactoring.
        Open

            sparse_2d = sparse_tensor.SparseTensor(
                constant_op.constant([[5, 6], [7, 8]], dtypes.int64),
                constant_op.constant([23, -43], dtypes.int32),
                constant_op.constant([30, 30], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 8 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1970..1973
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1992..1995
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2004..2007
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2017..2020
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2049..2052
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2063..2066
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2076..2079
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 89..92

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

        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 9 locations. Consider refactoring.
        Open

            sparse_int = sparse_tensor.SparseTensor(
                constant_op.constant([[5, 6], [7, 8]], dtypes.int64),
                constant_op.constant([23, -43], dtypes.int32),
                constant_op.constant([30, 40], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 8 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1992..1995
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2004..2007
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2017..2020
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2033..2036
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2049..2052
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2063..2066
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2076..2079
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 89..92

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

        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 9 locations. Consider refactoring.
        Open

            sparse_2d = sparse_tensor.SparseTensor(
                constant_op.constant([[5, 6], [7, 8]], dtypes.int64),
                constant_op.constant([23, -43], dtypes.int32),
                constant_op.constant([30, 40], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 8 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1970..1973
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1992..1995
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2004..2007
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2017..2020
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2033..2036
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2063..2066
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2076..2079
        tensorflow/python/kernel_tests/math_ops/sets_test.py on lines 89..92

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

        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 5 locations. Consider refactoring.
        Open

            sparse_float = sparse_tensor.SparseTensor(
                constant_op.constant([[111], [232]], dtypes.int64),
                constant_op.constant([23.4, -43.2], dtypes.float32),
                constant_op.constant([500], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1524..1527
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1553..1556
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1958..1961
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2179..2182

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

        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 5 locations. Consider refactoring.
        Open

            sparse_float = sparse_tensor.SparseTensor(
                constant_op.constant([[111], [232]], dtypes.int64),
                constant_op.constant([23.4, -43.2], dtypes.float32),
                constant_op.constant([500], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1524..1527
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1553..1556
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1947..1950
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2179..2182

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

        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 5 locations. Consider refactoring.
        Open

            sparse_float = sparse_tensor.SparseTensor(
                constant_op.constant([[111], [232]], dtypes.int64),
                constant_op.constant([23.4, -43.2], dtypes.float32),
                constant_op.constant([500], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1553..1556
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1947..1950
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1958..1961
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2179..2182

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

        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 5 locations. Consider refactoring.
        Open

            sparse_float16 = sparse_tensor.SparseTensor(
                constant_op.constant([[111], [232]], dtypes.int64),
                constant_op.constant([23.4, -43.2], dtypes.float16),
                constant_op.constant([500], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1524..1527
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1947..1950
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1958..1961
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2179..2182

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

        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 5 locations. Consider refactoring.
        Open

            sparse_float = sparse_tensor.SparseTensor(
                constant_op.constant([[111], [232]], dtypes.int64),
                constant_op.constant([23.4, -43.2], dtypes.float32),
                constant_op.constant([500], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 2 hrs to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1524..1527
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1553..1556
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1947..1950
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1958..1961

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

        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 3 locations. Consider refactoring.
        Open

            with ops.control_dependencies(
                [check_ops.assert_near(x, y, atol=0.5, rtol=0.,
                                       message="failure message")]):
              out = array_ops.identity(x)
              self.evaluate(out)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 465..469
        tensorflow/python/kernel_tests/check_ops_test.py on lines 523..528

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

        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 3 locations. Consider refactoring.
        Open

            with ops.control_dependencies([
                check_ops.assert_near(
                    x, y, atol=0., rtol=0.5, message="failure message")
            ]):
              out = array_ops.identity(x)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 465..469
        tensorflow/python/kernel_tests/check_ops_test.py on lines 475..479

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

        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 3 locations. Consider refactoring.
        Open

            with ops.control_dependencies(
                [check_ops.assert_near(x, y, atol=0., rtol=0.5,
                                       message="failure message")]):
              out = array_ops.identity(x)
              self.evaluate(out)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 2 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 475..479
        tensorflow/python/kernel_tests/check_ops_test.py on lines 523..528

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

        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 5 locations. Consider refactoring.
        Open

          def test_static_check_in_graph_mode(self):
            with ops.Graph().as_default():
              with self.assertRaisesRegex(  # pylint:disable=g-error-prone-assert-raises
                  errors.InvalidArgumentError, "Custom error message"):
                check_ops.assert_less(1, 1, message="Custom error message")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 375..379
        tensorflow/python/kernel_tests/check_ops_test.py on lines 671..675
        tensorflow/python/kernel_tests/check_ops_test.py on lines 742..746
        tensorflow/python/kernel_tests/check_ops_test.py on lines 815..819

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

        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 5 locations. Consider refactoring.
        Open

          def test_static_check_in_graph_mode(self):
            with ops.Graph().as_default():
              with self.assertRaisesRegex(  # pylint:disable=g-error-prone-assert-raises
                  errors.InvalidArgumentError, "Custom error message"):
                check_ops.assert_less_equal(1, 0, message="Custom error message")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 375..379
        tensorflow/python/kernel_tests/check_ops_test.py on lines 600..604
        tensorflow/python/kernel_tests/check_ops_test.py on lines 742..746
        tensorflow/python/kernel_tests/check_ops_test.py on lines 815..819

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

        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 5 locations. Consider refactoring.
        Open

          def test_static_check_in_graph_mode(self):
            with ops.Graph().as_default():
              with self.assertRaisesRegex(  # pylint:disable=g-error-prone-assert-raises
                  errors.InvalidArgumentError, "Custom error message"):
                check_ops.assert_greater_equal(0, 1, message="Custom error message")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 375..379
        tensorflow/python/kernel_tests/check_ops_test.py on lines 600..604
        tensorflow/python/kernel_tests/check_ops_test.py on lines 671..675
        tensorflow/python/kernel_tests/check_ops_test.py on lines 742..746

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

        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 5 locations. Consider refactoring.
        Open

          def test_static_check_in_graph_mode(self):
            with ops.Graph().as_default():
              with self.assertRaisesRegex(  # pylint:disable=g-error-prone-assert-raises
                  errors.InvalidArgumentError, "Custom error message"):
                check_ops.assert_greater(0, 1, message="Custom error message")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 375..379
        tensorflow/python/kernel_tests/check_ops_test.py on lines 600..604
        tensorflow/python/kernel_tests/check_ops_test.py on lines 671..675
        tensorflow/python/kernel_tests/check_ops_test.py on lines 815..819

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

        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 5 locations. Consider refactoring.
        Open

          def test_static_check_in_graph_mode(self):
            with ops.Graph().as_default():
              with self.assertRaisesRegex(  # pylint:disable=g-error-prone-assert-raises
                  errors.InvalidArgumentError, "Custom error message"):
                check_ops.assert_none_equal(1, 1, message="Custom error message")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 600..604
        tensorflow/python/kernel_tests/check_ops_test.py on lines 671..675
        tensorflow/python/kernel_tests/check_ops_test.py on lines 742..746
        tensorflow/python/kernel_tests/check_ops_test.py on lines 815..819

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

        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_in_graph_and_eager_modes
          def test_generator_does_not_raise(self):
            generator_of_stuff = (constant_op.constant([11, 22]), constant_op.constant(
                [1, 2]))
            check_ops.assert_proper_iterable(generator_of_stuff)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 138..143

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

        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_in_graph_and_eager_modes
          def test_list_does_not_raise(self):
            list_of_stuff = [
                constant_op.constant([11, 22]), constant_op.constant([1, 2])
            ]
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 145..149

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

        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 4 locations. Consider refactoring.
        Open

          def test_static_check_in_graph_mode(self):
            with ops.Graph().as_default():
              with self.assertRaisesRegex(errors.InvalidArgumentError,
                                          "Custom error message"):
                check_ops.assert_positive(-1, message="Custom error message")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 864..868
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1453..1457
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1489..1493

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

        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 4 locations. Consider refactoring.
        Open

            sparse_scalar = sparse_tensor.SparseTensor(
                constant_op.constant([[]], dtypes.int64),
                constant_op.constant([42], dtypes.float32),
                constant_op.constant([], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1924..1927
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1934..1937
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2045..2048

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

        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 4 locations. Consider refactoring.
        Open

          def test_static_check_in_graph_mode(self):
            with ops.Graph().as_default():
              with self.assertRaisesRegex(errors.InvalidArgumentError,
                                          "Custom error message"):
                check_ops.assert_non_negative(-1, message="Custom error message")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 864..868
        tensorflow/python/kernel_tests/check_ops_test.py on lines 912..916
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1489..1493

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

        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 4 locations. Consider refactoring.
        Open

          def test_static_check_in_graph_mode(self):
            with ops.Graph().as_default():
              with self.assertRaisesRegex(errors.InvalidArgumentError,
                                          "Custom error message"):
                check_ops.assert_negative(1, message="Custom error message")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 912..916
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1453..1457
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1489..1493

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

        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 4 locations. Consider refactoring.
        Open

          def test_static_check_in_graph_mode(self):
            with ops.Graph().as_default():
              with self.assertRaisesRegex(errors.InvalidArgumentError,
                                          "Custom error message"):
                check_ops.assert_non_positive(1, message="Custom error message")
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 864..868
        tensorflow/python/kernel_tests/check_ops_test.py on lines 912..916
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1453..1457

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

        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 4 locations. Consider refactoring.
        Open

            sparse_float = sparse_tensor.SparseTensor(
                constant_op.constant([[]], dtypes.int64),
                constant_op.constant([42], dtypes.float32),
                constant_op.constant([], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1934..1937
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2029..2032
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2045..2048

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

        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 4 locations. Consider refactoring.
        Open

            sparse_float = sparse_tensor.SparseTensor(
                constant_op.constant([[]], dtypes.int64),
                constant_op.constant([42], dtypes.float32),
                constant_op.constant([], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1924..1927
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2029..2032
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2045..2048

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

        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 4 locations. Consider refactoring.
        Open

            sparse_scalar = sparse_tensor.SparseTensor(
                constant_op.constant([[]], dtypes.int64),
                constant_op.constant([42], dtypes.float32),
                constant_op.constant([], dtypes.int64))
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1924..1927
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1934..1937
        tensorflow/python/kernel_tests/check_ops_test.py on lines 2029..2032

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

        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

            with self.assertRaisesOpError(  # pylint:disable=g-error-prone-assert-raises
                "x and y not equal to tolerance"):
              with ops.control_dependencies(
                  [check_ops.assert_near(x, y, message="failure message")]):
                out = array_ops.identity(x)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 412..415

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

        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

            with ops.control_dependencies(
                [check_ops.assert_near(x, y, message="failure message")]):
              out = array_ops.identity(x)
              self.evaluate(out)
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 505..510

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

        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

            with self.cached_session() as sess:
              with self.assertRaisesWithPredicateMatch(
                  errors.InvalidArgumentError,
                  r"Shape of tensor MyDivide \[2,1\] is not compatible with "
                  r"expected shape \[3,3,3\]."):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 977..982

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

        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

            with self.cached_session() as sess:
              with self.assertRaisesWithPredicateMatch(
                  errors.InvalidArgumentError,
                  r"Shape of tensor [A-Za-z_]* \[2,1\] is not compatible with "
                  r"expected shape \[\?,\?,3\]."):
        Severity: Major
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 962..967

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

        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

              with self.assertRaisesOpError("small.*big"):
                out.eval(feed_dict={small: [3, 1], big: [4, 2]})
        Severity: Minor
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 191..192

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

        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

              with self.assertRaisesOpError("fail.*big.*small"):
                out.eval(feed_dict={small: [1, 2], big: [3, 4]})
        Severity: Minor
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 267..268

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

        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

            with ops.control_dependencies(
                [check_ops.assert_type(x, dtypes.float32)]):
              y = array_ops.identity(x)
        Severity: Minor
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1517..1519

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

        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

            with ops.control_dependencies([
                check_ops.assert_type(integers, dtypes.int64)]):
              out = array_ops.identity(integers)
        Severity: Minor
        Found in tensorflow/python/kernel_tests/check_ops_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/kernel_tests/check_ops_test.py on lines 1539..1541

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

        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

        There are no issues that match your filters.

        Category
        Status