tensorflow/tensorflow

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

Summary

Maintainability
F
1 wk
Test Coverage

File momentum_test.py has 481 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/momentum_test.py - About 7 hrs to fix

    Function doTestBasic has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      def doTestBasic(self, use_resource=False, use_callable_params=False):
        for i, dtype in enumerate([dtypes.half, dtypes.float32, dtypes.float64]):
          if use_resource:
            var0 = resource_variable_ops.ResourceVariable([1.0, 2.0],
                                                          dtype=dtype,
    Severity: Minor
    Found in tensorflow/python/training/momentum_test.py - About 1 hr 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 _update_nesterov_momentum_numpy has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def _update_nesterov_momentum_numpy(self, var, accum, g, lr, momentum):
    Severity: Minor
    Found in tensorflow/python/training/momentum_test.py - About 35 mins to fix

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

          with ops.Graph().as_default():
            var2 = resource_variable_ops.ResourceVariable([1.0, 2.0],
                                                          dtype=dtypes.float32,
                                                          name="var2")
            var3 = resource_variable_ops.ResourceVariable([3.0, 4.0],
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 1 other location - About 1 day to fix
      tensorflow/python/training/momentum_test.py on lines 135..147

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 143.

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

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

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

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

      Refactorings

      Further Reading

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

          with ops.Graph().as_default():
            var0 = resource_variable_ops.ResourceVariable([1.0, 2.0],
                                                          dtype=dtypes.float32,
                                                          name="var0")
            var1 = resource_variable_ops.ResourceVariable([3.0, 4.0],
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 1 other location - About 1 day to fix
      tensorflow/python/training/momentum_test.py on lines 149..161

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

      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

              self.assertAllCloseAccordingToType(
                  np.array([
                      1.0 - (0.1 * 2.0) - ((0.9 * 0.1 + 0.1) * 2.0),
                      2.0 - (0.1 * 2.0) - ((0.9 * 0.1 + 0.1) * 2.0)
                  ]), self.evaluate(var0))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 3 other locations - About 5 hrs to fix
      tensorflow/python/training/momentum_test.py on lines 110..114
      tensorflow/python/training/momentum_test.py on lines 586..590
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 272..277

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

      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

            self.assertAllCloseAccordingToType(
                np.array([
                    1.0 - (0.1 * 2.0) - ((0.9 * 0.1 + 0.1) * 2.0),
                    2.0 - (0.1 * 2.0) - ((0.9 * 0.1 + 0.1) * 2.0)
                ]), self.evaluate(var0))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 3 other locations - About 5 hrs to fix
      tensorflow/python/training/momentum_test.py on lines 334..338
      tensorflow/python/training/momentum_test.py on lines 586..590
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 272..277

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

      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

              self.assertAllCloseAccordingToType(
                  np.array([
                      1.0 - (0.1 * 2.0) - ((0.9 * 0.1 + 0.1) * 2.0),
                      2.0 - (0.1 * 2.0) - ((0.9 * 0.1 + 0.1) * 2.0)
                  ]), self.evaluate(var0))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 3 other locations - About 5 hrs to fix
      tensorflow/python/training/momentum_test.py on lines 110..114
      tensorflow/python/training/momentum_test.py on lines 334..338
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 272..277

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

      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

              self.assertAllCloseAccordingToType(
                  np.array([
                      2.98 - ((0.9 * 0.01 + 0.01) * 2.0),
                      3.98 - ((0.9 * 0.01 + 0.01) * 2.0)
                  ]), self.evaluate(var1))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 3 other locations - About 3 hrs to fix
      tensorflow/python/training/momentum_test.py on lines 115..119
      tensorflow/python/training/momentum_test.py on lines 591..595
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 279..284

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 73.

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

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

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

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

      Refactorings

      Further Reading

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

              self.assertAllCloseAccordingToType(
                  np.array([
                      2.98 - ((0.9 * 0.01 + 0.01) * 2.0),
                      3.98 - ((0.9 * 0.01 + 0.01) * 2.0)
                  ]), self.evaluate(var1))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 3 other locations - About 3 hrs to fix
      tensorflow/python/training/momentum_test.py on lines 115..119
      tensorflow/python/training/momentum_test.py on lines 339..343
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 279..284

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 73.

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

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

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

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

      Refactorings

      Further Reading

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

            self.assertAllCloseAccordingToType(
                np.array([
                    2.98 - ((0.9 * 0.01 + 0.01) * 2.0),
                    3.98 - ((0.9 * 0.01 + 0.01) * 2.0)
                ]), self.evaluate(var1))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 3 other locations - About 3 hrs to fix
      tensorflow/python/training/momentum_test.py on lines 339..343
      tensorflow/python/training/momentum_test.py on lines 591..595
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 279..284

      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.9 * 0.01 + 0.01), (0.9 * 0.01 + 0.01)]),
                  self.evaluate(slot1)[2])
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/training/momentum_test.py on lines 515..517

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 55.

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

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

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

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

      Refactorings

      Further Reading

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

              self.assertAllCloseAccordingToType(
                  np.array([(0.9 * 0.1 + 0.1), (0.9 * 0.1 + 0.1)]),
                  self.evaluate(slot0)[1])
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/training/momentum_test.py on lines 518..520

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 55.

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

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

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

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

      Refactorings

      Further Reading

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

              self.assertAllCloseAccordingToType(
                  np.array([(0.9 * 0.01 + 0.01), (0.9 * 0.01 + 0.01)]),
                  self.evaluate(slot1))
      Severity: Major
      Found in tensorflow/python/training/momentum_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/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
      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.9 * 0.1 + 0.1), (0.9 * 0.1 + 0.1)]),
                  self.evaluate(slot0))
      Severity: Major
      Found in tensorflow/python/training/momentum_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 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
      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.9 * 0.1 + 0.1), (0.9 * 0.1 + 0.1)]),
                self.evaluate(slot0))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 9 other locations - About 1 hr to fix
      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
      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.9 * 0.01 + 0.01), (0.9 * 0.01 + 0.01)]),
                  self.evaluate(slot1))
      Severity: Major
      Found in tensorflow/python/training/momentum_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 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
      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.9 * 0.1 + 0.1), (0.9 * 0.1 + 0.1)]),
                  self.evaluate(slot0))
      Severity: Major
      Found in tensorflow/python/training/momentum_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 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
      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.9 * 0.01 + 0.01), (0.9 * 0.01 + 0.01)]),
                self.evaluate(slot1))
      Severity: Major
      Found in tensorflow/python/training/momentum_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 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
      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 8 locations. Consider refactoring.
      Open

            self.assertAllCloseAccordingToType(
                np.array([1.0 - (0.1 * 2.0), 2.0 - (0.1 * 2.0)]), self.evaluate(var0))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 7 other locations - About 1 hr to fix
      tensorflow/python/training/momentum_test.py on lines 94..96
      tensorflow/python/training/momentum_test.py on lines 318..320
      tensorflow/python/training/momentum_test.py on lines 321..323
      tensorflow/python/training/momentum_test.py on lines 570..572
      tensorflow/python/training/momentum_test.py on lines 573..575
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 249..250
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 252..254

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

              self.assertAllCloseAccordingToType(
                  np.array([3.0 - (0.01 * 2.0), 4.0 - (0.01 * 2.0)]),
                  self.evaluate(var1))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 7 other locations - About 1 hr to fix
      tensorflow/python/training/momentum_test.py on lines 92..93
      tensorflow/python/training/momentum_test.py on lines 94..96
      tensorflow/python/training/momentum_test.py on lines 318..320
      tensorflow/python/training/momentum_test.py on lines 570..572
      tensorflow/python/training/momentum_test.py on lines 573..575
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 249..250
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 252..254

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

              self.assertAllCloseAccordingToType(
                  np.array([3.0 - (0.01 * 2.0), 4.0 - (0.01 * 2.0)]),
                  self.evaluate(var1))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 7 other locations - About 1 hr to fix
      tensorflow/python/training/momentum_test.py on lines 92..93
      tensorflow/python/training/momentum_test.py on lines 94..96
      tensorflow/python/training/momentum_test.py on lines 318..320
      tensorflow/python/training/momentum_test.py on lines 321..323
      tensorflow/python/training/momentum_test.py on lines 570..572
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 249..250
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 252..254

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

              self.assertAllCloseAccordingToType(
                  np.array([1.0 - (0.1 * 2.0), 2.0 - (0.1 * 2.0)]),
                  self.evaluate(var0))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 7 other locations - About 1 hr to fix
      tensorflow/python/training/momentum_test.py on lines 92..93
      tensorflow/python/training/momentum_test.py on lines 94..96
      tensorflow/python/training/momentum_test.py on lines 321..323
      tensorflow/python/training/momentum_test.py on lines 570..572
      tensorflow/python/training/momentum_test.py on lines 573..575
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 249..250
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 252..254

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

            self.assertAllCloseAccordingToType(
                np.array([3.0 - (0.01 * 2.0), 4.0 - (0.01 * 2.0)]),
                self.evaluate(var1))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 7 other locations - About 1 hr to fix
      tensorflow/python/training/momentum_test.py on lines 92..93
      tensorflow/python/training/momentum_test.py on lines 318..320
      tensorflow/python/training/momentum_test.py on lines 321..323
      tensorflow/python/training/momentum_test.py on lines 570..572
      tensorflow/python/training/momentum_test.py on lines 573..575
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 249..250
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 252..254

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

              self.assertAllCloseAccordingToType(
                  np.array([1.0 - (0.1 * 2.0), 2.0 - (0.1 * 2.0)]),
                  self.evaluate(var0))
      Severity: Major
      Found in tensorflow/python/training/momentum_test.py and 7 other locations - About 1 hr to fix
      tensorflow/python/training/momentum_test.py on lines 92..93
      tensorflow/python/training/momentum_test.py on lines 94..96
      tensorflow/python/training/momentum_test.py on lines 318..320
      tensorflow/python/training/momentum_test.py on lines 321..323
      tensorflow/python/training/momentum_test.py on lines 573..575
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 249..250
      tensorflow/tools/ci_build/osx/arm64/tensorflow_metal_plugin_test.py on lines 252..254

      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

                      -(0.1 * 2.0) - ((0.9 * 0.1 + 0.1) * 2.0),
      Severity: Minor
      Found in tensorflow/python/training/momentum_test.py and 1 other location - About 45 mins to fix
      tensorflow/python/training/momentum_test.py on lines 526..526

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 35.

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

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

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

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

      Refactorings

      Further Reading

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

                      -(0.1 * 2.0) - ((0.9 * 0.1 + 0.1) * 2.0)
      Severity: Minor
      Found in tensorflow/python/training/momentum_test.py and 1 other location - About 45 mins to fix
      tensorflow/python/training/momentum_test.py on lines 525..525

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 35.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status