tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/signal/fft_ops_test.py

Summary

Maintainability
F
3 wks
Test Coverage

File fft_ops_test.py has 882 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    RFFTOpsTest has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class RFFTOpsTest(BaseFFTOpsTest, parameterized.TestCase):
    
      def _tf_fft(self, x, rank, fft_length=None, feed_dict=None):
        with self.cached_session() as sess:
          return sess.run(
    Severity: Minor
    Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 3 hrs to fix

      FFTOpsTest has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class FFTOpsTest(BaseFFTOpsTest, parameterized.TestCase):
      
        def _tf_fft(self, x, rank, fft_length=None, feed_dict=None):
          # fft_length unused for complex FFTs.
          with self.cached_session() as sess:
      Severity: Minor
      Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 2 hrs to fix

        Function _Compare_fftn has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def _Compare_fftn(
        Severity: Major
        Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 50 mins to fix

          Function _CompareBackward_fftn has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def _CompareBackward_fftn(
          Severity: Major
          Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 50 mins to fix

            Function _CompareForward_fftn has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def _CompareForward_fftn(
            Severity: Major
            Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 50 mins to fix

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

                def _generate_valid_irfft_input(self, c2r, np_ctype, r2c, np_rtype, rank,
              Severity: Minor
              Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 45 mins to fix

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

                  def _check_grad_complex(self, func, x, y, result_is_complex=True,
                Severity: Minor
                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 45 mins to fix

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

                    def _compare_backward(self, x, rank, fft_length=None, use_placeholder=False,
                  Severity: Minor
                  Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 45 mins to fix

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

                      def _compare_forward(self, x, rank, fft_length=None, use_placeholder=False,
                    Severity: Minor
                    Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 45 mins to fix

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

                        def _compare(self, x, rank, fft_length=None, use_placeholder=False,
                      Severity: Minor
                      Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 45 mins to fix

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

                          def _tf_fftn(self, x, fft_length=None, axes=None, norm=None, feed_dict=None):
                        Severity: Minor
                        Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 35 mins to fix

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

                            def _tf_ifftn(self, x, fft_length=None, axes=None, norm=None, feed_dict=None):
                          Severity: Minor
                          Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 35 mins to fix

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

                              def _tf_fftn(self, x, fft_length=None, axes=None, norm=None, feed_dict=None):
                            Severity: Minor
                            Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 35 mins to fix

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

                                def _tf_ifftn(self, x, fft_length=None, axes=None, norm=None, feed_dict=None):
                              Severity: Minor
                              Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 35 mins to fix

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

                                  def test_error(self):
                                    # TODO(rjryan): Fix this test under Eager.
                                    if context.executing_eagerly():
                                      return
                                    for rank in VALID_FFT_RANKS:
                                Severity: Minor
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py - About 25 mins to fix

                                Cognitive Complexity

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

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

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

                                Further reading

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

                                  @parameterized.parameters(itertools.product(
                                      VALID_FFT_RANKS, range(3), (5, 6), (np.float32, np.float64)))
                                  def test_basic(self, rank, extra_dims, size, np_rtype):
                                    np_ctype = np.complex64 if np_rtype == np.float32 else np.complex128
                                    tol = 1e-4 if np_rtype == np.float32 else 5e-5
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 2 days to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 705..721

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 246.

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

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

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

                                See codeclimate-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

                                  @parameterized.parameters(itertools.product(
                                      (1,), range(3), (64, 128), (np.float32, np.float64)))
                                  def test_large_batch(self, rank, extra_dims, size, np_rtype):
                                    np_ctype = np.complex64 if np_rtype == np.float32 else np.complex128
                                    tol = 1e-4 if np_rtype == np.float32 else 1e-5
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 2 days to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 569..585

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 246.

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

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

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

                                See codeclimate-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 _np_fft(self, x, rank, fft_length=None):
                                    if rank == 1:
                                      return np.fft.rfft2(x, s=fft_length, axes=(-1,))
                                    elif rank == 2:
                                      return np.fft.rfft2(x, s=fft_length, axes=(-2, -1))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 7 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 175..183
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 185..193
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 517..525

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 114.

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

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

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

                                See codeclimate-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 _np_ifft(self, x, rank, fft_length=None):
                                    if rank == 1:
                                      return np.fft.irfft2(x, s=fft_length, axes=(-1,))
                                    elif rank == 2:
                                      return np.fft.irfft2(x, s=fft_length, axes=(-2, -1))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 7 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 175..183
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 185..193
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 507..515

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 114.

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

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

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

                                See codeclimate-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 _np_ifft(self, x, rank, fft_length=None):
                                    if rank == 1:
                                      return np.fft.ifft2(x, s=fft_length, axes=(-1,))
                                    elif rank == 2:
                                      return np.fft.ifft2(x, s=fft_length, axes=(-2, -1))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 7 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 175..183
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 507..515
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 517..525

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 114.

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

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

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

                                See codeclimate-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 _np_fft(self, x, rank, fft_length=None):
                                    if rank == 1:
                                      return np.fft.fft2(x, s=fft_length, axes=(-1,))
                                    elif rank == 2:
                                      return np.fft.fft2(x, s=fft_length, axes=(-2, -1))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 7 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 185..193
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 507..515
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 517..525

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 114.

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

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

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

                                See codeclimate-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 _CompareForward_fftn(
                                      self,
                                      x,
                                      fft_length=None,
                                      axes=None,
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 7 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 77..93

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 113.

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

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

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

                                See codeclimate-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 _CompareBackward_fftn(
                                      self,
                                      x,
                                      fft_length=None,
                                      axes=None,
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 7 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 59..75

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 113.

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

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

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

                                See codeclimate-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 _compare_forward(self, x, rank, fft_length=None, use_placeholder=False,
                                                       rtol=1e-4, atol=1e-4):
                                    x_np = self._np_fft(x, rank, fft_length)
                                    if use_placeholder:
                                      x_ph = array_ops.placeholder(dtype=dtypes.as_dtype(x.dtype))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 6 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 111..120

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 107.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _compare_backward(self, x, rank, fft_length=None, use_placeholder=False,
                                                        rtol=1e-4, atol=1e-4):
                                    x_np = self._np_ifft(x, rank, fft_length)
                                    if use_placeholder:
                                      x_ph = array_ops.placeholder(dtype=dtypes.as_dtype(x.dtype))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 6 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 100..109

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 107.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    for rank in VALID_FFT_RANKS:
                                      for dims in range(0, rank):
                                        x = np.zeros((1,) * dims).astype(np.complex64)
                                        with self.assertRaisesWithPredicateMatch(
                                            ValueError, "Shape must be .*rank {}.*".format(rank)):
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 5 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 850..857

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 92.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      for dims in range(0, rank):
                                        x = np.zeros((1,) * dims).astype(np.complex64)
                                        with self.assertRaisesWithPredicateMatch(
                                            ValueError, "Shape .* must have rank at least {}".format(rank)):
                                          self._tf_fft(x, rank)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 5 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 438..446

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 92.

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

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

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

                                See codeclimate-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

                                  @parameterized.parameters(
                                      itertools.product(VALID_FFT_RANKS, range(3),
                                                        (np.complex64, np.complex128)))
                                  def test_basic(self, rank, extra_dims, np_type):
                                    dims = rank + extra_dims
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 5 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 370..377

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 88.

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

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

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

                                See codeclimate-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

                                  @parameterized.parameters(itertools.product(
                                      (1,), range(3), (np.complex64, np.complex128)))
                                  def test_large_batch(self, rank, extra_dims, np_type):
                                    dims = rank + extra_dims
                                    tol = 1e-4 if np_type == np.complex64 else 5e-5
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 5 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 243..251

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 88.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      with self.assertRaisesWithPredicateMatch(
                                          errors.InvalidArgumentError,
                                          "Input dimension .* must have length of at least .* but got: 3"):
                                        x = np.zeros((3,) * rank).astype(np.complex64)
                                        fft_length = [6] * rank
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 4 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 887..893

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 75.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      with self.assertRaisesWithPredicateMatch(
                                          errors.InvalidArgumentError,
                                          "Input dimension .* must have length of at least 6 but got: 5"):
                                        x = np.zeros((5,) * rank).astype(np.float32)
                                        fft_length = [6] * rank
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 4 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 895..901

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 75.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    def gen(shape):
                                      n = np.prod(shape)
                                      re = np.random.uniform(size=n)
                                      im = np.random.uniform(size=n)
                                      return (re + im * 1j).reshape(shape)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 3 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 406..410

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 68.

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

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

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 gen(shape):
                                      n = np.prod(shape)
                                      re = np.random.uniform(size=n)
                                      im = np.random.uniform(size=n)
                                      return (re + im * 1j).reshape(shape)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 3 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 426..430

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 68.

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

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

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

                                See codeclimate-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 _tf_fft_for_rank(self, rank):
                                    if rank == 1:
                                      return fft_ops.fft
                                    elif rank == 2:
                                      return fft_ops.fft2d
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 3 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 225..233
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 527..535
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 537..545

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 62.

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

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

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

                                See codeclimate-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 _tf_ifft_for_rank(self, rank):
                                    if rank == 1:
                                      return fft_ops.irfft
                                    elif rank == 2:
                                      return fft_ops.irfft2d
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 3 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 215..223
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 225..233
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 527..535

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 62.

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

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

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

                                See codeclimate-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 _tf_ifft_for_rank(self, rank):
                                    if rank == 1:
                                      return fft_ops.ifft
                                    elif rank == 2:
                                      return fft_ops.ifft2d
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 3 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 215..223
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 527..535
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 537..545

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 62.

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

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

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

                                See codeclimate-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 _tf_fft_for_rank(self, rank):
                                    if rank == 1:
                                      return fft_ops.rfft
                                    elif rank == 2:
                                      return fft_ops.rfft2d
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 3 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 215..223
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 225..233
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 537..545

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 62.

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

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

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

                                    self._Compare_fftn(
                                        np.mod(np.arange(np.power(4, dims)), 10)
                                        .reshape((4,) * dims)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 2 other locations - About 2 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 285..287
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 309..311

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 59.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    self._Compare_fftn(
                                        np.mod(np.arange(np.power(4, dims)), 10)
                                        .reshape((4,) * dims)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 2 other locations - About 2 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 261..263
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 285..287

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 59.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    self._Compare_fftn(
                                        np.mod(np.arange(np.power(4, dims)), 10)
                                        .reshape((4,) * dims)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 2 other locations - About 2 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 261..263
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 309..311

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 59.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _tf_fftn(self, x, fft_length=None, axes=None, norm=None, feed_dict=None):
                                    with self.cached_session() as sess:
                                      return sess.run(
                                          fft_ops.fftnd(x, fft_length=fft_length, axes=axes, norm=norm),
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 2 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 202..205
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 487..490
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 494..497

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 55.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _tf_fftn(self, x, fft_length=None, axes=None, norm=None, feed_dict=None):
                                    with self.cached_session() as sess:
                                      return sess.run(
                                          fft_ops.rfftnd(x, fft_length=fft_length, axes=axes, norm=norm),
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 2 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 195..198
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 202..205
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 494..497

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 55.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _tf_ifftn(self, x, fft_length=None, axes=None, norm=None, feed_dict=None):
                                    with self.cached_session() as sess:
                                      return sess.run(
                                          fft_ops.ifftnd(x, fft_length=fft_length, axes=axes, norm=norm),
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 2 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 195..198
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 487..490
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 494..497

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 55.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _tf_ifftn(self, x, fft_length=None, axes=None, norm=None, feed_dict=None):
                                    with self.cached_session() as sess:
                                      return sess.run(
                                          fft_ops.irfftnd(x, fft_length=fft_length, axes=axes, norm=norm),
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 2 hrs to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 195..198
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 202..205
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 487..490

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 55.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _tf_ifft(self, x, rank, fft_length=None, feed_dict=None):
                                    with self.cached_session() as sess:
                                      return sess.run(
                                          self._tf_ifft_for_rank(rank)(x, fft_length), feed_dict=feed_dict)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 477..480

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 47.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _tf_fft(self, x, rank, fft_length=None, feed_dict=None):
                                    with self.cached_session() as sess:
                                      return sess.run(
                                          self._tf_fft_for_rank(rank)(x, fft_length), feed_dict=feed_dict)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 482..485

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 47.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _tf_fft(self, x, rank, fft_length=None, feed_dict=None):
                                    # fft_length unused for complex FFTs.
                                    with self.cached_session() as sess:
                                      return sess.run(self._tf_fft_for_rank(rank)(x), feed_dict=feed_dict)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 170..173

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 46.

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

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

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

                                See codeclimate-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 _tf_ifft(self, x, rank, fft_length=None, feed_dict=None):
                                    # fft_length unused for complex FFTs.
                                    with self.cached_session() as sess:
                                      return sess.run(self._tf_ifft_for_rank(rank)(x), feed_dict=feed_dict)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 165..168

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 46.

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

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

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

                                See codeclimate-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

                                    im = np.random.rand(*((3,) * dims)).astype(np_type) * 2 - 1
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 466..466

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 39.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    re = np.random.rand(*((3,) * dims)).astype(np_type) * 2 - 1
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 467..467

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 39.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    re = np.random.rand(*((size,) * dims)).astype(np_rtype) * 2 - 1
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 931..931

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 39.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    im = np.random.rand(*((size,) * dims)).astype(np_rtype) * 2 - 1
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 930..930

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 39.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      self.assertAllEqual(
                                          fft_ops.fftshift(freqs, axes=(0, 1)),
                                          np.fft.fftshift(freqs, axes=(0, 1)))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 998..1000

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 38.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      self.assertAllEqual(
                                          fft_ops.ifftshift(shifted, axes=(0, 1)),
                                          np.fft.ifftshift(shifted, axes=(0, 1)))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 1 hr to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 995..997

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 38.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _np_ifftn(self, x, fft_length=None, axes=None, norm=None):
                                    return np.fft.irfftn(x, s=fft_length, axes=axes, norm=norm)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 45 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 209..210
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 212..213
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 501..502

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 35.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _np_fftn(self, x, fft_length=None, axes=None, norm=None):
                                    return np.fft.rfftn(x, s=fft_length, axes=axes, norm=norm)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 45 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 209..210
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 212..213
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 504..505

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 35.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _np_ifftn(self, x, fft_length=None, axes=None, norm=None):
                                    return np.fft.ifftn(x, s=fft_length, axes=axes, norm=norm)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 45 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 209..210
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 501..502
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 504..505

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 35.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  def _np_fftn(self, x, fft_length=None, axes=None, norm=None):
                                    return np.fft.fftn(x, s=fft_length, axes=axes, norm=norm)
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 45 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 212..213
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 501..502
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 504..505

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 35.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    with self.session() as sess:
                                      y_fftshift_res, y_ifftshift_res = sess.run(
                                          [y_fftshift, y_ifftshift],
                                          feed_dict={x: x_np})
                                Severity: Minor
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 45 mins to fix
                                tensorflow/python/kernel_tests/linalg/qr_op_test.py on lines 141..145

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 35.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                    r2c = np.mod(np.arange(np.power(5, 4)), 10).reshape((5,) * 4)
                                Severity: Minor
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 45 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 363..363

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 35.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                        np.mod(np.arange(np.power(4, 4)), 10).reshape((4,) * 4).astype(np_type),
                                Severity: Minor
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 45 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 686..686

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 35.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  @parameterized.parameters(
                                      itertools.product(range(1, 4), (5, 6), (np.float32, np.float64))
                                  )
                                  @test_util.run_gpu_only
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 2 other locations - About 40 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 587..590
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 612..615

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 34.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  @parameterized.parameters(
                                      itertools.product(range(3, 5), (5, 6), (np.float32, np.float64))
                                  )
                                  @test_util.run_gpu_only
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 2 other locations - About 40 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 612..615
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 644..647

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 34.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                  @parameterized.parameters(
                                      itertools.product(range(1, 5), (5, 6), (np.float32, np.float64))
                                  )
                                  @test_util.run_gpu_only
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 2 other locations - About 40 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 587..590
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 644..647

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 34.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                        with self.assertRaisesWithPredicateMatch(
                                            ValueError, "Dimension must be .*but is {}.*".format(rank + 1)):
                                          self._tf_ifft(x, rank, fft_length)
                                Severity: Minor
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 40 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 872..874

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 34.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                        with self.assertRaisesWithPredicateMatch(
                                            ValueError, "Dimension must be .*but is {}.*".format(rank + 1)):
                                          self._tf_fft(x, rank, fft_length)
                                Severity: Minor
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 1 other location - About 40 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 875..877

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 34.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      self.assertAllEqual(
                                          fft_ops.ifftshift(shifted, axes=0),
                                          fft_ops.ifftshift(shifted, axes=(0,)))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 30 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 973..975
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 1023..1024
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 1025..1027

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 32.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      self.assertAllEqual(
                                          fft_ops.fftshift(freqs, axes=0),
                                          fft_ops.fftshift(freqs, axes=(0,)))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 30 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 977..979
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 1023..1024
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 1025..1027

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 32.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      self.assertAllEqual(
                                          fft_ops.fftshift(freqs, axes=-1), fft_ops.fftshift(freqs, axes=(1,)))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 30 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 973..975
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 977..979
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 1025..1027

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 32.

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

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

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

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

                                Refactorings

                                Further Reading

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

                                      self.assertAllEqual(
                                          fft_ops.ifftshift(shifted, axes=-1),
                                          fft_ops.ifftshift(shifted, axes=(1,)))
                                Severity: Major
                                Found in tensorflow/python/kernel_tests/signal/fft_ops_test.py and 3 other locations - About 30 mins to fix
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 973..975
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 977..979
                                tensorflow/python/kernel_tests/signal/fft_ops_test.py on lines 1023..1024

                                Duplicated Code

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

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

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

                                Tuning

                                This issue has a mass of 32.

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

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

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

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

                                Refactorings

                                Further Reading

                                There are no issues that match your filters.

                                Category
                                Status