tensorflow/tensorflow

View on GitHub
tensorflow/python/distribute/cross_device_ops_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File cross_device_ops_test.py has 1116 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/distribute/cross_device_ops_test.py - About 2 days to fix

    Function testNcclOrdering has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

      def testNcclOrdering(self, num_processes, required_gpus):
    
        if num_processes != required_gpus:
          self.skipTest("Skip NCCL combination with mismatched process and GPU "
                        "count. NCCL requires physical GPUs for every process.")
    Severity: Minor
    Found in tensorflow/python/distribute/cross_device_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

    Function testAllReduceDense has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

      def testAllReduceDense(self, num_processes, required_gpus, implementation,
                             reduce_op):
        if (required_gpus == 0 and
            implementation == CommunicationImplementation.NCCL):
          self.skipTest("Skip CPU + NCCL combination")
    Severity: Minor
    Found in tensorflow/python/distribute/cross_device_ops_test.py - About 2 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

    Function testAllReduceSparse has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

      def testAllReduceSparse(self, num_processes, required_gpus, implementation,
                              reduce_op):
        if (required_gpus == 0 and
            implementation == CommunicationImplementation.NCCL):
          self.skipTest("Skip CPU + NCCL combination")
    Severity: Minor
    Found in tensorflow/python/distribute/cross_device_ops_test.py - About 2 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

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

    class CollectiveOpsTest(test.TestCase, parameterized.TestCase):
    
      def setUp(self):
        super().setUp()
        # Enabling collectives can be done in "setUpClass", but requires using
    Severity: Minor
    Found in tensorflow/python/distribute/cross_device_ops_test.py - About 2 hrs to fix

      Function batch_reduce_and_verify has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

        def batch_reduce_and_verify(self, inputs, expect, options):
          """Batch reduce the given `inputs` and verify the output matches `expect`.
      
          Args:
            inputs: a 2-level nested list of `Tensor` or `IndexedSlices`, where i-th
      Severity: Minor
      Found in tensorflow/python/distribute/cross_device_ops_test.py - About 2 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

      Function testReduceDense has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def testReduceDense(self, num_processes, required_gpus, implementation,
                            reduce_op, prefer_unique_instance_key):
          if (required_gpus == 0 and
              implementation == CommunicationImplementation.NCCL):
            self.skipTest("Skip CPU + NCCL combination")
      Severity: Minor
      Found in tensorflow/python/distribute/cross_device_ops_test.py - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function testBatchReduceDense has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def testBatchReduceDense(self, num_processes, required_gpus, implementation,
                                 reduce_op, prefer_unique_instance_key):
          if (required_gpus == 0 and
              implementation == CommunicationImplementation.NCCL):
            self.skipTest("Skip CPU + NCCL combination")
      Severity: Minor
      Found in tensorflow/python/distribute/cross_device_ops_test.py - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function testAllGatherSameShape has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        def testAllGatherSameShape(self, num_processes, required_gpus, implementation,
                                   func_mode, axis, prefer_unique_instance_key):
      
          if (required_gpus == 0 and
              implementation == CommunicationImplementation.NCCL):
      Severity: Minor
      Found in tensorflow/python/distribute/cross_device_ops_test.py - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function testMultiThreadedCollectiveLaunchNoInterleave has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        def testMultiThreadedCollectiveLaunchNoInterleave(self, num_processes,
                                                          required_gpus,
                                                          implementation,
                                                          prefer_unique_instance_key):
      
      
      Severity: Minor
      Found in tensorflow/python/distribute/cross_device_ops_test.py - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function testReduceSparse has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        def testReduceSparse(self, num_processes, required_gpus, implementation,
                             reduce_op, prefer_unique_instance_key):
          if (required_gpus == 0 and
              implementation == CommunicationImplementation.NCCL):
            self.skipTest("Skip CPU + NCCL combination")
      Severity: Minor
      Found in tensorflow/python/distribute/cross_device_ops_test.py - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function testBatchReduceSparse has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

        def testBatchReduceSparse(self, num_processes, required_gpus, implementation,
                                  reduce_op, prefer_unique_instance_key):
          if (required_gpus == 0 and
              implementation == CommunicationImplementation.NCCL):
            self.skipTest("Skip CPU + NCCL combination")
      Severity: Minor
      Found in tensorflow/python/distribute/cross_device_ops_test.py - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function testTimeoutBatchReduceDense has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def testTimeoutBatchReduceDense(self, num_processes, implementation,
                                        required_gpus, prefer_unique_instance_key):
          if (required_gpus == 0 and
              implementation == CommunicationImplementation.NCCL):
            self.skipTest("Skip CPU + NCCL combination")
      Severity: Minor
      Found in tensorflow/python/distribute/cross_device_ops_test.py - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function testAllGatherSameShape has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def testAllGatherSameShape(self, num_processes, required_gpus, implementation,
      Severity: Minor
      Found in tensorflow/python/distribute/cross_device_ops_test.py - About 45 mins to fix

        Function testTimeoutBatchReduceSparse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def testTimeoutBatchReduceSparse(self, num_processes, required_gpus,
                                           implementation, prefer_unique_instance_key):
            if (required_gpus == 0 and
                implementation == CommunicationImplementation.NCCL):
              self.skipTest("Skip CPU + NCCL combination")
        Severity: Minor
        Found in tensorflow/python/distribute/cross_device_ops_test.py - About 45 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function make_per_replica_value has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def make_per_replica_value(value, devices):
          """Creates a `PerReplica` object whose values reside in `devices`.
        
          Args:
            value: a tensor-convertible value or a `IndexedSlicesValue`, or a callable
        Severity: Minor
        Found in tensorflow/python/distribute/cross_device_ops_test.py - About 45 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function testTimeoutReduceDense has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def testTimeoutReduceDense(self, num_processes, implementation, required_gpus,
                                     prefer_unique_instance_key):
        
            if (required_gpus == 0 and
                implementation == CommunicationImplementation.NCCL):
        Severity: Minor
        Found in tensorflow/python/distribute/cross_device_ops_test.py - About 45 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function testTimeoutReduceSparse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def testTimeoutReduceSparse(self, num_processes, implementation,
                                      required_gpus, prefer_unique_instance_key):
            if (required_gpus == 0 and
                implementation == CommunicationImplementation.NCCL):
              self.skipTest("Skip CPU + NCCL combination")
        Severity: Minor
        Found in tensorflow/python/distribute/cross_device_ops_test.py - About 45 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function testBatchReduceSparse has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def testBatchReduceSparse(self, num_processes, required_gpus, implementation,
        Severity: Minor
        Found in tensorflow/python/distribute/cross_device_ops_test.py - About 35 mins to fix

          Function testReduceSparse has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def testReduceSparse(self, num_processes, required_gpus, implementation,
          Severity: Minor
          Found in tensorflow/python/distribute/cross_device_ops_test.py - About 35 mins to fix

            Function testReduceDense has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def testReduceDense(self, num_processes, required_gpus, implementation,
            Severity: Minor
            Found in tensorflow/python/distribute/cross_device_ops_test.py - About 35 mins to fix

              Function testBatchReduceDense has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def testBatchReduceDense(self, num_processes, required_gpus, implementation,
              Severity: Minor
              Found in tensorflow/python/distribute/cross_device_ops_test.py - About 35 mins to fix

                Function reduce_and_verify has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  def reduce_and_verify(self, inputs, expect, options):
                    """Reduce the given `inputs` and verify the output matches `expect`.
                
                    Args:
                      inputs: a list of `Tensor` or `IndexedSlices`, where i-th value will be
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py - About 35 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                  def testAllReduceMixedDenseAndSparse(self, num_processes, required_gpus,
                                                       implementation, reduce_op):
                
                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                        [
                            3.0, 4.0,
                            IndexedSlicesValue(
                                values=[[5.], [6.]], indices=[1, 2], dense_shape=[10, 1]),
                            IndexedSlicesValue(
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 602..607

                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

                        [
                            1.0, 2.0,
                            IndexedSlicesValue(
                                values=[[1.], [2.]], indices=[0, 1], dense_shape=[10, 1]),
                            IndexedSlicesValue(
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 609..614

                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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=[1, 2],
                          required_gpus=[0, 1, 2],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 455..465

                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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=[1, 2],
                          required_gpus=[0, 1, 2],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 323..333

                Duplicated Code

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

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

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

                Tuning

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

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

                    ], [
                        IndexedSlicesValue(
                            values=[[9.], [10.]], indices=[3, 4], dense_shape=[10, 1]),
                        IndexedSlicesValue(
                            values=[[11.], [12.]], indices=[3, 4], dense_shape=[5, 1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 539..543
                tensorflow/python/distribute/cross_device_ops_test.py on lines 544..548
                tensorflow/python/distribute/cross_device_ops_test.py on lines 554..558
                tensorflow/python/distribute/cross_device_ops_test.py on lines 563..567

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

                    ], [
                        IndexedSlicesValue(
                            values=[[5.], [6.]], indices=[1, 2], dense_shape=[10, 1]),
                        IndexedSlicesValue(
                            values=[[7.], [8.]], indices=[0, 1], dense_shape=[5, 1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 539..543
                tensorflow/python/distribute/cross_device_ops_test.py on lines 549..553
                tensorflow/python/distribute/cross_device_ops_test.py on lines 554..558
                tensorflow/python/distribute/cross_device_ops_test.py on lines 563..567

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

                      expect = [
                          IndexedSlices(
                              values=[[1.], [2.]], indices=[0, 1], dense_shape=[10, 1]),
                          IndexedSlices(
                              values=[[3.], [4.]], indices=[1, 2], dense_shape=[5, 1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 539..543
                tensorflow/python/distribute/cross_device_ops_test.py on lines 544..548
                tensorflow/python/distribute/cross_device_ops_test.py on lines 549..553
                tensorflow/python/distribute/cross_device_ops_test.py on lines 554..558

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

                    ], [
                        IndexedSlicesValue(
                            values=[[13.], [14.]], indices=[8, 9], dense_shape=[10, 1]),
                        IndexedSlicesValue(
                            values=[[15.], [16.]], indices=[3, 4], dense_shape=[5, 1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 539..543
                tensorflow/python/distribute/cross_device_ops_test.py on lines 544..548
                tensorflow/python/distribute/cross_device_ops_test.py on lines 549..553
                tensorflow/python/distribute/cross_device_ops_test.py on lines 563..567

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

                    inputs_data = ([
                        IndexedSlicesValue(
                            values=[[1.], [2.]], indices=[0, 1], dense_shape=[10, 1]),
                        IndexedSlicesValue(
                            values=[[3.], [4.]], indices=[1, 2], dense_shape=[5, 1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 4 other locations - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 544..548
                tensorflow/python/distribute/cross_device_ops_test.py on lines 549..553
                tensorflow/python/distribute/cross_device_ops_test.py on lines 554..558
                tensorflow/python/distribute/cross_device_ops_test.py on lines 563..567

                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

                      def delayed_all_reduce(input_tensor, *args, **kwargs):
                        for idx, v in enumerate(sequence):
                          if input_tensor is v:
                            time.sleep(idx)
                            break
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 2 hrs to fix
                tensorflow/python/distribute/v1/cross_device_ops_test.py on lines 827..832

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

                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

                          IndexedSlices(
                              values=[[3.], [4.], [7.], [8.], [11.], [12.], [15.], [16.]],
                              indices=[1, 2, 0, 1, 3, 4, 3, 4],
                              dense_shape=[5, 2])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 2 other locations - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 426..429
                tensorflow/python/distribute/cross_device_ops_test.py on lines 582..585

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

                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

                          IndexedSlices(
                              values=[[1.], [2.], [5.], [6.], [9.], [10.], [13.], [14.]],
                              indices=[0, 1, 1, 2, 3, 4, 8, 9],
                              dense_shape=[10, 1]),
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 2 other locations - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 426..429
                tensorflow/python/distribute/cross_device_ops_test.py on lines 586..589

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

                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

                      expect = IndexedSlices(
                          values=[[1.], [2.], [3.], [4.], [5.], [6.], [7.], [8.]],
                          indices=[0, 1, 1, 2, 7, 8, 3, 2],
                          dense_shape=[10, 1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 2 other locations - About 2 hrs to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 582..585
                tensorflow/python/distribute/cross_device_ops_test.py on lines 586..589

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

                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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=[1, 2],
                          required_gpus=[0, 1, 2],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 502..513

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 49.

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

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

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

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

                Refactorings

                Further Reading

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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=[1, 2],
                          required_gpus=[0, 1, 2],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 369..380

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 49.

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

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

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

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

                Refactorings

                Further Reading

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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=[1, 2],
                          required_gpus=[0, 1, 2],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 632..641

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

                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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=[1, 2],
                          required_gpus=[0, 1, 2],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 700..709

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

                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

                      sequence = [v0.values[0], v1.values[0], v1.values[1], v0.values[1]]
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/v1/cross_device_ops_test.py on lines 824..824

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

                @_REGISTER_DECORATOR(CollectiveOpsTest)
                def _save_test_case(pickler, obj):
                  def reconstruct(*args, **kwargs):
                    del args, kwargs
                    return CollectiveOpsTest()
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 2 other locations - About 1 hr to fix
                tensorflow/python/distribute/failure_handling/gce_failure_handler_test.py on lines 539..545
                tensorflow/python/distribute/multi_worker_continuous_run_test.py on lines 144..150

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 40.

                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

                    options = self.RunOptions(
                        mode=["func_graph"],  # Sparse reduce is not supported in eager.
                        num_processes=num_processes,
                        gpus_per_process=required_gpus,
                        reduce_op=reduce_op,
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 529..534

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 38.

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

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

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

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

                Refactorings

                Further Reading

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

                    options = self.RunOptions(
                        mode=["func_graph"],  # Sparse reduce is not supported in eager.
                        num_processes=num_processes,
                        gpus_per_process=required_gpus,
                        reduce_op=reduce_op,
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 395..400

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 38.

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

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

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

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

                Refactorings

                Further Reading

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

                    elif group_size == 2:
                      expect = IndexedSlices(
                          values=[[1.], [2.], [3.], [4.]],
                          indices=[0, 1, 1, 2],
                          dense_shape=[10, 1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 442..445

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 38.

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

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

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

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

                Refactorings

                Further Reading

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

                    expect = IndexedSlices(
                        values=[[1.], [2.], [3.], [4.]],
                        indices=[0, 0, 1, 2],
                        dense_shape=[10, 1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 1 hr to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 420..424

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 38.

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

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

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

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

                Refactorings

                Further Reading

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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=2,
                          required_gpus=[0, 1],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 55 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1049..1057
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1097..1105
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1194..1202

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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=2,
                          required_gpus=[0, 1],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 55 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1097..1105
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1145..1153
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1194..1202

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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=2,
                          required_gpus=[0, 1],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 55 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1049..1057
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1145..1153
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1194..1202

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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=2,
                          required_gpus=[0, 1],
                          implementation=[
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 55 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1049..1057
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1097..1105
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1145..1153

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

                      if "func_graph" in options.mode:
                        got = def_function.function(batch_reduce_fn)()
                        self.assertAllClose(got, per_replica_expect)
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 45 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 266..268

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

                      if "func_graph" in options.mode:
                        got = def_function.function(reduce_fn)()
                        self.assertAllClose(got, per_replica_expect)
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 45 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 317..319

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

                                     IndexedSlices(
                                         array_ops.identity([[3.]]), array_ops.identity([2]),
                                         array_ops.identity([5, 1])), array_ops.identity(2.0))
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 40 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 760..762
                tensorflow/python/distribute/cross_device_ops_test.py on lines 763..765
                tensorflow/python/distribute/cross_device_ops_test.py on lines 810..812

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

                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

                            value = (IndexedSlices(
                                array_ops.identity([[1.]]), array_ops.identity([0]),
                                array_ops.identity([5, 1])),
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 40 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 763..765
                tensorflow/python/distribute/cross_device_ops_test.py on lines 810..812
                tensorflow/python/distribute/cross_device_ops_test.py on lines 813..815

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

                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

                                     IndexedSlices(
                                         array_ops.identity([[3.]]), array_ops.identity([2]),
                                         array_ops.identity([5, 1])))
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 40 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 760..762
                tensorflow/python/distribute/cross_device_ops_test.py on lines 810..812
                tensorflow/python/distribute/cross_device_ops_test.py on lines 813..815

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

                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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=1,
                          required_gpus=2,
                          implementation=[
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 40 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 923..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 34.

                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

                  @combinations.generate(
                      combinations.combine(
                          num_processes=1,
                          required_gpus=2,
                          implementation=[
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 40 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 996..1004

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

                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

                            value = (IndexedSlices(
                                array_ops.identity([[1.]]), array_ops.identity([0]),
                                array_ops.identity([5, 1])), array_ops.identity(1.0),
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 40 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 760..762
                tensorflow/python/distribute/cross_device_ops_test.py on lines 763..765
                tensorflow/python/distribute/cross_device_ops_test.py on lines 813..815

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

                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

                    options = self.RunOptions(
                        num_processes=num_processes,
                        gpus_per_process=required_gpus,
                        reduce_op=reduce_op,
                        communication_options=collective_util.Options(
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 35 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 348..352

                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

                    options = self.RunOptions(
                        num_processes=num_processes,
                        gpus_per_process=required_gpus,
                        reduce_op=reduce_op,
                        communication_options=collective_util.Options(
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 35 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 481..485

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 33.

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

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

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

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

                Refactorings

                Further Reading

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

                        while i < 3:
                          collective.reduce(reduce_util.ReduceOp.SUM, v_dense, v_dense, options)
                          i += 1
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 35 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1306..1309

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 33.

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

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

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

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

                Refactorings

                Further Reading

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

                        while i < 3:
                          collective.reduce(reduce_util.ReduceOp.SUM, v_sparse, v_sparse,
                                            options)
                          i += 1
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 35 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1301..1303

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 713..715
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (required_gpus == 0 and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip CPU + NCCL combination")
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 10 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 336..338
                tensorflow/python/distribute/cross_device_ops_test.py on lines 383..385
                tensorflow/python/distribute/cross_device_ops_test.py on lines 468..470
                tensorflow/python/distribute/cross_device_ops_test.py on lines 516..518
                tensorflow/python/distribute/cross_device_ops_test.py on lines 645..647
                tensorflow/python/distribute/cross_device_ops_test.py on lines 846..848
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1061..1063
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1108..1110
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1156..1158
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1205..1207

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.AUTO):
                      self.skipTest("Skip potential NCCL combination (AUTO) with mismatched "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1159..1161
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

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

                    if (num_processes != required_gpus and
                        implementation == CommunicationImplementation.NCCL):
                      self.skipTest("Skip NCCL combination with mismatched process and GPU "
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 26 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 339..341
                tensorflow/python/distribute/cross_device_ops_test.py on lines 343..345
                tensorflow/python/distribute/cross_device_ops_test.py on lines 386..388
                tensorflow/python/distribute/cross_device_ops_test.py on lines 390..392
                tensorflow/python/distribute/cross_device_ops_test.py on lines 471..473
                tensorflow/python/distribute/cross_device_ops_test.py on lines 475..477
                tensorflow/python/distribute/cross_device_ops_test.py on lines 519..521
                tensorflow/python/distribute/cross_device_ops_test.py on lines 523..525
                tensorflow/python/distribute/cross_device_ops_test.py on lines 648..650
                tensorflow/python/distribute/cross_device_ops_test.py on lines 652..654
                tensorflow/python/distribute/cross_device_ops_test.py on lines 716..718
                tensorflow/python/distribute/cross_device_ops_test.py on lines 720..722
                tensorflow/python/distribute/cross_device_ops_test.py on lines 793..795
                tensorflow/python/distribute/cross_device_ops_test.py on lines 849..851
                tensorflow/python/distribute/cross_device_ops_test.py on lines 853..855
                tensorflow/python/distribute/cross_device_ops_test.py on lines 937..939
                tensorflow/python/distribute/cross_device_ops_test.py on lines 941..943
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1008..1010
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1012..1014
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1064..1066
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1068..1070
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1111..1113
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1115..1117
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1163..1165
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1208..1210
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1212..1214

                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

                        self.assertEqual(reduced[1].values[0].device, devices[0])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1035..1035
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1036..1036
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1038..1038

                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

                      v = make_per_replica_value(
                          IndexedSlicesValue(
                              values=[[4., 6.]], indices=[1], dense_shape=[5, 2]), devices)
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1177..1179

                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

                        self.assertEqual(reduced[0].values[1].device, devices[1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1035..1035
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1037..1037
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1038..1038

                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

                        self.assertEqual(reduced[1].values[1].device, devices[1])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1035..1035
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1036..1036
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1037..1037

                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

                      v = make_per_replica_value(
                          IndexedSlicesValue(
                              values=[[4., 6.]], indices=[1], dense_shape=[5, 2]), devices)
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1226..1228

                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

                        self.assertEqual(reduced[0].values[0].device, devices[0])
                Severity: Major
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 3 other locations - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1036..1036
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1037..1037
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1038..1038

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

                      @def_function.function
                      def batch_reduce_sparse():
                        return collective.batch_reduce(reduce_util.ReduceOp.SUM,
                                                       [(v, v), (v, v)], options)
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1133..1136

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

                      @def_function.function
                      def batch_reduce_dense():
                        return collective.batch_reduce(reduce_util.ReduceOp.SUM,
                                                       [(v, v), (v, v)], options)
                Severity: Minor
                Found in tensorflow/python/distribute/cross_device_ops_test.py and 1 other location - About 30 mins to fix
                tensorflow/python/distribute/cross_device_ops_test.py on lines 1232..1235

                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