tensorflow/tensorflow

View on GitHub
tensorflow/python/training/rmsprop_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File rmsprop_test.py has 411 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: Minor
Found in tensorflow/python/training/rmsprop_test.py - About 5 hrs to fix

    Function _sparse_rmsprop_update_numpy has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def _sparse_rmsprop_update_numpy(self, var, gindexs, gvalues, mg, rms, mom,
    Severity: Major
    Found in tensorflow/python/training/rmsprop_test.py - About 1 hr to fix

      Function _rmsprop_update_numpy has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def _rmsprop_update_numpy(self, var, g, mg, rms, mom, lr, decay, momentum,
      Severity: Major
      Found in tensorflow/python/training/rmsprop_test.py - About 1 hr to fix

        Function testDense has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def testDense(self):
            # TODO(yori): Use ParameterizedTest when available
            for (dtype, learning_rate, decay, momentum,
                 epsilon, centered, use_resource) in _TESTPARAMS:
              with test_util.use_gpu():
        Severity: Minor
        Found in tensorflow/python/training/rmsprop_test.py - About 55 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

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

          def testSparse(self):
            # TODO(yori): Use ParameterizedTest when available
            for (dtype, learning_rate, decay,
                 momentum, epsilon, centered, _) in _TESTPARAMS:
              with test_util.use_gpu():
        Severity: Minor
        Found in tensorflow/python/training/rmsprop_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

          @test_util.run_deprecated_v1
          def testMinimizeSparseResourceVariable(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              with self.cached_session():
                var0 = resource_variable_ops.ResourceVariable([[1.0, 2.0]], dtype=dtype)
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/rmsprop_test.py on lines 188..209

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

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

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

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

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

        Refactorings

        Further Reading

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

          @test_util.run_deprecated_v1
          def testMinimizeSparseResourceVariableCentered(self):
            for dtype in [dtypes.float32, dtypes.float64]:
              with self.cached_session():
                var0 = resource_variable_ops.ResourceVariable([[1.0, 2.0]], dtype=dtype)
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/rmsprop_test.py on lines 164..185

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

        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.assertAllCloseAccordingToType(
                    np.array([
                        3.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1.0)) -
                        (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 1e-5 + 1.0)),
                        4.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1.0)) -
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 3 other locations - About 1 day to fix
        tensorflow/python/training/rmsprop_test.py on lines 343..349
        tensorflow/python/training/rmsprop_test.py on lines 350..356
        tensorflow/python/training/rmsprop_test.py on lines 493..499

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

        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.assertAllCloseAccordingToType(
                    np.array([
                        3.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1.0)) -
                        (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 1e-5 + 1.0)),
                        4.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1.0)) -
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 3 other locations - About 1 day to fix
        tensorflow/python/training/rmsprop_test.py on lines 343..349
        tensorflow/python/training/rmsprop_test.py on lines 493..499
        tensorflow/python/training/rmsprop_test.py on lines 500..506

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

        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.assertAllCloseAccordingToType(
                    np.array([
                        1.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1.0)) -
                        (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001 + 1.0)),
                        2.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1.0)) -
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 3 other locations - About 1 day to fix
        tensorflow/python/training/rmsprop_test.py on lines 343..349
        tensorflow/python/training/rmsprop_test.py on lines 350..356
        tensorflow/python/training/rmsprop_test.py on lines 500..506

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

        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.assertAllCloseAccordingToType(
                    np.array([
                        1.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1.0)) -
                        (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001 + 1.0)),
                        2.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1.0)) -
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 3 other locations - About 1 day to fix
        tensorflow/python/training/rmsprop_test.py on lines 350..356
        tensorflow/python/training/rmsprop_test.py on lines 493..499
        tensorflow/python/training/rmsprop_test.py on lines 500..506

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

        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

                        1.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1e-5)) -
                        (0.5 * (0.1 * 2.0 / math.sqrt(0.901 + 1e-5)) +
                         (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001 + 1e-5))),
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 444..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 109.

        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

                        2.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1e-5)) -
                        (0.5 * (0.1 * 2.0 / math.sqrt(0.901 + 1e-5)) +
                         (0.1 * 2.0 / math.sqrt(0.901 * 0.9 + 0.001 + 1e-5)))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 441..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 109.

        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

                        3.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1e-5)) -
                        (0.5 * (0.01 * 2.0 / math.sqrt(0.90001 + 1e-5)) +
                         (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 2e-5))),
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 454..456

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 103.

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

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

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

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

        Refactorings

        Further Reading

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

                        4.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1e-5)) -
                        (0.5 * (0.01 * 2.0 / math.sqrt(0.90001 + 1e-5)) +
                         (0.01 * 2.0 / math.sqrt(0.90001 * 0.9 + 2e-5)))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 451..453

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 103.

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

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

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

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

        Refactorings

        Further Reading

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

                self.assertAllCloseAccordingToType(
                    np.array([
                        3.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1.0)),
                        4.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1.0))
                    ]), self.evaluate(var1))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 5 other locations - About 4 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 323..327
        tensorflow/python/training/rmsprop_test.py on lines 403..407
        tensorflow/python/training/rmsprop_test.py on lines 408..412
        tensorflow/python/training/rmsprop_test.py on lines 480..484
        tensorflow/python/training/rmsprop_test.py on lines 485..489

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

        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.assertAllCloseAccordingToType(
                    np.array([
                        3.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1.0)),
                        4.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1.0))
                    ]), self.evaluate(var1))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 5 other locations - About 4 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 323..327
        tensorflow/python/training/rmsprop_test.py on lines 328..332
        tensorflow/python/training/rmsprop_test.py on lines 403..407
        tensorflow/python/training/rmsprop_test.py on lines 408..412
        tensorflow/python/training/rmsprop_test.py on lines 480..484

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

        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.assertAllCloseAccordingToType(
                    np.array([
                        1.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1.0)),
                        2.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1.0))
                    ]), self.evaluate(var0))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 5 other locations - About 4 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 328..332
        tensorflow/python/training/rmsprop_test.py on lines 403..407
        tensorflow/python/training/rmsprop_test.py on lines 408..412
        tensorflow/python/training/rmsprop_test.py on lines 480..484
        tensorflow/python/training/rmsprop_test.py on lines 485..489

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

        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.assertAllCloseAccordingToType(
                    np.array([
                        3.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1e-5)),
                        4.0 - (0.01 * 2.0 / math.sqrt(0.90001 + 1e-5))
                    ]), self.evaluate(var1))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 5 other locations - About 4 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 323..327
        tensorflow/python/training/rmsprop_test.py on lines 328..332
        tensorflow/python/training/rmsprop_test.py on lines 403..407
        tensorflow/python/training/rmsprop_test.py on lines 480..484
        tensorflow/python/training/rmsprop_test.py on lines 485..489

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

        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.assertAllCloseAccordingToType(
                    np.array([
                        1.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1.0)),
                        2.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1.0))
                    ]), self.evaluate(var0))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 5 other locations - About 4 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 323..327
        tensorflow/python/training/rmsprop_test.py on lines 328..332
        tensorflow/python/training/rmsprop_test.py on lines 403..407
        tensorflow/python/training/rmsprop_test.py on lines 408..412
        tensorflow/python/training/rmsprop_test.py on lines 485..489

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

        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.assertAllCloseAccordingToType(
                    np.array([
                        1.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1e-5)),
                        2.0 - (0.1 * 2.0 / math.sqrt(0.901 + 1e-5))
                    ]), self.evaluate(var0))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 5 other locations - About 4 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 323..327
        tensorflow/python/training/rmsprop_test.py on lines 328..332
        tensorflow/python/training/rmsprop_test.py on lines 408..412
        tensorflow/python/training/rmsprop_test.py on lines 480..484
        tensorflow/python/training/rmsprop_test.py on lines 485..489

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

        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.assertAllCloseAccordingToType(
                    np.array([(0.1 * 2.0 / math.sqrt(0.901 + 1e-5)),
                              (0.1 * 2.0 / math.sqrt(0.901 + 1e-5))]),
                    self.evaluate(mom0))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 397..400

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 73.

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

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

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

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

        Refactorings

        Further Reading

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

                self.assertAllCloseAccordingToType(
                    np.array([(0.01 * 2.0 / math.sqrt(0.90001 + 1e-5)),
                              (0.01 * 2.0 / math.sqrt(0.90001 + 1e-5))]),
                    self.evaluate(mom1))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/training/rmsprop_test.py on lines 393..396

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 73.

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

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

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

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

        Refactorings

        Further Reading

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

                self.assertAllCloseAccordingToType(
                    np.array([0.901 * 0.9 + 0.001, 0.901 * 0.9 + 0.001]),
                    self.evaluate(rms0))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 9 other locations - About 1 hr to fix
        tensorflow/python/training/momentum_test.py on lines 103..105
        tensorflow/python/training/momentum_test.py on lines 106..108
        tensorflow/python/training/momentum_test.py on lines 327..329
        tensorflow/python/training/momentum_test.py on lines 330..332
        tensorflow/python/training/momentum_test.py on lines 579..581
        tensorflow/python/training/momentum_test.py on lines 582..584
        tensorflow/python/training/rmsprop_test.py on lines 339..341
        tensorflow/python/training/rmsprop_test.py on lines 417..419
        tensorflow/python/training/rmsprop_test.py on lines 420..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 49.

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

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

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

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

        Refactorings

        Further Reading

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

                self.assertAllCloseAccordingToType(
                    np.array([0.90001 * 0.9 + 1e-5, 0.90001 * 0.9 + 1e-5]),
                    self.evaluate(rms1))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 9 other locations - About 1 hr to fix
        tensorflow/python/training/momentum_test.py on lines 103..105
        tensorflow/python/training/momentum_test.py on lines 106..108
        tensorflow/python/training/momentum_test.py on lines 327..329
        tensorflow/python/training/momentum_test.py on lines 330..332
        tensorflow/python/training/momentum_test.py on lines 579..581
        tensorflow/python/training/momentum_test.py on lines 582..584
        tensorflow/python/training/rmsprop_test.py on lines 336..338
        tensorflow/python/training/rmsprop_test.py on lines 339..341
        tensorflow/python/training/rmsprop_test.py on lines 417..419

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 49.

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

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

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

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

        Refactorings

        Further Reading

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

                self.assertAllCloseAccordingToType(
                    np.array([0.90001 * 0.9 + 1e-5, 0.90001 * 0.9 + 1e-5]),
                    self.evaluate(rms1))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 9 other locations - About 1 hr to fix
        tensorflow/python/training/momentum_test.py on lines 103..105
        tensorflow/python/training/momentum_test.py on lines 106..108
        tensorflow/python/training/momentum_test.py on lines 327..329
        tensorflow/python/training/momentum_test.py on lines 330..332
        tensorflow/python/training/momentum_test.py on lines 579..581
        tensorflow/python/training/momentum_test.py on lines 582..584
        tensorflow/python/training/rmsprop_test.py on lines 336..338
        tensorflow/python/training/rmsprop_test.py on lines 417..419
        tensorflow/python/training/rmsprop_test.py on lines 420..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 49.

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

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

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

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

        Refactorings

        Further Reading

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

                self.assertAllCloseAccordingToType(
                    np.array([0.901 * 0.9 + 0.001, 0.901 * 0.9 + 0.001]),
                    self.evaluate(rms0))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 9 other locations - About 1 hr to fix
        tensorflow/python/training/momentum_test.py on lines 103..105
        tensorflow/python/training/momentum_test.py on lines 106..108
        tensorflow/python/training/momentum_test.py on lines 327..329
        tensorflow/python/training/momentum_test.py on lines 330..332
        tensorflow/python/training/momentum_test.py on lines 579..581
        tensorflow/python/training/momentum_test.py on lines 582..584
        tensorflow/python/training/rmsprop_test.py on lines 336..338
        tensorflow/python/training/rmsprop_test.py on lines 339..341
        tensorflow/python/training/rmsprop_test.py on lines 420..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 49.

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

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

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

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

        Refactorings

        Further Reading

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

                if use_resource:
                  var0 = resource_variable_ops.ResourceVariable(var0_np)
                  var1 = resource_variable_ops.ResourceVariable(var1_np)
                else:
                  var0 = variables.Variable(var0_np)
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/adam_test.py on lines 66..71

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 49.

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

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

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

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

        Refactorings

        Further Reading

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

                  if centered:
                    self.assertAllCloseAccordingToType(mg0_np, self.evaluate(mg0))
                    self.assertAllCloseAccordingToType(mg1_np, self.evaluate(mg1))
        Severity: Minor
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/training/rmsprop_test.py on lines 154..156

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

                  if centered:
                    self.assertAllCloseAccordingToType(mg0_np, self.evaluate(mg0))
                    self.assertAllCloseAccordingToType(mg1_np, self.evaluate(mg1))
        Severity: Minor
        Found in tensorflow/python/training/rmsprop_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/training/rmsprop_test.py on lines 279..281

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

                grads0 = indexed_slices.IndexedSlices(
                    constant_op.constant(grads0_np),
                    constant_op.constant(grads0_np_indices), constant_op.constant([1]))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 3 other locations - About 35 mins to fix
        tensorflow/python/training/adam_test.py on lines 73..75
        tensorflow/python/training/adam_test.py on lines 77..79
        tensorflow/python/training/rmsprop_test.py on lines 231..233

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 33.

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

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

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

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

        Refactorings

        Further Reading

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

                grads1 = indexed_slices.IndexedSlices(
                    constant_op.constant(grads1_np),
                    constant_op.constant(grads1_np_indices), constant_op.constant([1]))
        Severity: Major
        Found in tensorflow/python/training/rmsprop_test.py and 3 other locations - About 35 mins to fix
        tensorflow/python/training/adam_test.py on lines 73..75
        tensorflow/python/training/adam_test.py on lines 77..79
        tensorflow/python/training/rmsprop_test.py on lines 227..229

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 33.

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

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

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

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

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status