tensorflow/tensorflow

View on GitHub
tensorflow/python/kernel_tests/control_flow/scan_ops_test.py

Summary

Maintainability
F
1 wk
Test Coverage

File scan_ops_test.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2016 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/kernel_tests/control_flow/scan_ops_test.py - About 2 hrs to fix

    Function handle_options has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def handle_options(func, x, axis, exclusive, reverse):
      """Adds tf options to numpy scan ops."""
      length = len(x.shape)
      if axis < 0:
        axis = length + axis
    Severity: Minor
    Found in tensorflow/python/kernel_tests/control_flow/scan_ops_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 handle_options has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def handle_options(func, x, axis, exclusive, reverse):
    Severity: Minor
    Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py - About 35 mins to fix

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

        def testNaN(self):
          for dtype in (
              np.float16,
              np.float32,
              np.float64,
      Severity: Minor
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

        def testNaN(self):
          for dtype in (np.float16, np.float32, np.float64):
            for nan_idx in range(0, 5):
              x = np.arange(1, 6).reshape([5]).astype(dtype)
              x[nan_idx] = np.nan
      Severity: Minor
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

        def testGradient2D(self):
          for axis in (-1, 0, 1):
            for exclusive in [True, False]:
              for reverse in [True, False]:
                self._compareGradient([5, 10], axis, exclusive, reverse)
      Severity: Minor
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

        def testGradient2D(self):
          for axis in (-2, -1, 0, 1):
            for exclusive in [True, False]:
              for reverse in [True, False]:
                self._compareGradient([2, 4], axis, exclusive, reverse)
      Severity: Minor
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

        def testInvalidAxis(self):
          x = np.arange(0, 10).reshape([2, 5]).astype(np.float32)
          input_tensor = ops.convert_to_tensor(x)
          with self.session():
            with self.assertRaisesWithPredicateMatch(
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 1 day to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 159..174

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

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

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

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

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

      Refactorings

      Further Reading

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

        def testInvalidAxis(self):
          x = np.arange(0, 10).reshape([2, 5]).astype(np.float32)
          input_tensor = ops.convert_to_tensor(x)
          with self.session():
            with self.assertRaisesWithPredicateMatch(
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 1 day to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 294..309

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

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

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

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

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

      Refactorings

      Further Reading

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

        def _compareGradient(self, shape, axis, exclusive, reverse):
          x = np.arange(1, 9).reshape(shape).astype(np.float64)
          with self.cached_session():
            t = ops.convert_to_tensor(x)
            result = math_ops.cumprod(t, axis, exclusive, reverse)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 176..183

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

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

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

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

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

      Refactorings

      Further Reading

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

        def _compareGradient(self, shape, axis, exclusive, reverse):
          x = np.arange(0, 50).reshape(shape).astype(np.float64)
          with self.cached_session():
            t = ops.convert_to_tensor(x)
            result = math_ops.cumsum(t, axis, exclusive, reverse)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 7 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 311..318

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

      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 testAxisType(self):
          for dtype in self.valid_dtypes:
            x = np.arange(1, 6).reshape([5]).astype(dtype)
            for axis_dtype in [dtypes.int64, dtypes.int32]:
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 248..255

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

      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 testAxisType(self):
          for dtype in self.valid_dtypes:
            x = np.arange(1, 6).reshape([5]).astype(dtype)
            for axis_dtype in [dtypes.int64, dtypes.int32]:
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 101..108

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

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def test6D(self):
          for dtype in self.valid_dtypes:
            x = np.arange(1, 145).reshape([2, 2, 3, 3, 2, 2]).astype(dtype)
            for axis in range(-6, 6, 3):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 287..292

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

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def test6D(self):
          for dtype in self.valid_dtypes:
            x = np.arange(1, 145).reshape([2, 2, 3, 3, 2, 2]).astype(dtype)
            for axis in range(-6, 6, 3):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 145..150

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

      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

          for dtype in (np.float16, np.float32, np.float64):
            for nan_idx in range(0, 5):
              x = np.arange(1, 6).reshape([5]).astype(dtype)
              x[nan_idx] = np.nan
              for axis in (-1, 0):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 112..122

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

      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

          for dtype in (
              np.float16,
              np.float32,
              np.float64,
              dtypes.bfloat16.as_numpy_dtype,
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 259..264

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

      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 test3D(self):
          for dtype in self.valid_dtypes:
            x = np.arange(1, 21).reshape([2, 2, 5]).astype(dtype)
            for axis in (-3, -2, -1, 0, 1, 2):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 138..143

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

      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 test3D(self):
          for dtype in self.valid_dtypes:
            x = np.arange(0, 20).reshape([2, 2, 5]).astype(dtype)
            for axis in (-3, -2, -1, 0, 1, 2):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 280..285

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

      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 test2D(self):
          for dtype in self.valid_dtypes:
            x = np.arange(1, 11).reshape([2, 5]).astype(dtype)
            for axis in (-2, -1, 0, 1):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 131..136

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

      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 test2D(self):
          for dtype in self.valid_dtypes:
            x = np.arange(0, 10).reshape([2, 5]).astype(dtype)
            for axis in (-2, -1, 0, 1):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 273..278

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

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def test1D(self):
          for dtype in self.valid_dtypes:
            x = np.arange(1, 6).reshape([5]).astype(dtype)
            for axis in (-1, 0):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 124..129

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

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def test1D(self):
          for dtype in self.valid_dtypes:
            x = np.arange(1, 6).reshape([5]).astype(dtype)
            for axis in (-1, 0):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 3 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 266..271

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

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testEmpty(self):
          for dtype in self.valid_dtypes:
            x = np.zeros([0]).astype(dtype)
            for axis in (-1, 0):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 241..246

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

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testEmpty(self):
          for dtype in self.valid_dtypes:
            x = np.zeros([0]).astype(dtype)
            for axis in (-1, 0):
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 94..99

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

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

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

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

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

      Refactorings

      Further Reading

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

        def _compareAll(self, x, axis):
          for exclusive in [True, False]:
            for reverse in [True, False]:
              self._compare(x, axis, exclusive, reverse)
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 236..239

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 38.

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

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

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

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

      Refactorings

      Further Reading

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

        def _compareAll(self, x, axis):
          for exclusive in [True, False]:
            for reverse in [True, False]:
              self._compare(x, axis, exclusive, reverse)
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 89..92

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 38.

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

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

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

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

      Refactorings

      Further Reading

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

          ix_init = [
              slice(0, -1) if i == axis else slice(None) for i in range(length)
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 50..50

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 38.

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

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

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

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

      Refactorings

      Further Reading

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

          ix_head = [slice(0, 1) if i == axis else slice(None) for i in range(length)]
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 51..52

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 38.

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

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

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

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

      Refactorings

      Further Reading

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

        @test_util.run_deprecated_v1
        def testGradientReverse(self):
          for axis in (-1, 0):
            self._compareGradient([8], axis, False, True)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 7 other locations - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 185..188
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 190..193
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 195..198
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 200..203
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 320..323
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 330..333
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 335..338

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

        @test_util.run_deprecated_v1
        def testGradientExclusive(self):
          for axis in (-1, 0):
            self._compareGradient([50], axis, True, False)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 7 other locations - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 185..188
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 190..193
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 200..203
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 320..323
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 325..328
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 330..333
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 335..338

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

        @test_util.run_deprecated_v1
        def testGradientReverse(self):
          for axis in (-1, 0):
            self._compareGradient([50], axis, False, True)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 7 other locations - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 185..188
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 195..198
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 200..203
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 320..323
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 325..328
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 330..333
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 335..338

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

        @test_util.run_deprecated_v1
        def testGradient(self):
          for axis in (-1, 0):
            self._compareGradient([8], axis, False, False)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 7 other locations - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 185..188
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 190..193
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 195..198
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 200..203
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 325..328
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 330..333
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 335..338

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

        @test_util.run_deprecated_v1
        def testGradientExclusiveReverse(self):
          for axis in (-1, 0):
            self._compareGradient([8], axis, True, True)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 7 other locations - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 185..188
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 190..193
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 195..198
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 200..203
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 320..323
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 325..328
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 330..333

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

        @test_util.run_deprecated_v1
        def testGradientExclusiveReverse(self):
          for axis in (-1, 0):
            self._compareGradient([50], axis, True, True)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 7 other locations - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 185..188
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 190..193
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 195..198
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 320..323
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 325..328
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 330..333
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 335..338

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

        @test_util.run_deprecated_v1
        def testGradient(self):
          for axis in (-1, 0):
            self._compareGradient([50], axis, False, False)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 7 other locations - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 190..193
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 195..198
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 200..203
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 320..323
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 325..328
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 330..333
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 335..338

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

        @test_util.run_deprecated_v1
        def testGradientExclusive(self):
          for axis in (-1, 0):
            self._compareGradient([8], axis, True, False)
      Severity: Major
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 7 other locations - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 185..188
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 190..193
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 195..198
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 200..203
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 320..323
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 325..328
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 335..338

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

          for axis in (-1, 0, 1):
            for exclusive in [True, False]:
              for reverse in [True, False]:
                self._compareGradient([5, 10], axis, exclusive, reverse)
      Severity: Minor
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 342..345

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

          for axis in (-2, -1, 0, 1):
            for exclusive in [True, False]:
              for reverse in [True, False]:
                self._compareGradient([2, 4], axis, exclusive, reverse)
      Severity: Minor
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 1 other location - About 35 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 207..210

      Duplicated Code

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

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

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

      Tuning

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

        valid_dtypes = [
            np.int32,
            np.int64,
            np.float16,
            np.float32,
      Severity: Minor
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 2 other locations - About 30 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 215..223
      tensorflow/python/kernel_tests/math_ops/matmul_op_test.py on lines 248..250

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

        valid_dtypes = [
            np.int32,
            np.int64,
            np.float16,
            np.float32,
      Severity: Minor
      Found in tensorflow/python/kernel_tests/control_flow/scan_ops_test.py and 2 other locations - About 30 mins to fix
      tensorflow/python/kernel_tests/control_flow/scan_ops_test.py on lines 71..79
      tensorflow/python/kernel_tests/math_ops/matmul_op_test.py on lines 248..250

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status