tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py

Summary

Maintainability
F
1 mo
Test Coverage

File reduction_ops_test.py has 1024 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/math_ops/reduction_ops_test.py - About 2 days to fix

    Function testFloat32BFloat16 has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

      def testFloat32BFloat16(self):
        for dtype in [dtypes.float32, dtypes.bfloat16]:
          dtype_np = np.float32 if dtype == dtypes.float32 else dtype.as_numpy_dtype
          for rank in range(1, _MAX_RANK + 1):
            np_arr = self._makeIncremental((2,) * rank, dtype)
    Severity: Minor
    Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 2 hrs 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

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

    class SumReductionTest(BaseReductionTest):
    
      def _tf_reduce(self, x, reduction_axes, keepdims):
        return math_ops.reduce_sum(x, reduction_axes, keepdims)
    
    
    Severity: Minor
    Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 2 hrs to fix

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

        def testFloat32(self):
          for rank in range(1, _MAX_RANK + 1):
            np_arr = self._makeIncremental((2,) * rank, dtypes.float32)
            self._compareAllAxes(np_arr)
      
      
      Severity: Minor
      Found in tensorflow/python/kernel_tests/math_ops/reduction_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 _compare has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def _compare(self, x, reduction_axes, keepdims, use_gpu=False, zero=0,
      Severity: Minor
      Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 45 mins to fix

        Function _compare has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def _compare(self,
        Severity: Minor
        Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 45 mins to fix

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

            def _compareAll(self,
          Severity: Minor
          Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 35 mins to fix

            Function testInfinity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def testInfinity(self):
                for dtype in [np.float32, np.float64]:
                  for special_value_x in [-np.inf, np.inf]:
                    for special_value_y in [-np.inf, np.inf]:
                      np_arr = np.array([special_value_x, special_value_y]).astype(dtype)
            Severity: Minor
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 25 mins 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 testInfinity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def testInfinity(self):
                for dtype in [np.float32, np.float64]:
                  for special_value_x in [-np.inf, np.inf]:
                    for special_value_y in [-np.inf, np.inf]:
                      np_arr = np.array([special_value_x, special_value_y]).astype(dtype)
            Severity: Minor
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 25 mins 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 testInfinity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def testInfinity(self):
                for dtype in [np.float32, np.float64]:
                  for special_value_x in [-np.inf, np.inf]:
                    for special_value_y in [-np.inf, np.inf]:
                      np_arr = np.array([special_value_x, special_value_y]).astype(dtype)
            Severity: Minor
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 25 mins 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 testBasic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def testBasic(self):
                # Test case for GitHub issue 46700.
                for dtype, reductions in [
                    (dtypes.float32, (math_ops.reduce_sum, math_ops.reduce_mean,
                                      math_ops.reduce_prod, math_ops.reduce_max,
            Severity: Minor
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 25 mins 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 testSpecialValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def testSpecialValues(self):
                for dtype in [np.float32, np.float64]:
                  for size in range(1, 4):
                    for arr in itertools.product([-np.inf, 1., np.nan, np.inf],
                                                 repeat=size):
            Severity: Minor
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 25 mins 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 testInfinity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def testInfinity(self):
                for dtype in [np.float32, np.float64]:
                  for special_value_x in [-np.inf, np.inf]:
                    for special_value_y in [-np.inf, np.inf]:
                      np_arr = np.array([special_value_x, special_value_y]).astype(dtype)
            Severity: Minor
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 25 mins 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 testSpecialValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def testSpecialValues(self):
                for dtype in [np.float32, np.float64]:
                  for size in range(1, 4):
                    for arr in itertools.product([-np.inf, 1., np.nan, np.inf],
                                                 repeat=size):
            Severity: Minor
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py - About 25 mins 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

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

            class AnyReductionTest(test.TestCase):
            
              def _compare(self, x, reduction_axes, keepdims, use_gpu=False):
                np_ans = x
                if reduction_axes is None:
            Severity: Major
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py and 1 other location - About 4 days to fix
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1068..1114

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 469.

            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 AllReductionTest(test.TestCase):
            
              def _compare(self, x, reduction_axes, keepdims, use_gpu=False):
                np_ans = x
                if reduction_axes is None:
            Severity: Major
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py and 1 other location - About 4 days to fix
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1117..1163

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

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

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

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

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

            Refactorings

            Further Reading

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

              def testFloatReduce3D(self):
                # Create a 3D array of floats and reduce across all possible
                # dimensions
                np_arr = np.arange(-31, -1).reshape([2, 3, 5]).astype(np.float32)
                self._compareAll(np_arr, None)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 840..852
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 854..866
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 957..969
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 985..997

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

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

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

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

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

            Refactorings

            Further Reading

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

              def testFloatReduce3D(self):
                # Create a 3D array of floats and reduce across all possible
                # dimensions
                np_arr = np.arange(1, 31).reshape([2, 3, 5]).astype(np.float32)
                self._compareAll(np_arr, None)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 854..866
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 957..969
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 971..983
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 985..997

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

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

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

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

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

            Refactorings

            Further Reading

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

              def testDoubleReduce3D(self):
                # Create a 3D array of doubles and reduce across all possible
                # dimensions
                np_arr = np.arange(1, 31).reshape([2, 3, 5]).astype(np.float64)
                self._compareAll(np_arr, None)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 840..852
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 957..969
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 971..983
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 985..997

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

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

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

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

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

            Refactorings

            Further Reading

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

              def testDoubleReduce3D(self):
                # Create a 3D array of doubles and reduce across all possible
                # dimensions
                np_arr = np.arange(-31, -1).reshape([2, 3, 5]).astype(np.float64)
                self._compareAll(np_arr, None)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 840..852
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 854..866
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 957..969
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 971..983

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

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

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

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

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

            Refactorings

            Further Reading

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

              def testInt64Reduce3D(self):
                # Create a 3D array of int64s and reduce across all possible
                # dimensions
                np_arr = np.arange(-31, -1).reshape([2, 3, 5]).astype(np.int64)
                self._compareAll(np_arr, None)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 840..852
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 854..866
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 971..983
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 985..997

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

            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 _compareGradientAxes(self, x, rtol=1e-8, atol=1e-8):
                self._compareGradient(x, None, rtol=rtol, atol=atol)
                self._compareGradient(x, [], rtol=rtol, atol=atol)
                self._compareGradient(x, 0, rtol=rtol, atol=atol)
                self._compareGradient(x, [1], rtol=rtol, atol=atol)
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4057..4064

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

            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 testGradient3(self):
                s = [2, 3, 4, 2]
                x = np.arange(1.0, 49.0).reshape(s).astype(np.float64)
                with self.cached_session():
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 879..888
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1026..1035
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1037..1046

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

            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 testGradient2(self):
                s = [2, 3, 4, 2]
                x = np.arange(1.0, 49.0).reshape(s).astype(np.float64)
                with self.cached_session():
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 890..899
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1026..1035
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1037..1046

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

            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 testGradient3(self):
                s = [2, 3, 4, 2]
                x = np.arange(-49.0, -1.0).reshape(s).astype(np.float64)
                with self.cached_session():
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 879..888
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 890..899
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1026..1035

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

            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 testGradient2(self):
                s = [2, 3, 4, 2]
                x = np.arange(-49.0, -1.0).reshape(s).astype(np.float64)
                with self.cached_session():
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 879..888
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 890..899
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1037..1046

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

            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 testGradient(self):
                s = [2, 3, 4, 2]
                x = np.arange(-49.0, -1.0).reshape(s).astype(np.float64)
                with self.cached_session():
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 868..877

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

            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 testGradient(self):
                s = [2, 3, 4, 2]
                x = np.arange(1.0, 49.0).reshape(s).astype(np.float64)
                with self.cached_session():
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1015..1024

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

            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 testGradient4(self):
                s = [2, 3, 4, 2]
                x = np.arange(1.0, 49.0).reshape(s).astype(np.float64)
                with self.cached_session():
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1048..1057

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

            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 testGradient4(self):
                s = [2, 3, 4, 2]
                x = np.arange(-49.0, -1.0).reshape(s).astype(np.float64)
                with self.cached_session():
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 901..910

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

            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

              @test_util.disable_xla("b/168718272")  # XLA handling of NaN is inconsistent
              def testSpecialValues(self):
                for dtype in [np.float32, np.float64]:
                  for size in range(1, 4):
                    for arr in itertools.product([-np.inf, 1., np.nan, np.inf],
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 949..955

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

            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

              @test_util.disable_xla("b/168718272")  # XLA handling of NaN is inconsistent
              def testSpecialValues(self):
                for dtype in [np.float32, np.float64]:
                  for size in range(1, 4):
                    for arr in itertools.product([-np.inf, 1., np.nan, np.inf],
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 832..838

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

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

              @test_util.run_deprecated_v1
              def testInfinity(self):
                for dtype in [np.float32, np.float64]:
                  for special_value_x in [-np.inf, np.inf]:
                    for special_value_y in [-np.inf, np.inf]:
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 236..242
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 639..645
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 707..713

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

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

              @test_util.run_deprecated_v1
              def testInfinity(self):
                for dtype in [np.float32, np.float64]:
                  for special_value_x in [-np.inf, np.inf]:
                    for special_value_y in [-np.inf, np.inf]:
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 518..524
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 639..645
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 707..713

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

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

              @test_util.run_deprecated_v1
              def testInfinity(self):
                for dtype in [np.float32, np.float64]:
                  for special_value_x in [-np.inf, np.inf]:
                    for special_value_y in [-np.inf, np.inf]:
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 236..242
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 518..524
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 707..713

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

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

              @test_util.run_deprecated_v1
              def testInfinity(self):
                for dtype in [np.float32, np.float64]:
                  for special_value_x in [-np.inf, np.inf]:
                    for special_value_y in [-np.inf, np.inf]:
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 236..242
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 518..524
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 639..645

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

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

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

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

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

            Refactorings

            Further Reading

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

              @test_util.run_deprecated_v1
              def testEmptyGradients(self):
                with self.session():
                  x = array_ops.zeros([0, 3])
                  y = math_ops.reduce_sum(x, [1])
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 596..602
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 785..791
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 912..918
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1059..1065

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

              @test_util.run_deprecated_v1
              def testEmptyGradients(self):
                with self.session():
                  x = array_ops.zeros([0, 3])
                  y = math_ops.reduce_prod(x, [1])
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 468..474
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 596..602
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 912..918
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1059..1065

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

              @test_util.run_deprecated_v1
              def testEmptyGradients(self):
                with self.cached_session():
                  x = array_ops.zeros([0, 3])
                  y = math_ops.reduce_min(x, [1])
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 468..474
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 596..602
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 785..791
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1059..1065

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

              @test_util.run_deprecated_v1
              def testEmptyGradients(self):
                with self.session():
                  x = array_ops.zeros([0, 3])
                  y = math_ops.reduce_mean(x, [1])
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 468..474
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 785..791
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 912..918
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1059..1065

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

              @test_util.run_deprecated_v1
              def testEmptyGradients(self):
                with self.cached_session():
                  x = array_ops.zeros([0, 3])
                  y = math_ops.reduce_max(x, [1])
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 468..474
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 596..602
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 785..791
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 912..918

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

              def testAxesType(self):
                for dtype in [dtypes.int64, dtypes.int32]:
                  with self.cached_session():
                    v = math_ops.reduce_min([0, 0], constant_op.constant(0, dtype=dtype))
                    tf_v = self.evaluate(v)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 229..234
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 511..516
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 700..705
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 942..947

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

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

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

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

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

            Refactorings

            Further Reading

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

              def testAxesType(self):
                for dtype in [dtypes.int64, dtypes.int32]:
                  with self.cached_session():
                    v = math_ops.reduce_max([0, 0], constant_op.constant(0, dtype=dtype))
                    tf_v = self.evaluate(v)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 229..234
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 511..516
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 700..705
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 825..830

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

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

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

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

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

            Refactorings

            Further Reading

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

              def testAxesType(self):
                for dtype in [dtypes.int64, dtypes.int32]:
                  with self.cached_session():
                    v = math_ops.reduce_prod([0, 0], constant_op.constant(0, dtype=dtype))
                    tf_v = self.evaluate(v)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 229..234
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 511..516
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 825..830
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 942..947

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

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

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

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

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

            Refactorings

            Further Reading

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

              def testAxesType(self):
                for dtype in [dtypes.int64, dtypes.int32]:
                  with self.cached_session():
                    v = math_ops.reduce_sum([0, 0], constant_op.constant(0, dtype=dtype))
                    tf_v = self.evaluate(v)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 511..516
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 700..705
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 825..830
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 942..947

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

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

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

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

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

            Refactorings

            Further Reading

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

              def testAxesType(self):
                for dtype in [dtypes.int64, dtypes.int32]:
                  with self.cached_session():
                    v = math_ops.reduce_mean([0, 0], constant_op.constant(0, dtype=dtype))
                    tf_v = self.evaluate(v)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 229..234
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 700..705
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 825..830
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 942..947

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

            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 testInt64(self):
                for rank in range(1, _MAX_RANK):
                  # Avoid overflow by limiting array values.
                  np_arr = self._makeIncremental((2,) * rank, dtypes.int64) % 11 + 1
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 715..722

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 64.

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

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

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

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

            Refactorings

            Further Reading

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

              @test_util.run_deprecated_v1
              def testInt32(self):
                # Numpy automatically upgrades the type of np.prod from int32 to int64, so
                # Numpy does not overflow an int32 np.prod while TensorFlow does. To avoid
                # overflow, limit array values.
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 724..729

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 64.

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

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

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

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

            Refactorings

            Further Reading

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

              def _makeIncremental(self, shape, dtype):
                data = np.arange(np.prod(shape)).reshape(shape).astype(dtype.as_numpy_dtype)
                if dtype.is_complex:
                  data -= 2j * data
                return data
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4033..4037

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

            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.cached_session():
                  t = ops.convert_to_tensor(x)
                  su = self._tf_reduce(t, reduction_axes, False)
                  jacob_t, jacob_n = gradient_checker.compute_gradient(
                      t, x.shape, su, su.get_shape().as_list(), x_init_value=x, delta=1)
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4049..4053

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

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

              @test_util.run_deprecated_v1
              def testUint8(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeRandom((2,) * rank, dtypes.uint8)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testComplex128(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.complex128)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testFloat64(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.float64)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testComplex128(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.complex128)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testFloat32(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.float32)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testComplex128(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.complex128)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754

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

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

              @test_util.run_deprecated_v1
              def testFloat64(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.float64)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testComplex64(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.complex64)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testBFloat16(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.bfloat16)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testFloat64(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.float64)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testComplex64(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.complex64)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testInt32(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.int32)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testInt32(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.int32)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testComplex64(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.complex64)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 731..735
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

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

              @test_util.run_deprecated_v1
              def testFloat32(self):
                for rank in range(1, _MAX_RANK + 1):
                  np_arr = self._makeIncremental((2,) * rank, dtypes.float32)
                  self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 244..248
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 352..356
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 358..362
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 364..368
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 526..530
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 532..536
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 559..563
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 565..569
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 571..575
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 577..581
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 583..587
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 744..748
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 750..754
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 756..760

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

            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 _powerset(iterable):
              """Helper for generating all possible reduction_axes arguments.
            
              Example:
              powerset([0,1,2]): () (0,) (1,) (2,) (0,1) (0,2) (1,2) (0,1,2)
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 104..117

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

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

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

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

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

            Refactorings

            Further Reading

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

              def _np_reduce(self, x, reduction_axes, keepdims):
                if isinstance(reduction_axes, list) or isinstance(reduction_axes,
                                                                  np.ndarray):
                  reduction_axes = tuple(reduction_axes)
                return np.sum(x, axis=reduction_axes, keepdims=keepdims)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 694..698
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4921..4926

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

              def _np_reduce(self, x, reduction_axes, keepdims):
                if isinstance(reduction_axes, list) or isinstance(reduction_axes,
                                                                  np.ndarray):
                  reduction_axes = tuple(reduction_axes)
                return np.prod(x, axis=reduction_axes, keepdims=keepdims)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 223..227
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4921..4926

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

                if reduction_axes is not None and np.shape(reduction_axes) == (1,):
                  # Test scalar reduction_axes argument
                  self._compareAll(x, reduction_axes[0], rtol=rtol, atol=atol)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 198..200
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4046..4048

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 52.

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

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

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

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

            Refactorings

            Further Reading

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

                if reduction_axes is not None and np.shape(reduction_axes) == (1,):
                  # Test scalar reduction_axes argument
                  self._compareGradient(x, reduction_axes[0], rtol=rtol, atol=atol)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 174..176
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4046..4048

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 52.

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

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

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

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

            Refactorings

            Further Reading

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

              def _makeRandom(self, shape, dtype):
                data = np.random.rand(*shape).astype(dtype.as_numpy_dtype)
                if dtype.is_complex:
                  data -= 2j * data
                return data
            tensorflow/python/kernel_tests/array_ops/split_op_test.py on lines 47..51
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4039..4043

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

            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

                  for dtype in (dtypes.bfloat16, dtypes.float16, dtypes.float32,
                                dtypes.float64, dtypes.complex64, dtypes.complex128):
                    # A large number is needed to get Eigen to die
                    x = array_ops.zeros((0, 9938), dtype=dtype)
                    y = math_ops.reduce_sum(x, [0])
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 796..801
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1236..1240

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 49.

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

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

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

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

            Refactorings

            Further Reading

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

                    for dtype in (dtypes.bool,):
                      # A large number is needed to get Eigen to die
                      x = array_ops.zeros((0, 9938), dtype=dtype)
                      y = math_ops.count_nonzero(x, [0])
                      self.assertAllEqual(y, np.zeros(9938))
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 479..484
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 796..801

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 49.

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

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

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

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

            Refactorings

            Further Reading

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

                  for dtype in (dtypes.bfloat16, dtypes.float16, dtypes.float32,
                                dtypes.float64):
                    # A large number is needed to get Eigen to die
                    x = array_ops.zeros((0, 9938), dtype=dtype)
                    y = math_ops.reduce_prod(x, [0])
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 479..484
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1236..1240

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 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

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

                      with self.session(graph=ops.Graph(), use_gpu=True) as sess:
                        tf_sum_xz = self._tf_reduce(arr, [0, 2], False)
                        tf_sum_y = self._tf_reduce(arr, 1, False)
                        tf_out_sum_xz, tf_out_sum_y = self.evaluate([tf_sum_xz, tf_sum_y])
            tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4967..4970

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

            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 testSizeOverflowInt16(self):
                np_arr = self._makeRandom((2**15,), dtypes.int16)
                self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 539..542
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 544..547
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 549..552

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

            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

                  for dtype, reductions in [(dtypes.float32,
                                             (math_ops.reduce_sum, math_ops.reduce_mean,
                                              math_ops.reduce_prod, math_ops.reduce_max,
                                              math_ops.reduce_min,
                                              math_ops.reduce_euclidean_norm)),
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 120..124

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

            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 testSizeOverflowUint16(self):
                np_arr = self._makeRandom((2**16,), dtypes.uint16)
                self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 539..542
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 544..547
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 554..557

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

            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 testSizeOverflowUint8(self):
                np_arr = self._makeRandom((2**8,), dtypes.uint8)
                self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 544..547
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 549..552
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 554..557

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

            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

                for dtype, reductions in [
                    (dtypes.float32, (math_ops.reduce_sum, math_ops.reduce_mean,
                                      math_ops.reduce_prod, math_ops.reduce_max,
                                      math_ops.reduce_min, math_ops.reduce_euclidean_norm)),
                    (dtypes.bool, (math_ops.reduce_all, math_ops.reduce_any))
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 102..108

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

            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 testSizeOverflowInt8(self):
                np_arr = self._makeRandom((2**7,), dtypes.int8)
                self._compareAllAxes(np_arr)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 539..542
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 549..552
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 554..557

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

            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.assertRaisesWithPredicateMatch(
                    ValueError, lambda e: "Invalid reduction dimension" in str(e)):
                  math_ops.reduce_sum(input_tensor, [2])
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 374..376

            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.assertRaisesWithPredicateMatch(
                    ValueError, lambda e: "Invalid reduction dimension" in str(e)):
                  math_ops.reduce_sum(input_tensor, [-3])
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 377..379

            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

              def _compareAll(self, x, reduction_axes):
                self._compare(x, reduction_axes, False, use_gpu=True)
                self._compare(x, reduction_axes, True, use_gpu=True)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 938..940

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

            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 _compareAll(self, x, reduction_axes):
                self._compare(x, reduction_axes, False, use_gpu=True)
                self._compare(x, reduction_axes, True, use_gpu=True)
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 821..823

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

            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

              @test_util.run_deprecated_v1
              def testExpand(self):
                # Reduce an empty tensor to a nonempty tensor
                x = np.zeros((5, 0))
                self._compareAll(x, [1])
            Severity: Minor
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py and 1 other location - About 50 mins to fix
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 462..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

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

              @test_util.run_deprecated_v1
              def testExpand(self):
                # Reduce an empty tensor to a nonempty tensor
                x = np.zeros((5, 0))
                self._compareAll(x, [1])
            Severity: Minor
            Found in tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py and 1 other location - About 50 mins to fix
            tensorflow/python/kernel_tests/math_ops/reduction_ops_test.py on lines 1226..1230

            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

            There are no issues that match your filters.

            Category
            Status