tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/array_ops/init_ops_test.py

Summary

Maintainability
F
1 mo
Test Coverage

File init_ops_test.py has 919 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Major
Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py - About 2 days to fix

    LinSpaceNdTest has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class LinSpaceNdTest(test.TestCase):
    
      def _gpu_modes(self):
        if test.is_gpu_available():
          return [False, True]
    Severity: Minor
    Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py - About 2 hrs to fix

      Function testShapesValues has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        def testShapesValues(self):
          for dtype in [dtypes.float32, dtypes.float64]:
            for shape in [(10, 10), (10, 9, 8), (100, 5, 5), (50, 40), (40, 50)]:
              init = init_ops.orthogonal_initializer(dtype=dtype)
              tol = 1e-5 if dtype == dtypes.float32 else 1e-12
      Severity: Minor
      Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

        def _LinspaceNoneShape(self, start, stop, num, graph_shape=None, axis=0):
      Severity: Minor
      Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py - About 35 mins to fix

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

        class TruncatedNormalInitializationTest(test.TestCase):
        
          @test_util.run_deprecated_v1
          def testInitializerIdentical(self):
            for dtype in [dtypes.float32, dtypes.float64]:
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 2 days to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 251..278

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

        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 RandomNormalInitializationTest(test.TestCase):
        
          @test_util.run_deprecated_v1
          def testInitializerIdentical(self):
            for dtype in [dtypes.float32, dtypes.float64]:
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 2 days to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 281..312

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

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

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

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

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

        Refactorings

        Further Reading

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

          def testEndpointsAreExact(self):
            for self.force_gpu in self._gpu_modes():
              # Test some cases that produce last values not equal to "stop" when
              # computed via start + (num - 1) * ((stop - start) / (num - 1)), since
              # float arithmetic will introduce error through precision loss.
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 601..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 183.

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

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

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

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

        Refactorings

        Further Reading

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

          def testEndpointsAreExact(self):
            for self.force_gpu in self._gpu_modes():
              # Test some cases that produce last values not equal to "stop" when
              # computed via start + (num - 1) * ((stop - start) / (num - 1)), since
              # float arithmetic will introduce error through precision loss.
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 688..702

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

        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 testUntruncatedNormalDistribution(self):
            shape = [100, 100]
            expect_mean = 0.
            expect_var = 1. / shape[0]
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 387..403
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 405..420

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

        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 testNormalDistribution(self):
            shape = [100, 100]
            expect_mean = 0.
            expect_var = 1. / shape[0]
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 387..403
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 422..438

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

        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 testTruncatedNormalDistribution(self):
            shape = [100, 100]
            expect_mean = 0.
            expect_var = 1. / shape[0]
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 405..420
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 422..438

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

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

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

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

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

        Refactorings

        Further Reading

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

          def testPoint(self):
            for self.force_gpu in self._gpu_modes():
              self.assertArrayNear(self._LinSpace(5., 5., 1), np.array([5.]), 1e-5)
              self.assertArrayNear(self._LinSpace(5., 5., 2), np.array([5.] * 2), 1e-5)
              self.assertArrayNear(self._LinSpace(5., 5., 3), np.array([5.] * 3), 1e-5)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 681..686

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

        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 testPositive(self):
            for self.force_gpu in self._gpu_modes():
              self.assertArrayNear(self._LinSpace(1., 5., 1), np.array([1.]), 1e-5)
              self.assertArrayNear(self._LinSpace(1., 5., 2), np.array([1., 5.]), 1e-5)
              self.assertArrayNear(
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 573..582
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 650..658
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 660..669

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

        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 testPositive(self):
            for self.force_gpu in self._gpu_modes():
              self.assertArrayNear(self._LinSpace(1., 5., 1), np.array([1.]), 1e-5)
              self.assertArrayNear(self._LinSpace(1., 5., 2), np.array([1., 5.]), 1e-5)
              self.assertArrayNear(
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 563..571
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 573..582
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 660..669

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

        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 testNegative(self):
            for self.force_gpu in self._gpu_modes():
              self.assertArrayNear(self._LinSpace(-1., -5., 1), np.array([-1.]), 1e-5)
              self.assertArrayNear(
                  self._LinSpace(-1., -5., 2), np.array([-1., -5.]), 1e-5)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 563..571
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 573..582
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 650..658

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

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

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

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

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

        Refactorings

        Further Reading

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

          def testPoint(self):
            for self.force_gpu in self._gpu_modes():
              self.assertArrayNear(self._LinSpace(5., 5., 1), np.array([5.]), 1e-5)
              self.assertArrayNear(self._LinSpace(5., 5., 2), np.array([5.] * 2), 1e-5)
              self.assertArrayNear(self._LinSpace(5., 5., 3), np.array([5.] * 3), 1e-5)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 594..599

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

        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 testNegative(self):
            for self.force_gpu in self._gpu_modes():
              self.assertArrayNear(self._LinSpace(-1., -5., 1), np.array([-1.]), 1e-5)
              self.assertArrayNear(
                  self._LinSpace(-1., -5., 2), np.array([-1., -5.]), 1e-5)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 563..571
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 650..658
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 660..669

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

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

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

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

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

        Refactorings

        Further Reading

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

          def testNegativeToPositive(self):
            for self.force_gpu in self._gpu_modes():
              self.assertArrayNear(self._LinSpace(-1., 5., 1), np.array([-1.]), 1e-5)
              self.assertArrayNear(
                  self._LinSpace(-1., 5., 2), np.array([-1., 5.]), 1e-5)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 584..592

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

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

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

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

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

        Refactorings

        Further Reading

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

          def testNegativeToPositive(self):
            for self.force_gpu in self._gpu_modes():
              self.assertArrayNear(self._LinSpace(-1., 5., 1), np.array([-1.]), 1e-5)
              self.assertArrayNear(
                  self._LinSpace(-1., 5., 2), np.array([-1., 5.]), 1e-5)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 671..679

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

        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 testGain(self):
            shape = (3, 3, 10, 10)
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_delta_orthogonal(seed=1, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 1011..1021

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

        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 testGain(self):
            shape = (3, 3, 10, 10)
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_orthogonal_2d(seed=1, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 871..881

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

        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

                  if t.shape[0] > t.shape[1]:
                    self.assertAllClose(
                        np.dot(t.T, t), np.eye(t.shape[1]), rtol=tol, atol=tol)
                  else:
                    self.assertAllClose(
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/ops/init_ops_v2_test.py on lines 445..450

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

        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 testConstantOneInitializer(self):
            with self.session():
              shape = [2, 3]
              x = variable_scope.get_variable(
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 125..132

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

        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 testInitializerDifferent(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_orthogonal_3d(seed=1, dtype=dtype)
              init2 = init_ops.convolutional_orthogonal_3d(seed=2, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 1028..1033

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

        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 testInitializerIdentical(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_orthogonal_3d(seed=1, dtype=dtype)
              init2 = init_ops.convolutional_orthogonal_3d(seed=1, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 1035..1040

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

        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 testConstantZeroInitializer(self):
            with self.session():
              shape = [2, 3]
              x = variable_scope.get_variable(
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 134..141

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

        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_deprecated_v1
          def testInitializerIdentical(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_delta_orthogonal(seed=1, dtype=dtype)
              init2 = init_ops.convolutional_delta_orthogonal(seed=1, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 848..853
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 983..988
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 990..995

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

          @test_util.run_deprecated_v1
          def testInitializerDifferent(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_delta_orthogonal(seed=1, dtype=dtype)
              init2 = init_ops.convolutional_delta_orthogonal(seed=2, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 841..846
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 983..988
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 990..995

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

          @test_util.run_deprecated_v1
          def testInitializerIdentical(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_orthogonal_2d(seed=1, dtype=dtype)
              init2 = init_ops.convolutional_orthogonal_2d(seed=1, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 841..846
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 848..853
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 990..995

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

          @test_util.run_deprecated_v1
          def testInitializerDifferent(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_orthogonal_2d(seed=1, dtype=dtype)
              init2 = init_ops.convolutional_orthogonal_2d(seed=2, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 841..846
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 848..853
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 983..988

        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_deprecated_v1
          def testZerosInitializer(self):
            with self.session():
              shape = [2, 3]
              x = variable_scope.get_variable(
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 116..123

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

        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 testInitializerDifferent(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_orthogonal_1d(seed=1, dtype=dtype)
              init2 = init_ops.convolutional_orthogonal_1d(seed=2, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 914..919

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

        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 testInitializerIdentical(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.convolutional_orthogonal_1d(seed=1, dtype=dtype)
              init2 = init_ops.convolutional_orthogonal_1d(seed=1, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 921..926

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

        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 testOnesInitializer(self):
            with self.session():
              shape = [2, 3]
              x = variable_scope.get_variable(
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 107..114

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

        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 testInitializerIdentical(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.orthogonal_initializer(seed=1, dtype=dtype)
              init2 = init_ops.orthogonal_initializer(seed=1, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 787..792

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

        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 testInitializerDifferent(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              init1 = init_ops.orthogonal_initializer(seed=1, dtype=dtype)
              init2 = init_ops.orthogonal_initializer(seed=2, dtype=dtype)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 780..785

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

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

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

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

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

        Refactorings

        Further Reading

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

          def testScalarsCompareToNumpy(self):
            for self.force_gpu in self._gpu_modes():
              actual = self._LinSpace(0., 1., 32)
              expected = np.linspace(0., 1., 32)
              self.assertArrayNear(expected, actual, 1e-5)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 739..743

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

          def testNumConstant(self):
            for self.force_gpu in self._gpu_modes():
              actual = self._LinSpaceNumConstant(0., 1., 32)
              expected = np.linspace(0., 1., 32)
              self.assertArrayNear(expected, actual, 1e-5)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 704..708

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

          def testInvalidShape(self):
            init1 = init_ops.convolutional_orthogonal_2d()
            with self.session(graph=ops.Graph(), use_gpu=True):
              self.assertRaises(ValueError, init1, shape=[3, 3, 6, 5])
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 866..869

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

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

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

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

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

        Refactorings

        Further Reading

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

          def testInvalidShape(self):
            init1 = init_ops.convolutional_delta_orthogonal()
            with self.session(graph=ops.Graph(), use_gpu=True):
              self.assertRaises(ValueError, init1, shape=[3, 3, 6, 5])
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 1006..1009

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

        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.session(graph=ops.Graph(), use_gpu=True):
              self.assertRaises(ValueError, init, shape=[5, 7, 7])
              self.assertRaises(ValueError, init, shape=[5])
              self.assertRaises(ValueError, init, shape=[])
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/init_ops_v2_test.py on lines 488..491

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

              with self.session(graph=graph, force_gpu=self.force_gpu):
                tf_ans = math_ops.linspace_nd(start, stop, num_constant, axis=axis)
                return self.evaluate(tf_ans)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 627..630

        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 ops.Graph().as_default() as graph:
              with self.session(graph=graph, force_gpu=self.force_gpu):
                tf_ans = math_ops.linspace_nd(start, stop, num, axis=axis)
                return self.evaluate(tf_ans)
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 635..637

        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

          @test_util.run_deprecated_v1
          def testDuplicatedInitializer(self):
            init = init_ops.convolutional_delta_orthogonal()
            self.assertFalse(duplicated_initializer(self, init, 1, (3, 3, 10, 10)))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 997..1000

        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

          @test_util.run_deprecated_v1
          def testDuplicatedInitializer(self):
            init = init_ops.convolutional_orthogonal_2d()
            self.assertFalse(duplicated_initializer(self, init, 1, (3, 3, 10, 10)))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 855..858

        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.session(graph=ops.Graph(), use_gpu=True):
              self.assertAllClose(init(shape), np.eye(*shape))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 1121..1122

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

        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.session(graph=ops.Graph(), use_gpu=True):
                self.assertAllClose(init_default(shape), np.eye(*shape))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 1112..1113

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

        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

                  t = t.reshape((np.prod(t.shape[:-1]), t.shape[-1]))
        Severity: Minor
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/ops/init_ops_v2_test.py on lines 444..444

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

        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

            self.assertTrue(
                np.array_equal(self._Range(0, 5, 1), np.array([0, 1, 2, 3, 4])))
        Severity: Minor
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 499..500

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

        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

            self.assertTrue(
                np.allclose(self._Range(2.5, 0, -0.5), np.array([2.5, 2, 1.5, 1, 0.5])))
        Severity: Minor
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 465..466

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

        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

            self.assertTrue(
                np.array_equal(
                    self._Range(100, 500, 100), np.array([100, 200, 300, 400])))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 45 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 486..487
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 489..490
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 491..493

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

        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

            self.assertTrue(
                np.allclose(self._Range(0, 3, 0.9), np.array([0, 0.9, 1.8, 2.7])))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 45 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 471..473
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 486..487
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 491..493

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

        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

            self.assertTrue(
                np.allclose(
                    self._Range(100., 500., 100.), np.array([100, 200, 300, 400])))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 45 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 471..473
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 486..487
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 489..490

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

        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

            self.assertTrue(
                np.allclose(self._Range(0, 2, 0.5), np.array([0, 0.5, 1, 1.5])))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 3 other locations - About 45 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 471..473
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 489..490
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 491..493

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

        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

            self.assertTrue(np.array_equal(self._Range(0, 6, 2), np.array([0, 2, 4])))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 2 other locations - About 40 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 467..467
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 469..470

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

        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

            self.assertTrue(np.array_equal(self._Range(0, 5, 2), np.array([0, 2, 4])))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 2 other locations - About 40 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 468..468
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 469..470

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

        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

            self.assertTrue(
                np.array_equal(self._Range(13, 32, 7), np.array([13, 20, 27])))
        Severity: Major
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 2 other locations - About 40 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 467..467
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 468..468

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

        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

            self.assertTrue(np.allclose(self._Range(0, 5, 2.5), np.array([0, 2.5])))
        Severity: Minor
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 501..502

        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

            self.assertTrue(
                np.array_equal(self._Range(-5, -10, -3), np.array([-5, -8])))
        Severity: Minor
        Found in tensorflow/python/kernel_tests/array_ops/init_ops_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/kernel_tests/array_ops/init_ops_test.py on lines 488..488

        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

        There are no issues that match your filters.

        Category
        Status