tensorflow/tensorflow

View on GitHub
tensorflow/python/ops/parallel_for/control_flow_ops_test.py

Summary

Maintainability
F
1 mo
Test Coverage

File control_flow_ops_test.py has 2120 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Function test_fused_batch_norm has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

      def test_fused_batch_norm(self):
        data_formats = ["NHWC"]
        if test.is_gpu_available():
          data_formats.append("NCHW")
        for is_training in (True, False):
    Severity: Minor
    Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py - About 3 hrs 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

    TensorListTest has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class TensorListTest(PForTestCase):
    
      def test_create_outside_and_write(self):
        handle1 = list_ops.tensor_list_reserve([], 2, dtypes.int32)
        handle2 = list_ops.tensor_list_reserve([], 2, dtypes.int32)
    Severity: Minor
    Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py - About 3 hrs to fix

      NNTest has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class NNTest(PForTestCase):
      
        def test_conv2d(self):
          x = random_ops.random_uniform([3, 2, 12, 12, 3])
          filt = random_ops.random_uniform([3, 3, 3, 7])
      Severity: Minor
      Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py - About 2 hrs to fix

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

          def test_max_pool_v2(self):
            with backprop.GradientTape(persistent=True) as g:
              x = random_ops.random_uniform([3, 2, 12, 12, 3])
              g.watch(x)
              ksize = [1, 3, 3, 1]
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 659..678

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

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

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

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

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

        Refactorings

        Further Reading

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

          def test_max_pool(self):
            with backprop.GradientTape(persistent=True) as g:
              x = random_ops.random_uniform([3, 2, 12, 12, 3])
              g.watch(x)
              ksize = [1, 3, 3, 1]
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 680..699

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

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

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

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

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

        Refactorings

        Further Reading

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

          def test_while(self):
            x = random_ops.random_uniform([3, 5])
            lengths = constant_op.constant([4, 0, 2])
        
            def loop_fn(i):
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py on lines 176..189

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 131.

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

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

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

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

        Refactorings

        Further Reading

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

          def test_random_poisson_v2_varying_rate(self):
            rates = math_ops.exp(random_ops.random_normal([5, 3, 2]))
        
            def loop_fn(i):
              rates_i = array_ops.gather(rates, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 870..881

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

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

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

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

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

        Refactorings

        Further Reading

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

          def test_random_gamma_varying_alpha(self):
            alphas = math_ops.exp(random_ops.random_normal([5, 3, 2]))
        
            def loop_fn(i):
              alphas_i = array_ops.gather(alphas, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 day to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 890..901

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 129.

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

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

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

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

        Refactorings

        Further Reading

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

          def test_create_outside_and_read_zero_loop_iters(self):
            handle = list_ops.tensor_list_reserve([], 2, dtypes.int32)
            handle = list_ops.tensor_list_set_item(handle, 0, 0)
            handle = list_ops.tensor_list_set_item(handle, 1, 1)
        
        
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 7 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1193..1205

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 116.

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

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

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

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

        Refactorings

        Further Reading

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

          def test_create_outside_and_read(self):
            handle = list_ops.tensor_list_reserve([], 2, dtypes.int32)
            handle = list_ops.tensor_list_set_item(handle, 0, 0)
            handle = list_ops.tensor_list_set_item(handle, 1, 1)
        
        
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 7 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1207..1221

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 116.

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

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

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

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

        Refactorings

        Further Reading

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

          def test_reduce_sum(self):
            x = random_ops.random_uniform([8, 3])
        
            def loop_fn(i, pfor_config):
              x_i = array_ops.gather(x, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 7 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 275..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 114.

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

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

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

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

        Refactorings

        Further Reading

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

          def test_reduce_mean(self):
            x = random_ops.random_uniform([8, 3])
        
            def loop_fn(i, pfor_config):
              x_i = array_ops.gather(x, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 7 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 287..297

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 114.

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

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

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

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

        Refactorings

        Further Reading

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

          def test_empty_branch(self):
            x = [1, 2, 3, 4, 5.]
            y = 6.
        
            @def_function.function
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2154..2166

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

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

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

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

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

        Refactorings

        Further Reading

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

          def test_loop_variant_cond(self):
            x = [1, 2, 3, 4, 5.]
            y = 2.5
        
            @def_function.function
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2183..2195

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

        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 loop_fn(i):
                x1 = array_ops.gather(x, i)
                y1 = array_ops.gather(y, i)
                outputs = [op(x, y), op(x1, y), op(x, y1), op(x1, y1), op(x1, x1)]
                del output_dtypes[:]
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 5 hrs to fix
        tensorflow/python/ops/parallel_for/math_test.py on lines 217..223

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

        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 run_and_assert_equal(self, targets1, targets2, rtol=1e-4, atol=1e-5):
            outputs = self._run_targets(targets1, targets2)
            n = len(outputs) // 2
            for i in range(n):
              self.assertAllEqual(outputs[i].shape, outputs[i + n].shape)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 927..931

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 82.

        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 run_and_assert_equal(self, targets1, targets2, rtol=1e-4, atol=1e-5):
            outputs = self._run_targets(targets1, targets2)
            n = len(outputs) // 2
            for i in range(n):
              self.assertAllEqual(outputs[i].shape, outputs[i + n].shape)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 829..833

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

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

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

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

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

        Refactorings

        Further Reading

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

          def test_softmax(self):
            logits = random_ops.random_uniform([3, 2, 4])
        
            def loop_fn(i):
              logits_i = array_ops.gather(logits, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 772..780

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

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

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

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

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

        Refactorings

        Further Reading

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

          def test_log_softmax(self):
            logits = random_ops.random_uniform([3, 2, 4])
        
            def loop_fn(i):
              logits_i = array_ops.gather(logits, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 782..790

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

        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_all_in_graph_and_eager_modes
          def test_variable_input(self):
            v = resource_variable_ops.ResourceVariable([1, 2])
            self.evaluate(v.initializer)
        
        
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 4 hrs to fix
        tensorflow/python/kernel_tests/control_flow/map_fn_test.py on lines 94..104

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

        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_v1_only("b/122612051")
          def test_while_unstacked_condition(self):
        
            def loop_fn(i):
              return while_loop.while_loop(lambda j, x: j < 4, lambda j, x:
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1981..1987

        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_v1_only("b/122612051")
          def test_invariant_while_with_control_dependency(self):
        
            def loop_fn(i):
              with ops.control_dependencies([i]):
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1953..1959

        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

          def test_while_unstacked_condition(self):
        
            def loop_fn(i):
              return while_loop.while_loop(lambda j, x: j < 4, lambda j, x:
                                           (j + 1, x + i), [0, 0])
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1713..1720

        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

          def test_invariant_while_with_control_dependency(self):
        
            def loop_fn(i):
              with ops.control_dependencies([i]):
                return while_loop.while_loop(lambda j: j < 4, lambda j: j + 1, [0])
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1694..1701

        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

            def loop_fn(_):
              _, output = while_loop.while_loop(lambda j, x: j < 4, lambda j, x:
                                                (j + 1, x + v), [0, 0.])
              return output
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py on lines 197..202

        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

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

            with backprop.GradientTape(persistent=True) as g:
              x = random_ops.random_uniform([3, 3, 2, 12, 12, 3])
              g.watch(x)
              ksize = [1, 1, 3, 3, 1]
              strides = [1, 1, 2, 2, 1]
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 643..647

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

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

            with backprop.GradientTape(persistent=True) as g:
              x = random_ops.random_uniform([5, 3, 7, 6, 6, 5])
              g.watch(x)
              ksize = [1, 2, 2, 2, 1]
              strides = [1, 2, 2, 2, 1]
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 702..706

        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

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

          def test_ensure_shape(self):
            x = random_ops.random_uniform([3, 6, 7])
        
            def loop_fn(i):
              x_i = array_ops.gather(x, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 3 hrs to fix
        tensorflow/python/ops/parallel_for/array_test.py on lines 220..227

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 62.

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

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

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

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

        Refactorings

        Further Reading

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

          def test_adjust_hue(self):
            images = random_ops.random_uniform([3, 2, 4, 4, 3])
        
            def loop_fn(i):
              image = array_ops.gather(images, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 402..409
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 420..427

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

        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

          def test_adjust_saturation(self):
            images = random_ops.random_uniform([3, 2, 4, 4, 3])
        
            def loop_fn(i):
              image = array_ops.gather(images, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 402..409
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 411..418

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

        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

          def test_adjust_contrast(self):
            images = random_ops.random_uniform([3, 2, 4, 4, 3])
        
            def loop_fn(i):
              image = array_ops.gather(images, i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 411..418
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 420..427

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

        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 loop_fn(i):
              z_i = array_ops.gather(z, i)
              with backprop.GradientTape() as g:
                g.watch(z_i)
                out = f(z_i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2723..2728

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 59.

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

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

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

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

        Refactorings

        Further Reading

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

            def loop_fn(i):
              z_i = array_ops.gather(z, i)
              with backprop.GradientTape() as g:
                g.watch(z_i)
                out = f(z_i)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2741..2746

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 59.

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

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

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

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

        Refactorings

        Further Reading

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

              _, out_handle = while_loop.while_loop(
                  lambda j, _: j < i, lambda j, h:
                  (j + 1, list_ops.tensor_list_set_item(h, j, i)), (0, handle))
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1429..1432
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1446..1449

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

              _, out_handle = while_loop.while_loop(
                  lambda j, _: j < i,
                  lambda j, h: (j + 1, list_ops.tensor_list_set_item(h, j, i)),
                  (0, handle))
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1429..1432
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1459..1461

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

              _, out_handle = while_loop.while_loop(
                  lambda j, _: j < i,
                  lambda j, h: (j + 1, list_ops.tensor_list_set_item(h, j, i)),
                  (0, handle))
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1446..1449
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1459..1461

        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

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

            def loop_fn(i):
              x_i = array_ops.gather(x, i)
              grad_i = array_ops.gather(grad, i)
              return nn.depthwise_conv2d_native_backprop_filter(
                  x_i,
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 501..508
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 519..526
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 553..560

        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

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

            def loop_fn(i):
              x_i = array_ops.gather(x, i)
              grad_i = array_ops.gather(grad, i)
              return nn.depthwise_conv2d_native_backprop_filter(
                  x_i,
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 501..508
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 553..560
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 573..580

        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

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

            def loop_fn(i):
              grad1 = array_ops.gather(grad, i)
              filt1 = array_ops.gather(filt, i)
              return nn.depthwise_conv2d_native_backprop_input(
                  x_shape,
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 519..526
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 553..560
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 573..580

        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

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

            def loop_fn(i):
              grad1 = array_ops.gather(grad, i)
              filt1 = array_ops.gather(filt, i)
              return nn.depthwise_conv2d_native_backprop_input(
                  x_shape,
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 3 other locations - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 501..508
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 519..526
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 573..580

        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

              _, out = while_loop.while_loop(
                  lambda i, _: i < 4, lambda i, out: (i + 1, math_ops.matmul(out, y)),
                  [0, x])
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1744..1746

        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

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

            _, out = while_loop.while_loop(
                lambda i, _: i < 4, lambda i, out: (i + 1, math_ops.matmul(out, y)),
                [0, x])
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2041..2043

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 55.

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

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

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

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

        Refactorings

        Further Reading

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

            def loop_fn(i):
              x1 = array_ops.gather(x, i)
              filt1 = array_ops.gather(filt, i)
              return nn.depthwise_conv2d_native(
                  x1, filt1, strides=[1, 2, 2, 1], padding="VALID", data_format="NHWC")
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 538..542

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 55.

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

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

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

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

        Refactorings

        Further Reading

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

            def loop_fn(i):
              x1 = array_ops.gather(x, i)
              filt1 = array_ops.gather(filt, i)
              return nn.depthwise_conv2d_native(
                  x1, filt1, strides=[1, 1, 2, 2], padding="VALID", data_format="NCHW")
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 488..492

        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

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

          def test_invariant_while(self):
        
            def loop_fn(_):
              return while_loop.while_loop(lambda j: j < 4, lambda j: j + 1, [0])
        
        
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1686..1692

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

        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_v1_only("b/122612051")
          def test_invariant_while(self):
        
            def loop_fn(_):
              return while_loop.while_loop(lambda j: j < 4, lambda j: j + 1, [0])
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1946..1951

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

        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

              return while_loop.while_loop(
                  lambda j, x: j < 4, lambda j, x:
                  (j + 1, x + random_ops.random_uniform([])), [0, 0.])[0]
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1964..1966

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

        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

              j, _ = while_loop.while_loop(
                  lambda j, x: j < 4, lambda j, x:
                  (j + 1, x + random_ops.random_uniform([])), [0, 0.])
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1707..1709

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

        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

              indices = [
                  [[0, 0], [1, 1], [2, 2], [3, 3], [4, 4]],
                  [[0, 4], [1, 3], [2, 2], [3, 1], [4, 0]],
        tensorflow/lite/testing/op_tests/pad.py on lines 34..36
        tensorflow/lite/testing/op_tests/padv2.py on lines 33..34

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

        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

            _, ta = while_loop.while_loop(
                lambda j, _: j < 4, body,
                (0, tensor_array_ops.TensorArray(dtypes.float32, size=4)))
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1775..1777

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

        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

              _, ta = while_loop.while_loop(
                  lambda j, _: j < 4, body,
                  (0, tensor_array_ops.TensorArray(dtypes.int32, size=4)))
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1810..1812

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

        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

            return ParticleSpec(
                mass=tensor_spec.TensorSpec(
                    dtype=self.mass.dtype,
                    shape=tensor_shape.TensorShape([batch_size]).concatenate(
                        self._pad_shape_to_full_rank(self.mass.shape))),
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2522..2530

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

        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_v1_only("b/122612051")
          def test_dynamic_lstm(self):
            pfor_outputs, tf_outputs = create_dynamic_lstm(rnn_cell.BasicLSTMCell, 3, 5,
                                                           7)
            self.run_and_assert_equal(pfor_outputs, tf_outputs)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2219..2223

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 41.

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

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

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

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

        Refactorings

        Further Reading

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

          @test_util.run_v1_only("b/122612051")
          def test_dynamic_rnn(self):
            pfor_outputs, tf_outputs = create_dynamic_lstm(rnn_cell.BasicRNNCell, 3, 5,
                                                           7)
            self.run_and_assert_equal(pfor_outputs, tf_outputs)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2225..2229

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 41.

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

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

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

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

        Refactorings

        Further Reading

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

            x = np.random.uniform(size=shape) + 1j * np.random.uniform(size=shape)
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 55 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2800..2800

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

        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

              x = np.random.uniform(size=shape) + 1j * np.random.uniform(size=shape)
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 55 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2763..2763

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

        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

            with session.Session() as sess:
              out, expected = sess.run([out, expected_output])
              self.assertAllClose(expected, out)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 55 mins to fix
        tensorflow/python/framework/importer_test.py on lines 1277..1279
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1119..1121

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

        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

            with session.Session() as sess:
              actual_grad, computed_grad = sess.run([t1, actual_grad])
              self.assertAllClose(actual_grad, computed_grad)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 55 mins to fix
        tensorflow/python/framework/importer_test.py on lines 1277..1279
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1762..1764

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

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

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

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

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

        Refactorings

        Further Reading

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

          def setUp(self):
            self._enabled = control_flow_v2_toggles.control_flow_v2_enabled()
            control_flow_v2_toggles.enable_control_flow_v2()
            super(WhileV2Test, self).setUp()
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 4 other locations - About 50 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 997..1000
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1667..1670
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2095..2098
        tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py on lines 145..148

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

          def setUp(self):
            self._enabled = control_flow_v2_toggles.control_flow_v2_enabled()
            control_flow_v2_toggles.enable_control_flow_v2()
            super(NestedControlFlowTest, self).setUp()
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 4 other locations - About 50 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 997..1000
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1667..1670
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1926..1929
        tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py on lines 145..148

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

          def setUp(self):
            self._enabled = control_flow_v2_toggles.control_flow_v2_enabled()
            control_flow_v2_toggles.disable_control_flow_v2()
            super(TensorArrayTest, self).setUp()
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 4 other locations - About 50 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1667..1670
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1926..1929
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2095..2098
        tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py on lines 145..148

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

          def setUp(self):
            self._enabled = control_flow_v2_toggles.control_flow_v2_enabled()
            control_flow_v2_toggles.disable_control_flow_v2()
            super(WhileV1Test, self).setUp()
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 4 other locations - About 50 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 997..1000
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1926..1929
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2095..2098
        tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py on lines 145..148

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

              indices = [[i], [i+1], [i+3], [i+2]]
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1509..1509

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

              indices = [[i], [i + 1], [i + 3], [i + 2]]
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 50 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1523..1523

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 36.

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

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

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

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

        Refactorings

        Further Reading

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

          def tearDown(self):
            if not self._enabled:
              control_flow_v2_toggles.disable_control_flow_v2()
            super(NestedControlFlowTest, self).tearDown()
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 45 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1931..1934
        tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py on lines 150..153

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 35.

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

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

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

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

        Refactorings

        Further Reading

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

          def tearDown(self):
            if not self._enabled:
              control_flow_v2_toggles.disable_control_flow_v2()
            super(WhileV2Test, self).tearDown()
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 45 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2100..2103
        tensorflow/python/ops/parallel_for/xla_control_flow_ops_test.py on lines 150..153

        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

            def loop_fn(_):
              return sparse_tensor.SparseTensor([[0], [1], [2]], [4, 5, 6],
                                                [3])  # [0, 2, 0]
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2371..2373

        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

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

            def loop_fn(_):
              return sparse_tensor.SparseTensor([[0], [1], [2]], [4, 5, 6],
                                                [3])  # [0, 2, 0]
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 2383..2385

        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

          def test_random_uniform(self):
        
            def loop_fn(_):
              return random_ops.random_uniform([3])
        
        
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 35 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 849..854
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 856..861

        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

          def test_truncated_normal(self):
        
            def loop_fn(_):
              return random_ops.truncated_normal([3])
        
        
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 35 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 835..840
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 849..854

        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

          def test_random_standard_normal(self):
        
            def loop_fn(_):
              return random_ops.random_normal([3])
        
        
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 2 other locations - About 35 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 835..840
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 856..861

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 33.

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

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

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

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

        Refactorings

        Further Reading

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

            ta = tensor_array_ops.TensorArray(
                dtypes.int32, 2, clear_after_read=False).write(0, 0).write(1, 1)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 3 other locations - About 30 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1010..1011
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1084..1085
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1097..1098

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 32.

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

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

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

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

        Refactorings

        Further Reading

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

            ta = tensor_array_ops.TensorArray(
                dtypes.int32, 2, clear_after_read=False).write(0, 0).write(1, 1)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 3 other locations - About 30 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1021..1022
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1084..1085
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1097..1098

        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

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

              ta1 = tensor_array_ops.TensorArray(
                  dtypes.int32, 2, clear_after_read=False).write(0, i).write(1, 1)
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1082..1083

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 32.

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

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

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

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

        Refactorings

        Further Reading

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

              ta2 = tensor_array_ops.TensorArray(
                  dtypes.int32, 2, clear_after_read=False).write(0, 1).write(1, 2)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 3 other locations - About 30 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1010..1011
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1021..1022
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1084..1085

        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

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

              ta1 = tensor_array_ops.TensorArray(
                  dtypes.int32, 2, clear_after_read=False).write(0, i).write(1, 1)
        Severity: Minor
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 1 other location - About 30 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1095..1096

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 32.

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

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

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

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

        Refactorings

        Further Reading

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

              ta2 = tensor_array_ops.TensorArray(
                  dtypes.int32, 2, clear_after_read=False).write(0, 1).write(1, 2)
        Severity: Major
        Found in tensorflow/python/ops/parallel_for/control_flow_ops_test.py and 3 other locations - About 30 mins to fix
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1010..1011
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1021..1022
        tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1097..1098

        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