tensorflow/tensorflow

View on GitHub
tensorflow/python/ops/math_grad_test.py

Summary

Maintainability
F
3 wks
Test Coverage

File math_grad_test.py has 593 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

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

      def _testGrad(self, shape, dtype=None, max_error=None, bias=None, sigma=None):
    Severity: Minor
    Found in tensorflow/python/ops/math_grad_test.py - About 35 mins to fix

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

        @test_util.run_deprecated_v1
        def testSegmentMinGradientWithTies(self):
          inputs = constant_op.constant([1.0], dtype=dtypes.float32)
          data = array_ops.concat([inputs, inputs], 0)
          segment_ids = constant_op.constant([0, 0], dtype=dtypes.int64)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 389..398

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 112.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testSegmentMaxGradientWithTies(self):
          inputs = constant_op.constant([1.0], dtype=dtypes.float32)
          data = array_ops.concat([inputs, inputs], 0)
          segment_ids = constant_op.constant([0, 0], dtype=dtypes.int64)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 378..387

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 112.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testBasicGradient(self):
          inputs = constant_op.constant(np.arange(-3, 3), dtype=dtypes.float32)
          outputs = math_ops.mul_no_nan(inputs, 1 + math_ops.abs(inputs))
          with self.cached_session():
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 455..465

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 106.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testBasicGradient(self):
          inputs = constant_op.constant(np.arange(-3, 3),
                                        dtype=dtypes.float32)
          outputs = math_ops.div_no_nan(inputs, 1 + math_ops.abs(inputs))
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 482..491

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 106.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 test3D_3(self):
          for dtype in [dtypes.float32, dtypes.float64]:
            x = constant_op.constant([[[-3, 5], [7, 11]], [[13, 17], [19, 23]]],
                                     dtype=dtype)
            grads = gradient_checker_v2.compute_gradient(
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 328..335
      tensorflow/python/ops/math_grad_test.py on lines 346..353

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 103.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 test3D_4(self):
          for dtype in [dtypes.float32, dtypes.float64]:
            x = constant_op.constant([[[-3, 5], [7, 11]], [[13, 17], [19, 23]]],
                                     dtype=dtype)
            grads = gradient_checker_v2.compute_gradient(
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 328..335
      tensorflow/python/ops/math_grad_test.py on lines 337..344

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 103.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 test3D_2(self):
          for dtype in [dtypes.float32, dtypes.float64]:
            x = constant_op.constant([[[-3, 5], [7, 11]], [[13, 17], [19, 23]]],
                                     dtype=dtype)
            grads = gradient_checker_v2.compute_gradient(
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 337..344
      tensorflow/python/ops/math_grad_test.py on lines 346..353

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 103.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 6 locations. Consider refactoring.
      Open

        @test_util.run_deprecated_v1
        def testZeroXGrad(self):
          for dtype in [dtypes.float16, dtypes.float32, dtypes.float64]:
            x = constant_op.constant(0., dtype=dtype)
            y = constant_op.constant(3.1, dtype=dtype)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 5 other locations - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 523..531
      tensorflow/python/ops/math_grad_test.py on lines 542..550
      tensorflow/python/ops/math_grad_test.py on lines 592..600
      tensorflow/python/ops/math_grad_test.py on lines 621..629
      tensorflow/python/ops/math_grad_test.py on lines 640..648

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 102.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testZeroXGrad(self):
          for dtype in [dtypes.float16, dtypes.float32, dtypes.float64]:
            x = constant_op.constant(0., dtype=dtype)
            y = constant_op.constant(3.1, dtype=dtype)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 5 other locations - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 542..550
      tensorflow/python/ops/math_grad_test.py on lines 573..581
      tensorflow/python/ops/math_grad_test.py on lines 592..600
      tensorflow/python/ops/math_grad_test.py on lines 621..629
      tensorflow/python/ops/math_grad_test.py on lines 640..648

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 102.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testZeroXYGrad(self):
          for dtype in [dtypes.float16, dtypes.float32, dtypes.float64]:
            x = constant_op.constant(0., dtype=dtype)
            y = constant_op.constant(0., dtype=dtype)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 5 other locations - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 523..531
      tensorflow/python/ops/math_grad_test.py on lines 573..581
      tensorflow/python/ops/math_grad_test.py on lines 592..600
      tensorflow/python/ops/math_grad_test.py on lines 621..629
      tensorflow/python/ops/math_grad_test.py on lines 640..648

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 102.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testZeroXGrad(self):
          for dtype in [dtypes.float16, dtypes.float32, dtypes.float64]:
            x = constant_op.constant(0., dtype=dtype)
            y = constant_op.constant(3.1, dtype=dtype)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 5 other locations - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 523..531
      tensorflow/python/ops/math_grad_test.py on lines 542..550
      tensorflow/python/ops/math_grad_test.py on lines 573..581
      tensorflow/python/ops/math_grad_test.py on lines 592..600
      tensorflow/python/ops/math_grad_test.py on lines 640..648

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 102.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testZeroXYGrad(self):
          for dtype in [dtypes.float16, dtypes.float32, dtypes.float64]:
            x = constant_op.constant(0., dtype=dtype)
            y = constant_op.constant(0., dtype=dtype)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 5 other locations - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 523..531
      tensorflow/python/ops/math_grad_test.py on lines 542..550
      tensorflow/python/ops/math_grad_test.py on lines 573..581
      tensorflow/python/ops/math_grad_test.py on lines 592..600
      tensorflow/python/ops/math_grad_test.py on lines 621..629

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 102.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testZeroXNegOneYGrad(self):
          for dtype in [dtypes.float16, dtypes.float32, dtypes.float64]:
            x = constant_op.constant(0., dtype=dtype)
            y = constant_op.constant(-1., dtype=dtype)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 5 other locations - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 523..531
      tensorflow/python/ops/math_grad_test.py on lines 542..550
      tensorflow/python/ops/math_grad_test.py on lines 573..581
      tensorflow/python/ops/math_grad_test.py on lines 621..629
      tensorflow/python/ops/math_grad_test.py on lines 640..648

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 102.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testSegmentMinGradient(self):
          data = constant_op.constant([1.0, 2.0, 3.0], dtype=dtypes.float32)
          segment_ids = constant_op.constant([0, 0, 1], dtype=dtypes.int64)
          segment_min = math_ops.segment_min(data, segment_ids)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 368..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 100.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testSegmentMaxGradient(self):
          data = constant_op.constant([1.0, 2.0, 3.0], dtype=dtypes.float32)
          segment_ids = constant_op.constant([0, 0, 1], dtype=dtypes.int64)
          segment_max = math_ops.segment_max(data, segment_ids)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 358..366

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 100.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testNegOneYGrad(self):
          for dtype in [dtypes.float16, dtypes.float32, dtypes.float64]:
            x = constant_op.constant(0.1, dtype=dtype)
            y = constant_op.constant(-1., dtype=dtype)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 533..540

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 99.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testZeroYGrad(self):
          for dtype in [dtypes.float16, dtypes.float32, dtypes.float64]:
            x = constant_op.constant(0.1, dtype=dtype)
            y = constant_op.constant(0., dtype=dtype)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 6 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 583..590

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 99.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 test2D_3(self):
          for dtype in [dtypes.float32, dtypes.float64]:
            x = constant_op.constant([[-3, 5], [7, 11]], dtype=dtype)
            grads = gradient_checker_v2.compute_gradient(
                lambda x: math_ops.reduce_euclidean_norm(x, 1), [x])
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 295..301

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 91.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 test2D_2(self):
          for dtype in [dtypes.float32, dtypes.float64]:
            x = constant_op.constant([[-3, 5], [7, 11]], dtype=dtype)
            grads = gradient_checker_v2.compute_gradient(
                lambda x: math_ops.reduce_euclidean_norm(x, 0), [x])
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 303..309

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 91.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testMaxGradient(self):
          inputs = constant_op.constant([1.0], dtype=dtypes.float32)
          outputs = math_ops.reduce_max(array_ops.concat([inputs, inputs], 0))
          with self.cached_session():
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 4 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 133..139

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 84.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testMinGradient(self):
          inputs = constant_op.constant([1.0], dtype=dtypes.float32)
          outputs = math_ops.reduce_min(array_ops.concat([inputs, inputs], 0))
          with self.cached_session():
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 4 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 141..147

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 84.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testMinimumGradient(self):
          inputs = constant_op.constant([1.0, 2.0, 3.0, 4.0], dtype=dtypes.float32)
          outputs = math_ops.minimum(inputs, 2.0)
          with self.cached_session():
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 4 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 152..158

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 80.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testMaximumGradient(self):
          inputs = constant_op.constant([1.0, 2.0, 3.0, 4.0], dtype=dtypes.float32)
          outputs = math_ops.maximum(inputs, 3.0)
          with self.cached_session():
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 4 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 160..166

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 80.

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

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

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

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

      Refactorings

      Further Reading

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

        def _xdivy_gradients(self, x, y):
          xdivy_xgrad = self.evaluate(gradients.gradients(math_ops.xdivy(x, y), x)[0])
          xdivy_ygrad = self.evaluate(gradients.gradients(math_ops.xdivy(x, y), y)[0])
          return xdivy_xgrad, xdivy_ygrad
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 4 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 507..510
      tensorflow/python/ops/math_grad_test.py on lines 555..560

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 76.

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

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

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

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

      Refactorings

      Further Reading

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

        def _xlogy_gradients(self, x, y):
          xlogy_xgrad = self.evaluate(gradients.gradients(math_ops.xlogy(x, y), x)[0])
          xlogy_ygrad = self.evaluate(gradients.gradients(math_ops.xlogy(x, y), y)[0])
          return xlogy_xgrad, xlogy_ygrad
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 4 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 555..560
      tensorflow/python/ops/math_grad_test.py on lines 605..608

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 76.

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

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

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

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

      Refactorings

      Further Reading

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

        def _xlog1py_gradients(self, x, y):
          xlog1py_xgrad = self.evaluate(
              gradients.gradients(math_ops.xlog1py(x, y), x)[0])
          xlog1py_ygrad = self.evaluate(
              gradients.gradients(math_ops.xlog1py(x, y), y)[0])
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 4 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 507..510
      tensorflow/python/ops/math_grad_test.py on lines 605..608

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 76.

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

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

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

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

      Refactorings

      Further Reading

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

        def testSegmentProdGradientWithEmptySegment(self):
          data = constant_op.constant([[1, 2, 3, 4], [4, 3, 2, 1], [5, 6, 7, 8]],
                                      dtype=dtypes.float32)
          segment_ids = constant_op.constant([0, 0, 2], dtype=dtypes.int64)
          self._run_gradient_check(data, segment_ids)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 3 other locations - About 3 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 413..417
      tensorflow/python/ops/math_grad_test.py on lines 419..423
      tensorflow/python/ops/math_grad_test.py on lines 425..429

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 4 locations. Consider refactoring.
      Open

        def testSegmentProdGradientWithZeros(self):
          data = constant_op.constant([[0, 2, 3, 4], [0, 0, 2, 0], [5, 0, 7, 0]],
                                      dtype=dtypes.float32)
          segment_ids = constant_op.constant([0, 0, 1], dtype=dtypes.int64)
          self._run_gradient_check(data, segment_ids)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 3 other locations - About 3 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 413..417
      tensorflow/python/ops/math_grad_test.py on lines 419..423
      tensorflow/python/ops/math_grad_test.py on lines 431..435

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 4 locations. Consider refactoring.
      Open

        def testSegmentProdGradientWithoutOverlap(self):
          data = constant_op.constant([[1, 2, 3, 4], [4, 3, 2, 1], [5, 6, 7, 8]],
                                      dtype=dtypes.float32)
          segment_ids = constant_op.constant([0, 1, 2], dtype=dtypes.int64)
          self._run_gradient_check(data, segment_ids)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 3 other locations - About 3 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 419..423
      tensorflow/python/ops/math_grad_test.py on lines 425..429
      tensorflow/python/ops/math_grad_test.py on lines 431..435

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 4 locations. Consider refactoring.
      Open

        def testSegmentProdGradientWithoutZeros(self):
          data = constant_op.constant([[1, 2, 3, 4], [4, 3, 2, 1], [5, 6, 7, 8]],
                                      dtype=dtypes.float32)
          segment_ids = constant_op.constant([0, 0, 1], dtype=dtypes.int64)
          self._run_gradient_check(data, segment_ids)
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 3 other locations - About 3 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 413..417
      tensorflow/python/ops/math_grad_test.py on lines 425..429
      tensorflow/python/ops/math_grad_test.py on lines 431..435

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
      Open

        def testNegative(self):
          for dtype in [dtypes.float32, dtypes.float64]:
            x = constant_op.constant([-3], dtype=dtype)
            grad = gradient_checker_v2.compute_gradient(
                math_ops.reduce_euclidean_norm, [x])
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 3 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 221..227
      tensorflow/python/ops/math_grad_test.py on lines 237..243

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
      Open

        def testKeepdims(self):
          for dtype in [dtypes.float32, dtypes.float64]:
            x = constant_op.constant([3], dtype=dtype)
            grad = gradient_checker_v2.compute_gradient(
                math_ops.reduce_euclidean_norm, [x])
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 3 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 221..227
      tensorflow/python/ops/math_grad_test.py on lines 229..235

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 3 locations. Consider refactoring.
      Open

        def testBasic(self):
          for dtype in [dtypes.float32, dtypes.float64]:
            x = constant_op.constant([3], dtype=dtype)
            grad = gradient_checker_v2.compute_gradient(
                math_ops.reduce_euclidean_norm, [x])
      Severity: Major
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 3 hrs to fix
      tensorflow/python/ops/math_grad_test.py on lines 229..235
      tensorflow/python/ops/math_grad_test.py on lines 237..243

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

            inputs = constant_op.constant([[1 + 3j, 2 - 1j], [3j, 4]],
      Severity: Minor
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 50 mins to fix
      tensorflow/python/ops/math_grad_test.py on lines 208..208

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

            inputs = constant_op.constant([[1 + 3j, 2 - 1j], [3j, 4]],
      Severity: Minor
      Found in tensorflow/python/ops/math_grad_test.py and 1 other location - About 50 mins to fix
      tensorflow/python/ops/math_grad_test.py on lines 196..196

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

              err = gradient_checker_v2.max_error(
                  *gradient_checker_v2.compute_gradient(
                      lambda x: math_ops.nextafter(x, x2), [x1]))  # pylint: disable=cell-var-from-loop
      Severity: Minor
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 35 mins to fix
      tensorflow/python/ops/gradient_checker_v2_test.py on lines 91..92
      tensorflow/python/ops/math_grad_test.py on lines 718..720

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 33.

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

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

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

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

      Refactorings

      Further Reading

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

              err = gradient_checker_v2.max_error(
                  *gradient_checker_v2.compute_gradient(
                      lambda x: math_ops.nextafter(x, x2), [x1]))  # pylint: disable=cell-var-from-loop
      Severity: Minor
      Found in tensorflow/python/ops/math_grad_test.py and 2 other locations - About 35 mins to fix
      tensorflow/python/ops/gradient_checker_v2_test.py on lines 91..92
      tensorflow/python/ops/math_grad_test.py on lines 708..710

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 33.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status