tensorflow/tensorflow

View on GitHub
tensorflow/python/checkpoint/sharding/sharding_policies_test.py

Summary

Maintainability
F
1 wk
Test Coverage

File sharding_policies_test.py has 605 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2023 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/checkpoint/sharding/sharding_policies_test.py - About 1 day to fix

    Function test_MaxShardSizePolicy_1D has 71 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def test_MaxShardSizePolicy_1D(self):
        root = module.Module()
        with ops.device("cpu:0"):
          v0 = resource_variable_ops.ResourceVariable([0.0, 1.0, 2.0, 3.0],
                                                      name="v0",
    Severity: Major
    Found in tensorflow/python/checkpoint/sharding/sharding_policies_test.py - About 2 hrs to fix

      Function test_MaxShardSizePolicy_2D has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def test_MaxShardSizePolicy_2D(self):
          root = module.Module()
          with ops.device("cpu:0"):
            v0 = resource_variable_ops.ResourceVariable([[0, 1],
                                                         [2, 3],
      Severity: Major
      Found in tensorflow/python/checkpoint/sharding/sharding_policies_test.py - About 2 hrs to fix

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

          def _get_shardable_tensors_by_task(self, root):
            serialized_tensors, _, _, _ = (
                checkpoint.TrackableSaver(graph_view.ObjectGraphView(root))
                ._gather_serialized_tensors(None))
        
        
        Severity: Minor
        Found in tensorflow/python/checkpoint/sharding/sharding_policies_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 test_MaxShardSizePolicy_PreSlicedTensor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def test_MaxShardSizePolicy_PreSlicedTensor(self):
            root = module.Module()
        
            sliced_v0_name = "sliced_v0/.ATTRIBUTES/VARIABLE_VALUE"
        
        
        Severity: Minor
        Found in tensorflow/python/checkpoint/sharding/sharding_policies_test.py - About 1 hr to fix

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

              self.assertAllEqual(
                  self.evaluate(shards[3][v1_name][slice_spec]),
                  [[[7.0]], [[9.0]], [[11.0]]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 519..521

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

              self.assertAllEqual(
                  self.evaluate(shards[2][v1_name][slice_spec]),
                  [[[6.0]], [[8.0]], [[10.0]]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 524..526

          Duplicated Code

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

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

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

          Tuning

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

              class V0SaveSliceInfo(variables.Variable.SaveSliceInfo):
                def __init__(self, var_offset, var_shape):
                  super().__init__(
                      full_name=v0_name,
                      full_shape=tensor_shape.TensorShape(dims=[3, 2]),
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 185..189
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 690..694

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 49.

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

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

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

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

          Refactorings

          Further Reading

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

              class V1SaveSliceInfo(variables.Variable.SaveSliceInfo):
                def __init__(self, var_offset, var_shape):
                  super().__init__(
                      full_name=v1_name,
                      full_shape=tensor_shape.TensorShape(dims=[4, 1]),
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 381..385
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 690..694

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 49.

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

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

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

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

          Refactorings

          Further Reading

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

              class V0SaveSliceInfo(variables.Variable.SaveSliceInfo):
                def __init__(self, var_offset, var_shape):
                  super().__init__(
                      full_name=sliced_v0_name,
                      full_shape=tensor_shape.TensorShape(dims=[2, 5]),
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 185..189
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 381..385

          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

              class V0SaveSliceInfo(variables.Variable.SaveSliceInfo):
                def __init__(self, var_offset, var_shape):
                  super().__init__(
                      full_name=v0_name,
                      full_shape=tensor_shape.TensorShape(dims=[4]),
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 578..582

          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

              class V0SaveSliceInfo(variables.Variable.SaveSliceInfo):
                def __init__(self, var_offset, var_shape):
                  super().__init__(
                      full_name=v0_name,
                      full_shape=tensor_shape.TensorShape(dims=[4]),
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 177..181

          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

              self.assertAllEqual(
                  self.evaluate(shards[1][v1_name][slice_spec]), [[4], [5], [6], [7]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 334..335

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

          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

              self.assertAllEqual(
                  self.evaluate(shards[1][v1_name][slice_spec]), [[4], [5], [6], [7]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 359..360

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

          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

              self.assertEqual(
                  [set(shard.keys()) for shard in shards],
                  [
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 409..417

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

          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

              self.assertEqual(
                  [set(shard.keys()) for shard in shards],
                  [
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 454..462

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

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertAllEqual(
                  self.evaluate(shards[1][v0_name][slice_spec]), [[1], [3], [5]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 510..511

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 44.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertAllEqual(
                  self.evaluate(shards[0][v0_name][slice_spec]), [[0], [2], [4]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 514..515

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 44.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertAllEqual(
                  self.evaluate(shards[4][v1_name][slice_spec]), [[[8.0], [9.0]]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 435..436
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 439..440
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 443..444
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 480..481
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 488..489
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 555..556

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

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

              self.assertAllEqual(
                  self.evaluate(shards[3][v1_name][slice_spec]), [[[6.0], [7.0]]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 439..440
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 443..444
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 480..481
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 484..485
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 488..489
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 555..556

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

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

              self.assertAllEqual(
                  self.evaluate(shards[1][v1_name][slice_spec]), [[[6.0], [7.0]]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 435..436
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 439..440
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 443..444
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 480..481
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 484..485
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 488..489

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 43.

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

              self.assertAllEqual(
                  self.evaluate(shards[4][v1_name][slice_spec]), [[[8.0], [9.0]]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 435..436
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 443..444
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 480..481
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 484..485
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 488..489
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 555..556

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

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

              self.assertAllEqual(
                  self.evaluate(shards[3][v1_name][slice_spec]), [[[6.0], [7.0]]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 435..436
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 439..440
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 443..444
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 484..485
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 488..489
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 555..556

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

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

              self.assertAllEqual(
                  self.evaluate(shards[5][v1_name][slice_spec]), [[[10.0], [11.0]]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 435..436
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 439..440
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 480..481
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 484..485
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 488..489
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 555..556

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

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

              self.assertAllEqual(
                  self.evaluate(shards[5][v1_name][slice_spec]), [[[10.0], [11.0]]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 435..436
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 439..440
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 443..444
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 480..481
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 484..485
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 555..556

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

          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.assertAllEqual(
                  self.evaluate(shards[0][v0_name][slice_spec]), [v_strings[0]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 611..612
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 615..616
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 619..620

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

              self.assertAllEqual(
                  self.evaluate(shards[3][v0_name][slice_spec]), [v_strings[3]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 607..608
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 611..612
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 615..616

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

              self.assertAllEqual(
                  self.evaluate(shards[2][v0_name][slice_spec]), [v_strings[2]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 607..608
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 611..612
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 619..620

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

              self.assertAllEqual(
                  self.evaluate(shards[1][v0_name][slice_spec]), [v_strings[1]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 607..608
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 615..616
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 619..620

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

              self.assertAllEqual(
                  self.evaluate(shards[2][v1_name][slice_spec]), [[4], [5]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 275..276
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 306..307
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 310..311
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 738..739

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 41.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertAllEqual(
                  self.evaluate(shards[3][v1_name][slice_spec]), [[6], [7]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 271..272
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 275..276
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 306..307
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 738..739

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 41.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertAllEqual(
                  self.evaluate(shards[0][sliced_v0_name][slice_spec]), [[1.0], [6.0]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 271..272
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 275..276
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 306..307
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 310..311

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 41.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertAllEqual(
                  self.evaluate(shards[3][v1_name][slice_spec]), [[6], [7]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 271..272
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 306..307
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 310..311
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 738..739

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 41.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertAllEqual(
                  self.evaluate(shards[2][v1_name][slice_spec]), [[4], [5]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 271..272
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 275..276
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 310..311
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 738..739

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 41.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertEqual(
                  [set(shard.keys()) for shard in shards],
                  [
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 251..257
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 499..505
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 597..603

          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

                v1 = resource_variable_ops.ResourceVariable([[[6.0], [7.0]],
                                                             [[8.0], [9.0]],
                                                             [[10.0], [11.0]]], name="v1")
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 663..665

          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

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

              self.assertEqual(
                  [set(shard.keys()) for shard in shards],
                  [
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 251..257
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 286..292
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 499..505

          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

                v1 = resource_variable_ops.ResourceVariable([[[6.0], [7.0]],
                                                             [[8.0], [9.0]],
                                                             [[10.0], [11.0]]], name="v1")
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 370..372

          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

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

              self.assertEqual(
                  [set(shard.keys()) for shard in shards],
                  [
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 251..257
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 286..292
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 597..603

          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

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

              self.assertEqual(
                  [set(shard.keys()) for shard in shards],
                  [
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 286..292
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 499..505
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 597..603

          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

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

              self.assertAllEqual(
                  self.evaluate(shards[1][sliced_v0_name][slice_spec]), [[6.0, 7.0, 8.0]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 766..767

          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

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

              self.assertAllEqual(
                  self.evaluate(shards[0][sliced_v0_name][slice_spec]), [[1.0, 2.0, 3.0]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 770..771

          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

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

              self.assertAllEqual(
                  self.evaluate(shards[1][v0_name][slice_spec]), [[2, 3]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 422..423
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 426..427
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 430..431
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 467..468
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 475..476
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 550..551
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 742..743
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 746..747

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

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

              self.assertAllEqual(
                  self.evaluate(shards[0][v0_name][slice_spec]), [[0, 1]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 422..423
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 426..427
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 430..431
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 471..472
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 475..476
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 550..551
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 742..743
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 746..747

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

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

              self.assertAllEqual(
                  self.evaluate(shards[2][v0_name][slice_spec]), [[4, 5]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 422..423
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 426..427
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 467..468
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 471..472
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 475..476
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 550..551
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 742..743
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 746..747

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

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

              self.assertAllEqual(
                  self.evaluate(shards[2][v0_name][slice_spec]), [[4, 5]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 422..423
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 426..427
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 430..431
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 467..468
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 471..472
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 550..551
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 742..743
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 746..747

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

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

              self.assertAllEqual(
                  self.evaluate(shards[2][sliced_v0_name][slice_spec]), [[7.0, 8.0]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 422..423
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 426..427
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 430..431
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 467..468
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 471..472
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 475..476
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 550..551
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 742..743

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

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

              self.assertAllEqual(
                  self.evaluate(shards[0][v0_name][slice_spec]), [[0, 1]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 426..427
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 430..431
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 467..468
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 471..472
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 475..476
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 550..551
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 742..743
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 746..747

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

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

              self.assertAllEqual(
                  self.evaluate(shards[1][sliced_v0_name][slice_spec]), [[2.0, 3.0]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 422..423
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 426..427
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 430..431
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 467..468
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 471..472
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 475..476
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 550..551
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 746..747

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

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

              self.assertAllEqual(
                  self.evaluate(shards[1][v0_name][slice_spec]), [[2, 3]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 422..423
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 430..431
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 467..468
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 471..472
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 475..476
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 550..551
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 742..743
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 746..747

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

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

              self.assertAllEqual(
                  self.evaluate(shards[1][v0_name][slice_spec]), [[4, 5]])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 422..423
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 426..427
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 430..431
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 467..468
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 471..472
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 475..476
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 742..743
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 746..747

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

          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

              self.assertAllEqual(
                  self.evaluate(shards[0][v0_name][slice_spec]), [0.0, 1.0, 2.0, 3.0])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 354..355

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

          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

              self.assertAllEqual(
                  self.evaluate(shards[0][v0_name][slice_spec]), [0.0, 1.0, 2.0, 3.0])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 329..330

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

          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

              self.assertEqual(
                  self.evaluate(shards[0]["v0/.ATTRIBUTES/VARIABLE_VALUE"][""]),
                  v0.numpy())
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 121..123
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 124..126

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

              self.assertEqual(
                  self.evaluate(shards[2]["v2/.ATTRIBUTES/VARIABLE_VALUE"][""]),
                  v2.numpy())
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 118..120
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 121..123

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

              self.assertEqual(
                  self.evaluate(shards[1]["v1/.ATTRIBUTES/VARIABLE_VALUE"][""]),
                  v1.numpy())
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 118..120
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 124..126

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

              self.assertAllEqual(
                  self.evaluate(shards[0][v0_name][slice_spec]), [0.0, 1.0])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 266..267
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 297..298
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 301..302

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

              self.assertAllEqual(
                  self.evaluate(shards[1][v0_name][slice_spec]), [2.0, 3.0])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 262..263
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 297..298
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 301..302

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

              self.assertAllEqual(
                  self.evaluate(shards[0][v0_name][slice_spec]), [0.0, 1.0])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 262..263
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 266..267
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 301..302

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 37.

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

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

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

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

          Refactorings

          Further Reading

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

              v_string = "".join(random.choices(
                  string.ascii_uppercase + string.digits, k=10)).encode("utf-8")
          Severity: Minor
          Found in tensorflow/python/checkpoint/sharding/sharding_policies_test.py and 1 other location - About 55 mins to fix
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 624..625

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

              self.assertAllEqual(
                  self.evaluate(shards[1][v0_name][slice_spec]), [2.0, 3.0])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 262..263
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 266..267
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 297..298

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 37.

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

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

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

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

          Refactorings

          Further Reading

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

              v_string = "".join(random.choices(
                  string.ascii_uppercase + string.digits, k=10)).encode("utf-8")
          Severity: Minor
          Found in tensorflow/python/checkpoint/sharding/sharding_policies_test.py and 1 other location - About 55 mins to fix
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 774..775

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

              self.assertEqual(self.evaluate(shards[5][v1_name][slice_spec]), [5])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 233..233
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 239..239
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 242..242

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 36.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertEqual(self.evaluate(shards[7][v1_name][slice_spec]), [7])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 233..233
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 236..236
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 239..239

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 36.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertEqual(self.evaluate(shards[6][v1_name][slice_spec]), [6])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 233..233
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 236..236
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 242..242

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 36.

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

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

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

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

          Refactorings

          Further Reading

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

              self.assertEqual(self.evaluate(shards[4][v1_name][slice_spec]), [4])
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 236..236
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 239..239
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 242..242

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 36.

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

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

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

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

          Refactorings

          Further Reading

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

              cluster_spec = server_lib.ClusterSpec({
                  "worker": [s.target[len("grpc://"):] for s in servers]})
          tensorflow/python/checkpoint/functional_saver_test.py on lines 151..152
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 88..89
          tensorflow/python/saved_model/save_test.py on lines 957..958

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

              cluster_spec = server_lib.ClusterSpec({
                  "worker": [s.target[len("grpc://"):] for s in servers]})
          tensorflow/python/checkpoint/functional_saver_test.py on lines 151..152
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 130..131
          tensorflow/python/saved_model/save_test.py on lines 957..958

          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

              self.assertEqual(self.evaluate(shards[2][v0_name][slice_spec]), 2.0)
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 220..220
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 223..223
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 229..229

          Duplicated Code

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

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

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

          Tuning

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

              self.assertEqual(self.evaluate(shards[0][v0_name][slice_spec]), 0.0)
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 223..223
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 226..226
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 229..229

          Duplicated Code

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

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

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

          Tuning

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

              self.assertEqual(self.evaluate(shards[3][v0_name][slice_spec]), 3.0)
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 220..220
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 223..223
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 226..226

          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

              self.assertEqual(self.evaluate(shards[1][v0_name][slice_spec]), 1.0)
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 220..220
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 226..226
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 229..229

          Duplicated Code

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

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

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

          Tuning

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

              self.assertEqual(
                  [set(shard.keys()) for shard in shards],
                  [
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
                      {"v1/.ATTRIBUTES/VARIABLE_VALUE", "_CHECKPOINTABLE_OBJECT_GRAPH",}
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 345..349
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 757..762

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

              self.assertEqual(
                  [set(shard.keys()) for shard in shards],
                  [
                      {"sliced_v0/.ATTRIBUTES/VARIABLE_VALUE",},
                      {"sliced_v0/.ATTRIBUTES/VARIABLE_VALUE",
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 320..324
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 345..349

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

              self.assertEqual(
                  [set(shard.keys()) for shard in shards],
                  [
                      {"v0/.ATTRIBUTES/VARIABLE_VALUE",},
                      {"v1/.ATTRIBUTES/VARIABLE_VALUE", "_CHECKPOINTABLE_OBJECT_GRAPH",}
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 320..324
          tensorflow/python/checkpoint/sharding/sharding_policies_test.py on lines 757..762

          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

          There are no issues that match your filters.

          Category
          Status