tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py

Summary

Maintainability
F
1 wk
Test Coverage

SoftmaxTest has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

class SoftmaxTest(test.TestCase):

  def _npSoftmax(self, features, dim=-1, log=False):
    if dim == -1:
      dim = len(features.shape) - 1
Severity: Minor
Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py - About 2 hrs to fix

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

      def _testSoftmax(self,
    Severity: Minor
    Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py - About 35 mins to fix

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

        def _npSoftmax(self, features, dim=-1, log=False):
          if dim == -1:
            dim = len(features.shape) - 1
          one_only_on_dim = list(features.shape)
          one_only_on_dim[dim] = 1
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 1 other location - About 1 day to fix
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 3909..3928

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 196.

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

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

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

        @unittest.skipUnless(test.is_built_with_gpu_support(),
                             "Test only applicable when running on GPUs")
        def testFloatGPU(self):
          if test.is_gpu_available(cuda_only=True):
            rows = [2**x + np.random.randint(0, 16) for x in range(1, 4)]
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 2 other locations - About 1 day to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 150..159
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 166..175

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 165.

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

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

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

        @unittest.skipUnless(test.is_built_with_gpu_support(),
                             "Test only applicable when running on GPUs")
        def testDoubleGPU(self):
          if test.is_gpu_available(cuda_only=True):
            rows = [2**x + np.random.randint(0, 16) for x in range(1, 4)]
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 2 other locations - About 1 day to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 135..144
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 150..159

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 165.

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

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

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

        @unittest.skipUnless(test.is_built_with_gpu_support(),
                             "Test only applicable when running on GPUs")
        def testHalfGPU(self):
          if test.is_gpu_available(cuda_only=True):
            rows = [2**x + np.random.randint(0, 16) for x in range(1, 4)]
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 2 other locations - About 1 day to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 135..144
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 166..175

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 165.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 _testOverflow(self, use_gpu=False):
          if use_gpu:
            type = np.float32  # pylint: disable=redefined-builtin
          else:
            type = np.float64  # pylint: disable=redefined-builtin
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 1 other location - About 1 day to fix
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 3988..4005

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 153.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testNpSoftmax(self):
          features = [[1., 1., 1., 1.], [1., 2., 3., 4.]]
          # Batch 0: All exps are 1.  The expected result is
          # Softmaxes = [0.25, 0.25, 0.25, 0.25]
          # LogSoftmaxes = [-1.386294, -1.386294, -1.386294, -1.386294]
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 1 other location - About 1 day to fix
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 3956..3983

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 134.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testAlongNegativeDimension(self):
          self._testSoftmax(
              np.array([[[1., 1., 1., 1.], [1., 2., 3., 4.]],
                        [[2., 3., 4., 5.], [6., 7., 8., 9.]],
                        [[5., 4., 3., 2.], [1., 2., 3., 4.]]]).astype(np.float32),
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 2 other locations - About 5 hrs to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 220..227
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 229..236

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 90.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testAlongFirstDimension(self):
          self._testSoftmax(
              np.array([[[1., 1., 1., 1.], [1., 2., 3., 4.]],
                        [[2., 3., 4., 5.], [6., 7., 8., 9.]],
                        [[5., 4., 3., 2.], [1., 2., 3., 4.]]]).astype(np.float32),
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 2 other locations - About 5 hrs to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 229..236
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 238..245

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 90.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testAlongSecondDimension(self):
          self._testSoftmax(
              np.array([[[1., 1., 1., 1.], [1., 2., 3., 4.]],
                        [[2., 3., 4., 5.], [6., 7., 8., 9.]],
                        [[5., 4., 3., 2.], [1., 2., 3., 4.]]]).astype(np.float32),
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 2 other locations - About 5 hrs to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 220..227
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 238..245

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 90.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 test3DTensorAsInputNoReshape(self):
          self._testSoftmax(
              np.array([[[1., 1., 1., 1.], [1., 2., 3., 4.]],
                        [[2., 3., 4., 5.], [6., 7., 8., 9.]],
                        [[5., 4., 3., 2.], [1., 2., 3., 4.]]]).astype(np.float32),
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 204..210

      Duplicated Code

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

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

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

        def test3DTensorAsInput(self):
          self._testSoftmax(
              np.array([[[1., 1., 1., 1.], [1., 2., 3., 4.]],
                        [[2., 3., 4., 5.], [6., 7., 8., 9.]],
                        [[5., 4., 3., 2.], [1., 2., 3., 4.]]]).astype(np.float32),
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 212..218

      Duplicated Code

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

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

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

        def test1DTensorAsInput(self):
          self._testSoftmax(
              np.array([3., 2., 3., 9.]).astype(np.float64), use_gpu=False)
          self._testOverflow(use_gpu=False)
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 199..202

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 49.

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

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

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

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

      Refactorings

      Further Reading

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

        def test1DTensorAsInputNoReshape(self):
          self._testSoftmax(
              np.array([3., 2., 3., 9.]).astype(np.float64), use_gpu=False)
          self._testOverflow(use_gpu=False)
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 194..197

      Duplicated Code

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

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

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

        def testFloat(self):
          self._testAll(
              np.array([[1., 1., 1., 1.], [1., 2., 3., 4.]]).astype(np.float32))
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 3 other locations - About 1 hr to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 146..148
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4010..4013
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4017..4020

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 42.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testHalf(self):
          self._testAll(
              np.array([[1., 1., 1., 1.], [1., 2., 3., 4.]]).astype(np.float16))
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 3 other locations - About 1 hr to fix
      tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py on lines 131..133
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4010..4013
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 4017..4020

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 42.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 log:
              tf_softmax = nn_ops.log_softmax(np_features, axis=dim, name=name)
            else:
              tf_softmax = nn_ops.softmax(np_features, axis=dim, name=name)
      Severity: Major
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 2 other locations - About 1 hr to fix
      tensorflow/python/kernel_tests/sparse_ops/sparse_ops_test.py on lines 816..820
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 3937..3940

      Duplicated Code

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

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

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

          if not log and dtype is None:
            # Bonus check: the softmaxes should add to one in dimension dim.
            sum_along_dim = np.sum(out, axis=dim)
            self.assertAllCloseAccordingToType(
                np.ones(sum_along_dim.shape), sum_along_dim)
      Severity: Minor
      Found in tensorflow/python/kernel_tests/nn_ops/softmax_op_test.py and 1 other location - About 40 mins to fix
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 3944..3948

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 34.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status