tensorflow/tensorflow

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

Summary

Maintainability
F
1 mo
Test Coverage

File weak_tensor_special_math_ops_test.py has 471 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2023 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: Minor
Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py - About 7 hrs to fix

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

      @test_util.run_in_graph_and_eager_modes
      def test_besselk_boundary(self):
        self.assertTrue(np.isinf(self.evaluate(special_math_ops.bessel_k0(0.))))
        self.assertTrue(np.isinf(self.evaluate(special_math_ops.bessel_k0e(0.))))
        self.assertTrue(np.isinf(self.evaluate(special_math_ops.bessel_k1(0.))))
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 2 days to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 424..435

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 234.

    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(np.float32, np.float64)
      def test_besseli_small(self, dtype):
        x = np.random.uniform(-1.0, 1.0, size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
        try:
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 492..512

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

    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(np.float32, np.float64)
      def test_besselk_larger(self, dtype):
        x = np.random.uniform(1.0, 30.0, size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
        try:
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 379..399

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

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

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

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

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

    Refactorings

    Further Reading

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

      @test_util.run_in_graph_and_eager_modes
      def test_besseli_boundary(self):
        self.assertAllClose(1., special_math_ops.bessel_i0(0.))
        self.assertAllClose(1., special_math_ops.bessel_i0e(0.))
        self.assertAllClose(0., special_math_ops.bessel_i1(0.))
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 404..415

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

    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 test_besseli_gradient(self):
        inputs = [_get_weak_tensor(np.random.uniform(-10.0, 10.0, size=int(1e2)))]
        analytical, numerical = gradient_checker_v2.compute_gradient(
            special_math_ops.bessel_i0, inputs)
        self.assertLess(gradient_checker_v2.max_error(analytical, numerical), 1e-3)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 558..574

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

    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 test_besselk_gradient(self):
        inputs = [_get_weak_tensor(np.random.uniform(1.0, 50.0, size=int(1e2)))]
        analytical, numerical = gradient_checker_v2.compute_gradient(
            special_math_ops.bessel_k0, inputs)
        self.assertLess(gradient_checker_v2.max_error(analytical, numerical), 1e-4)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 530..546

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

    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

      @parameterized.parameters(np.float32, np.float64)
      def test_bessely_larger(self, dtype):
        x = np.random.uniform(1.0, 30.0, size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
        try:
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 3 other locations - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 401..416
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 458..473
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 475..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 144.

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

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

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

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

    Refactorings

    Further Reading

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

      @parameterized.parameters(np.float32, np.float64)
      def test_besseli_larger(self, dtype):
        x = np.random.uniform(1.0, 20.0, size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
    
    
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 3 other locations - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 401..416
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 475..490
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 514..528

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 144.

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

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

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

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

    Refactorings

    Further Reading

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

      @parameterized.parameters(np.float32, np.float64)
      def test_besselj_small(self, dtype):
        x = np.random.uniform(-1.0, 1.0, size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
    
    
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 3 other locations - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 458..473
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 475..490
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 514..528

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 144.

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

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

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

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

    Refactorings

    Further Reading

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

      @parameterized.parameters(np.float32, np.float64)
      def test_besselj_larger(self, dtype):
        x = np.random.uniform(1.0, 30.0, size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
    
    
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 3 other locations - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 401..416
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 458..473
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 514..528

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 144.

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

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

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

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

    Refactorings

    Further Reading

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

      @test_util.run_in_graph_and_eager_modes
      def test_spence_boundary(self):
        self.assertAllClose(np.pi**2 / 6., special_math_ops.spence(0.))
        self.assertAllClose(0., special_math_ops.spence(1.))
        self.assertTrue(np.isnan(self.evaluate(special_math_ops.spence(np.nan))))
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 356..367

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

    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(np.float32, np.float64)
      def test_dawsn_small(self, dtype):
        x = np.random.uniform(-1., 1., size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
        y_wt = special_math_ops.dawsn(x_wt)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 270..282

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

    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(np.float32, np.float64)
      def test_spence_small(self, dtype):
        x = np.random.uniform(0., 1., size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
        y_wt = special_math_ops.spence(x_wt)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 54..66

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

    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(np.float32, np.float64)
      def test_fresnel_sin_larger(self, dtype):
        x = np.random.uniform(1., 100., size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
        try:
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 175..188

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

    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(np.float32, np.float64)
      def test_fresnel_cos_larger(self, dtype):
        x = np.random.uniform(1., 100., size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
        try:
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 232..245

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 126.

    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(np.float32, np.float64)
      def test_fresnel_cos_odd(self, dtype):
        x = _get_weak_tensor(
            np.random.uniform(-100.0, 100.0, size=int(1e4)).astype(dtype)
        )
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 42..52

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 124.

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

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

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

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

    Refactorings

    Further Reading

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

      @parameterized.parameters(np.float32, np.float64)
      def test_dawsn_odd(self, dtype):
        x = _get_weak_tensor(
            np.random.uniform(-100.0, 100.0, size=int(1e4)).astype(dtype)
        )
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 day to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 149..159

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 124.

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

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

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

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

    Refactorings

    Further Reading

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

      @parameterized.parameters(np.float32, np.float64)
      def test_spence_larger(self, dtype):
        x = np.random.uniform(1., 100., size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
        try:
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 7 hrs to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 120..131

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

    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(np.float32, np.float64)
      def test_expint_larger(self, dtype):
        x = np.random.uniform(1., 50., size=int(1e4)).astype(dtype)
        x_wt = _get_weak_tensor(x)
        try:
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 7 hrs to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 284..295

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

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

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

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

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

    Refactorings

    Further Reading

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

      @test_util.run_in_graph_and_eager_modes
      def test_expint_boundary(self):
        self.assertAllClose(-np.inf, special_math_ops.expint(0.))
        self.assertTrue(np.isnan(self.evaluate(special_math_ops.expint(np.nan))))
        # Check that the domain of definition is [0, inf)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 7 hrs to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 224..234

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

    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 test_besselj_gradient(self):
        inputs = [_get_weak_tensor(np.random.uniform(-50.0, 50.0, size=int(1e2)))]
        analytical, numerical = gradient_checker_v2.compute_gradient(
            special_math_ops.bessel_j0, inputs)
        self.assertLess(gradient_checker_v2.max_error(analytical, numerical), 1e-4)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 6 hrs to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 576..584

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 102.

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

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

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

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

    Refactorings

    Further Reading

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

      def test_bessely_gradient(self):
        inputs = [_get_weak_tensor(np.random.uniform(1.0, 50.0, size=int(1e2)))]
        analytical, numerical = gradient_checker_v2.compute_gradient(
            special_math_ops.bessel_y0, inputs)
        self.assertLess(gradient_checker_v2.max_error(analytical, numerical), 1e-4)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 6 hrs to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 548..556

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 102.

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

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

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

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

    Refactorings

    Further Reading

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

      @test_util.run_in_graph_and_eager_modes
      def test_besselj_boundary(self):
        self.assertAllClose(1., special_math_ops.bessel_j0(0.))
        self.assertAllClose(0., special_math_ops.bessel_j1(0.))
        self.assertTrue(np.isnan(self.evaluate(special_math_ops.bessel_j0(np.nan))))
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 6 hrs to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 417..422

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 100.

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

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

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

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

    Refactorings

    Further Reading

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

      def test_dawsn_gradient(self):
        inputs = [_get_weak_tensor(np.random.uniform(-50.0, 50.0, size=int(1e2)))]
        analytical, numerical = gradient_checker_v2.compute_gradient(
            special_math_ops.dawsn, inputs)
        self.assertLess(gradient_checker_v2.max_error(analytical, numerical), 1e-4)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 4 other locations - About 3 hrs to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 133..137
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 190..194
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 247..251
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 297..301

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 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 5 locations. Consider refactoring.
    Open

      def test_fresnel_sin_gradient(self):
        inputs = [_get_weak_tensor(np.random.uniform(1.0, 50.0, size=int(1e2)))]
        analytical, numerical = gradient_checker_v2.compute_gradient(
            special_math_ops.fresnel_sin, inputs)
        self.assertLess(gradient_checker_v2.max_error(analytical, numerical), 5e-3)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 4 other locations - About 3 hrs to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 82..86
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 133..137
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 190..194
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 297..301

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 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 5 locations. Consider refactoring.
    Open

      def test_expint_gradient(self):
        inputs = [_get_weak_tensor(np.random.uniform(1.0, 10.0, size=int(1e2)))]
        analytical, numerical = gradient_checker_v2.compute_gradient(
            special_math_ops.expint, inputs)
        self.assertLess(gradient_checker_v2.max_error(analytical, numerical), 5e-3)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 4 other locations - About 3 hrs to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 82..86
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 190..194
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 247..251
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 297..301

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 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 5 locations. Consider refactoring.
    Open

      def test_fresnel_cos_gradient(self):
        inputs = [_get_weak_tensor(np.random.uniform(1.0, 50.0, size=int(1e2)))]
        analytical, numerical = gradient_checker_v2.compute_gradient(
            special_math_ops.fresnel_cos, inputs)
        self.assertLess(gradient_checker_v2.max_error(analytical, numerical), 5e-3)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 4 other locations - About 3 hrs to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 82..86
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 133..137
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 247..251
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 297..301

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 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 5 locations. Consider refactoring.
    Open

      def test_spence_gradient(self):
        inputs = [_get_weak_tensor(np.random.uniform(1.0, 50.0, size=int(1e2)))]
        analytical, numerical = gradient_checker_v2.compute_gradient(
            special_math_ops.spence, inputs)
        self.assertLess(gradient_checker_v2.max_error(analytical, numerical), 1e-4)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 4 other locations - About 3 hrs to fix
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 82..86
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 133..137
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 190..194
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 247..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 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 test_spence_gradient_at_one(self):
        analytical, _ = gradient_checker_v2.compute_gradient(
            special_math_ops.spence, [1.])
        self.assertAllClose([[[-1.]]], analytical)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 1 other location - About 1 hr to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 395..398

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 41.

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

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

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

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

    Refactorings

    Further Reading

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

        self.assertAllClose(
            self.evaluate(special_math_ops.bessel_i0(x)),
            self.evaluate(special_math_ops.bessel_i0(-x)))
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 5 other locations - About 1 hr to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 440..442
    tensorflow/python/ops/special_math_ops_test.py on lines 444..446
    tensorflow/python/ops/special_math_ops_test.py on lines 448..450
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 354..356
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 358..360

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

        self.assertAllClose(
            self.evaluate(special_math_ops.bessel_j0(x)),
            self.evaluate(special_math_ops.bessel_j0(-x)))
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 5 other locations - About 1 hr to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 440..442
    tensorflow/python/ops/special_math_ops_test.py on lines 444..446
    tensorflow/python/ops/special_math_ops_test.py on lines 448..450
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 350..352
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 354..356

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

        self.assertAllClose(
            self.evaluate(special_math_ops.bessel_i0e(x)),
            self.evaluate(special_math_ops.bessel_i0e(-x)))
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 5 other locations - About 1 hr to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 440..442
    tensorflow/python/ops/special_math_ops_test.py on lines 444..446
    tensorflow/python/ops/special_math_ops_test.py on lines 448..450
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 350..352
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 358..360

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 38.

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

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

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

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

    Refactorings

    Further Reading

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

        x = np.random.uniform(np.finfo(dtype).eps, 1.0, size=int(1e4)).astype(dtype)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 3 other locations - About 50 mins to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 497..497
    tensorflow/python/ops/special_math_ops_test.py on lines 513..513
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 443..443

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 36.

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

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

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

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

    Refactorings

    Further Reading

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

        x = np.random.uniform(np.finfo(dtype).eps, 1.0, size=int(1e4)).astype(dtype)
    Severity: Major
    Found in tensorflow/python/ops/weak_tensor_special_math_ops_test.py and 3 other locations - About 50 mins to fix
    tensorflow/python/ops/special_math_ops_test.py on lines 497..497
    tensorflow/python/ops/special_math_ops_test.py on lines 513..513
    tensorflow/python/ops/weak_tensor_special_math_ops_test.py on lines 420..420

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 36.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status