tensorflow/tensorflow

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

Summary

Maintainability
F
1 mo
Test Coverage

File saver_test.py has 2450 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    SaverTest has 33 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SaverTest(test.TestCase):
    
      def basicSaveRestore(self, variable_op):
        save_path = os.path.join(self.get_temp_dir(), "basic_save_restore")
    
    
    Severity: Minor
    Found in tensorflow/python/training/saver_test.py - About 4 hrs to fix

      MetaGraphTest has 26 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class MetaGraphTest(test.TestCase):
      
        def _get_test_dir(self, dirname):
          test_dir = os.path.join(self.get_temp_dir(), dirname)
          gfile.MakeDirs(test_dir)
      Severity: Minor
      Found in tensorflow/python/training/saver_test.py - About 3 hrs to fix

        Function _testPartitionedVariables has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          def _testPartitionedVariables(self, use_resource):
            var_full_shape = [10, 3]
            # Allows save/restore mechanism to work w/ different slicings.
            var_name = "my_var"
            saved_dir = self._get_test_dir("partitioned_variables")
        Severity: Minor
        Found in tensorflow/python/training/saver_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 testSharded has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def testSharded(self):
            save_dir = self._get_test_dir("max_to_keep_sharded")
        
            with session.Session(
                target="",
        Severity: Minor
        Found in tensorflow/python/training/saver_test.py - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

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

          def testSaveWithGlobalStep(self, pad_step_number=False):
            save_path = os.path.join(self.get_temp_dir(), "ckpt_with_global_step")
            global_step_int = 5
            # Save and reload one Variable named "var0".
            self._SaveAndLoad("var0", 0.0, 1.0, save_path)
        Severity: Minor
        Found in tensorflow/python/training/saver_test.py - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

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

          def testBasics(self):
            save_path = os.path.join(self.get_temp_dir(), "sharded_basics")
        
            # Build a graph with 2 parameter nodes on different devices.
            with session.Session(
        Severity: Minor
        Found in tensorflow/python/training/saver_test.py - About 35 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

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

          def testIteratorsUnshardedRestore(self):
            save_path = os.path.join(self.get_temp_dir(), "restore_unsharded_iterators")
        
            # Build a graph with 2 parameter nodes on different devices and save.
            with session.Session(
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 5 days to fix
        tensorflow/python/training/saver_test.py on lines 1180..1243

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 569.

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

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

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

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

        Refactorings

        Further Reading

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

          def testIterators(self):
            save_path = os.path.join(self.get_temp_dir(), "sharded_iterators")
        
            # Build a graph with 2 parameter nodes on different devices and save.
            with session.Session(
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 5 days to fix
        tensorflow/python/training/saver_test.py on lines 1245..1308

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 569.

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

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

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

            with ops_lib.Graph().as_default():
              image = array_ops.placeholder(dtypes.float32, [None, 784], name="image")
              label = array_ops.placeholder(dtypes.float32, [None, 10], name="label")
              with session.Session() as sess:
                weights = variable_v1.VariableV1(
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 2 days to fix
        tensorflow/python/training/saver_test.py on lines 2544..2559

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 220.

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

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

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

            with ops_lib.Graph().as_default():
              image = array_ops.placeholder(dtypes.float32, [None, 784], name="image")
              label = array_ops.placeholder(dtypes.float32, [None, 10], name="label")
              with session.Session() as sess:
                weights = variable_v1.VariableV1(
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 2 days to fix
        tensorflow/python/training/saver_test.py on lines 2471..2486

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 220.

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

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

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

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

        Refactorings

        Further Reading

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

              with ops_lib.name_scope("hidden2"):
                weights2 = variable_v1.VariableV1(
                    random_ops.truncated_normal([128, 32],
                                                stddev=1.0 / math.sqrt(float(128))),
                    name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 2180..2201
        tensorflow/python/training/saver_test.py on lines 2853..2874

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 171.

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

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

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

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

        Refactorings

        Further Reading

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

            with ops_lib.name_scope("hidden2"):
              weights = variable_v1.VariableV1(
                  random_ops.truncated_normal([128, 32],
                                              stddev=1.0 / math.sqrt(float(128))),
                  name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 2780..2801
        tensorflow/python/training/saver_test.py on lines 2853..2874

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 171.

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

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

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

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

        Refactorings

        Further Reading

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

              with ops_lib.name_scope("hidden2"):
                weights = variable_v1.VariableV1(
                    random_ops.truncated_normal([128, 32],
                                                stddev=1.0 / math.sqrt(float(128))),
                    name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 2 other locations - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 2180..2201
        tensorflow/python/training/saver_test.py on lines 2780..2801

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 171.

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

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

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

              with ops_lib.device("/job:ps/replica:0/task:0/device:GPU:0"):
                image = array_ops.placeholder(dtypes.float32, [None, 784], name="image")
                label = array_ops.placeholder(dtypes.float32, [None, 10], name="label")
                weights = variable_v1.VariableV1(
                    random_ops.random_uniform([784, 10]), name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 2577..2587

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 169.

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

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

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

              with ops_lib.device("/job:ps/replica:0/task:0/device:GPU:0"):
                image = array_ops.placeholder(dtypes.float32, [None, 784], name="image")
                label = array_ops.placeholder(dtypes.float32, [None, 10], name="label")
                weights = variable_v1.VariableV1(
                    random_ops.random_uniform([784, 10]), name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 2610..2620

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 169.

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

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

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

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

        Refactorings

        Further Reading

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

            with ops_lib.Graph().as_default(), self.cached_session():
              real_num = variable_v1.VariableV1(1.0, dtype=dtypes.float32, name="real")
              imag_num = variable_v1.VariableV1(2.0, dtype=dtypes.float32, name="imag")
              math_ops.complex(real_num, imag_num, name="complex")
        
        
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 2452..2464

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 149.

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

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

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

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

        Refactorings

        Further Reading

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

            with ops_lib.Graph().as_default(), self.session():
              real_num = variable_v1.VariableV1(1.0, dtype=dtypes.float32, name="real")
              imag_num = variable_v1.VariableV1(2.0, dtype=dtypes.float32, name="imag")
              math_ops.complex(real_num, imag_num, name="complex")
        
        
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 2435..2447

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 149.

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

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

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

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

        Refactorings

        Further Reading

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

              with ops_lib.name_scope("hidden1"):
                weights1 = variable_v1.VariableV1(
                    random_ops.truncated_normal([28, 128],
                                                stddev=1.0 / math.sqrt(float(28))),
                    name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 2164..2178

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 136.

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

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

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

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

        Refactorings

        Further Reading

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

            with ops_lib.name_scope("hidden1"):
              weights = variable_v1.VariableV1(
                  random_ops.truncated_normal([28, 128],
                                              stddev=1.0 / math.sqrt(float(28))),
                  name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 2763..2777

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 136.

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

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

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

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

        Refactorings

        Further Reading

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

            with graph1.as_default():
              var_dict1 = meta_graph.copy_scoped_meta_graph(
                  from_scope="hidden1",
                  to_scope="new_hidden1",
                  from_graph=graph,
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 3042..3055

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 125.

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

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

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

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

        Refactorings

        Further Reading

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

            with graph2.as_default():
              var_dict2 = meta_graph.copy_scoped_meta_graph(
                  from_scope="hidden2",
                  to_scope="new_hidden2",
                  from_graph=graph,
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 day to fix
        tensorflow/python/training/saver_test.py on lines 3026..3039

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 125.

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

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

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

            with graph1.as_default():
              with ops_lib.name_scope("hidden1"):
                images = constant_op.constant(
                    1.0, dtypes.float32, shape=[3, 2], name="images")
                weights1 = variable_v1.VariableV1([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/training/saver_test.py on lines 2972..2978

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 109.

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

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

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

              with ops_lib.name_scope("hidden1"):
                images = constant_op.constant(
                    1.0, dtypes.float32, shape=[3, 2], name="images")
                weights1 = variable_v1.VariableV1([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]],
                                                  name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 6 hrs to fix
        tensorflow/python/training/saver_test.py on lines 2914..2921

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 109.

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

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

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

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

        Refactorings

        Further Reading

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

              with ops_lib.name_scope("softmax_linear"):
                weights = variable_v1.VariableV1(
                    random_ops.truncated_normal([32, 10],
                                                stddev=1.0 / math.sqrt(float(32))),
                    name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 2 other locations - About 6 hrs to fix
        tensorflow/python/framework/meta_graph_test.py on lines 386..393
        tensorflow/python/training/saver_test.py on lines 2203..2210

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 105.

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

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

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

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

        Refactorings

        Further Reading

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

            with ops_lib.name_scope("softmax_linear"):
              weights = variable_v1.VariableV1(
                  random_ops.truncated_normal([32, 10],
                                              stddev=1.0 / math.sqrt(float(32))),
                  name="weights")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 2 other locations - About 6 hrs to fix
        tensorflow/python/framework/meta_graph_test.py on lines 386..393
        tensorflow/python/training/saver_test.py on lines 2876..2883

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 105.

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

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

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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

              if save._write_version is saver_pb2.SaverDef.V1:
                self.assertEqual(2, len(gfile.Glob(s2)))
              else:
                self.assertEqual(4, len(gfile.Glob(s2 + "*")))
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/training/saver_test.py on lines 1594..1597
        tensorflow/python/training/saver_test.py on lines 1604..1607
        tensorflow/python/training/saver_test.py on lines 1610..1613
        tensorflow/python/training/saver_test.py on lines 1628..1631

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 63.

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

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

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

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

        Refactorings

        Further Reading

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

              if save._write_version is saver_pb2.SaverDef.V1:
                self.assertEqual(2, len(gfile.Glob(s1)))
              else:
                self.assertEqual(4, len(gfile.Glob(s1 + "*")))
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/training/saver_test.py on lines 1594..1597
        tensorflow/python/training/saver_test.py on lines 1610..1613
        tensorflow/python/training/saver_test.py on lines 1622..1625
        tensorflow/python/training/saver_test.py on lines 1628..1631

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 63.

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

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

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

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

        Refactorings

        Further Reading

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

              if save._write_version is saver_pb2.SaverDef.V1:
                self.assertEqual(2, len(gfile.Glob(s1)))
              else:
                self.assertEqual(4, len(gfile.Glob(s1 + "*")))
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/training/saver_test.py on lines 1604..1607
        tensorflow/python/training/saver_test.py on lines 1610..1613
        tensorflow/python/training/saver_test.py on lines 1622..1625
        tensorflow/python/training/saver_test.py on lines 1628..1631

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 63.

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

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

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

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

        Refactorings

        Further Reading

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

              if save._write_version is saver_pb2.SaverDef.V1:
                self.assertEqual(2, len(gfile.Glob(s2)))
              else:
                self.assertEqual(4, len(gfile.Glob(s2 + "*")))
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/training/saver_test.py on lines 1594..1597
        tensorflow/python/training/saver_test.py on lines 1604..1607
        tensorflow/python/training/saver_test.py on lines 1622..1625
        tensorflow/python/training/saver_test.py on lines 1628..1631

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 63.

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

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

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

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

        Refactorings

        Further Reading

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

              if save._write_version is saver_pb2.SaverDef.V1:
                self.assertEqual(2, len(gfile.Glob(s3)))
              else:
                self.assertEqual(4, len(gfile.Glob(s3 + "*")))
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 3 hrs to fix
        tensorflow/python/training/saver_test.py on lines 1594..1597
        tensorflow/python/training/saver_test.py on lines 1604..1607
        tensorflow/python/training/saver_test.py on lines 1610..1613
        tensorflow/python/training/saver_test.py on lines 1622..1625

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 63.

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

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

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

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

        Refactorings

        Further Reading

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

                with self.cached_session() as sess:
                  # Initialize all variables
                  self.evaluate(init_all_op)
        
                  # Check that the parameter nodes have been initialized.
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/training/saver_test.py on lines 786..793

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 61.

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

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

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

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

        Refactorings

        Further Reading

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

            with self.cached_session() as sess:
              # Initialize all variables
              self.evaluate(init_all_op)
        
              # Check that the parameter nodes have been initialized.
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/training/saver_test.py on lines 751..760

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 61.

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

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

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

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

        Refactorings

        Further Reading

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

            with self.cached_session() as sess:
              # Initializes all the variables.
              self.evaluate(init_all_op)
              # Runs to logit.
              self.evaluate(logits)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/training/saver_test.py on lines 2304..2309

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 56.

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

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

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

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

        Refactorings

        Further Reading

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

              with session.Session() as sess:
                self.evaluate(init_op)
                self.evaluate(output)
                saver = saver_module.Saver()
                saver.save(sess, saver_ckpt)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/training/saver_test.py on lines 2213..2222

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 56.

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

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

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

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

        Refactorings

        Further Reading

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

              if not context.executing_eagerly():
                with self.assertRaisesOpError("uninitialized"):
                  self.evaluate(v0)
                with self.assertRaisesOpError("uninitialized"):
                  self.evaluate(v1)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/training/saver_test.py on lines 1831..1835

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

              if not context.executing_eagerly():
                with self.assertRaisesOpError("uninitialized"):
                  self.evaluate(v0)
                with self.assertRaisesOpError("uninitialized"):
                  self.evaluate(v1)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 2 hrs to fix
        tensorflow/python/training/saver_test.py on lines 1851..1855

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 50.

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

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

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

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

        Refactorings

        Further Reading

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

              sess.run(["new_model/optimize"], {
                  "new_model/image:0": np.random.random([1, 784]),
                  "new_model/label:0": np.random.randint(
                      10, size=[1, 10])
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 2568..2571
        tensorflow/python/training/saver_test.py on lines 2601..2604
        tensorflow/python/training/saver_test.py on lines 2628..2631

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

              sess.run(["new_model/optimize"], {
                  "new_model/image:0": np.random.random([1, 784]),
                  "new_model/label:0": np.random.randint(
                      10, size=[1, 10])
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 2493..2496
        tensorflow/python/training/saver_test.py on lines 2568..2571
        tensorflow/python/training/saver_test.py on lines 2601..2604

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

              sess.run(["new_model/optimize"], {
                  "new_model/image:0": np.random.random([1, 784]),
                  "new_model/label:0": np.random.randint(
                      10, size=[1, 10])
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 2493..2496
        tensorflow/python/training/saver_test.py on lines 2601..2604
        tensorflow/python/training/saver_test.py on lines 2628..2631

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

              sess.run(["new_model/optimize"], {
                  "new_model/image:0": np.random.random([1, 784]),
                  "new_model/label:0": np.random.randint(
                      10, size=[1, 10])
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 3 other locations - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 2493..2496
        tensorflow/python/training/saver_test.py on lines 2568..2571
        tensorflow/python/training/saver_test.py on lines 2628..2631

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

          def assertCheckpointState(self, model_checkpoint_path,
                                    all_model_checkpoint_paths, save_dir):
            checkpoint_state = checkpoint_management.get_checkpoint_state(save_dir)
            self.assertEqual(checkpoint_state.model_checkpoint_path,
                             model_checkpoint_path)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 1318..1324

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

          def assertCheckpointState(self, model_checkpoint_path,
                                    all_model_checkpoint_paths, save_dir):
            checkpoint_state = checkpoint_management.get_checkpoint_state(save_dir)
            self.assertEqual(checkpoint_state.model_checkpoint_path,
                             model_checkpoint_path)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 1684..1690

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

            ops_in_saver2_scope_but_not_save_scope = [
                op for op in g.get_operations()
                if (op.name.startswith("saver2/") and
                    not op.name.startswith("saver2/save/"))]
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 290..293

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

            ops_in_saver1_scope_but_not_save_scope = [
                op for op in g.get_operations()
                if (op.name.startswith("saver1/") and
                    not op.name.startswith("saver1/save/"))]
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 295..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 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

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

              with self.session() as sess:
                saver3 = saver_module.Saver(var_list=new_var_list_1, max_to_keep=1)
                saver3.restore(sess, saver0_ckpt)
                self.assertAllClose(expected, sess.run("new_hidden1/relu:0"))
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 2999..3002

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

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

              with self.session(graph=graph2) as sess:
                saver3 = saver_module.Saver(var_list=new_var_list_1, max_to_keep=1)
                saver3.restore(sess, saver0_ckpt)
                self.assertAllClose(expected, sess.run("new_hidden1/relu:0"))
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 2962..2965

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 5 locations. Consider refactoring.
        Open

                with sess.graph.device("/cpu:0"):
                  v0 = variable_v1.VariableV1(111, name="v0")
                  t0 = saver_test_utils.CheckpointedOp(name="t0")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 938..940
        tensorflow/python/training/saver_test.py on lines 941..943
        tensorflow/python/training/saver_test.py on lines 1017..1019
        tensorflow/python/training/saver_test.py on lines 1020..1022

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 5 locations. Consider refactoring.
        Open

              with sess.graph.device("/cpu:1"):
                v1 = variable_v1.VariableV1(222, name="v1")
                t1 = saver_test_utils.CheckpointedOp(name="t1")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 938..940
        tensorflow/python/training/saver_test.py on lines 941..943
        tensorflow/python/training/saver_test.py on lines 969..971
        tensorflow/python/training/saver_test.py on lines 1017..1019

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 5 locations. Consider refactoring.
        Open

              with sess.graph.device("/cpu:1"):
                v1 = variable_v1.VariableV1(20, name="v1")
                t1 = saver_test_utils.CheckpointedOp(name="t1")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 938..940
        tensorflow/python/training/saver_test.py on lines 969..971
        tensorflow/python/training/saver_test.py on lines 1017..1019
        tensorflow/python/training/saver_test.py on lines 1020..1022

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 5 locations. Consider refactoring.
        Open

              with sess.graph.device("/cpu:0"):
                v0 = variable_v1.VariableV1(10, name="v0")
                t0 = saver_test_utils.CheckpointedOp(name="t0")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 941..943
        tensorflow/python/training/saver_test.py on lines 969..971
        tensorflow/python/training/saver_test.py on lines 1017..1019
        tensorflow/python/training/saver_test.py on lines 1020..1022

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 5 locations. Consider refactoring.
        Open

              with sess.graph.device("/cpu:0"):
                v0 = variable_v1.VariableV1(111, name="v0")
                t0 = saver_test_utils.CheckpointedOp(name="t0")
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 4 other locations - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 938..940
        tensorflow/python/training/saver_test.py on lines 941..943
        tensorflow/python/training/saver_test.py on lines 969..971
        tensorflow/python/training/saver_test.py on lines 1020..1022

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

              large_v = [variable_scope.get_variable(
                  "large%d" % i, shape=[32000, 1000], use_resource=True)
                         for i in range(3)]
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 825..826

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
        Open

              small_v = [variable_scope.get_variable(
                  "small%d" % i, shape=[10, 2], use_resource=True) for i in range(5)]
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 827..829

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
        Open

            def _get_read_histogram_proto():
              proto_bytes = metrics.GetCheckpointReadDurations(api_label=api_label)
              histogram_proto = summary_pb2.HistogramProto()
              histogram_proto.ParseFromString(proto_bytes)
              return histogram_proto
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 855..859

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

            def _get_write_histogram_proto():
              proto_bytes = metrics.GetCheckpointWriteDurations(api_label=api_label)
              histogram_proto = summary_pb2.HistogramProto()
              histogram_proto.ParseFromString(proto_bytes)
              return histogram_proto
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 1 hr to fix
        tensorflow/python/training/saver_test.py on lines 861..865

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 38.

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

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

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

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

        Refactorings

        Further Reading

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

          def _get_test_dir(self, dirname):
            test_dir = os.path.join(self.get_temp_dir(), dirname)
            gfile.MakeDirs(test_dir)
            return test_dir
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 7 other locations - About 55 mins to fix
        tensorflow/python/checkpoint/checkpoint_management_test.py on lines 149..152
        tensorflow/python/training/saver_test.py on lines 926..929
        tensorflow/python/training/saver_test.py on lines 1679..1682
        tensorflow/python/training/saver_test.py on lines 1740..1743
        tensorflow/python/training/saver_test.py on lines 1875..1878
        tensorflow/python/training/saver_test.py on lines 2720..2723
        tensorflow/python/training/saver_test.py on lines 2751..2754

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
        Open

          def _get_test_dir(self, dirname):
            test_dir = os.path.join(self.get_temp_dir(), dirname)
            gfile.MakeDirs(test_dir)
            return test_dir
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 7 other locations - About 55 mins to fix
        tensorflow/python/checkpoint/checkpoint_management_test.py on lines 149..152
        tensorflow/python/training/saver_test.py on lines 926..929
        tensorflow/python/training/saver_test.py on lines 1313..1316
        tensorflow/python/training/saver_test.py on lines 1740..1743
        tensorflow/python/training/saver_test.py on lines 1875..1878
        tensorflow/python/training/saver_test.py on lines 2720..2723
        tensorflow/python/training/saver_test.py on lines 2751..2754

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
        Open

          def _get_test_dir(self, dirname):
            test_dir = os.path.join(self.get_temp_dir(), dirname)
            gfile.MakeDirs(test_dir)
            return test_dir
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 7 other locations - About 55 mins to fix
        tensorflow/python/checkpoint/checkpoint_management_test.py on lines 149..152
        tensorflow/python/training/saver_test.py on lines 1313..1316
        tensorflow/python/training/saver_test.py on lines 1679..1682
        tensorflow/python/training/saver_test.py on lines 1740..1743
        tensorflow/python/training/saver_test.py on lines 1875..1878
        tensorflow/python/training/saver_test.py on lines 2720..2723
        tensorflow/python/training/saver_test.py on lines 2751..2754

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
        Open

          def _get_test_dir(self, dirname):
            test_dir = os.path.join(self.get_temp_dir(), dirname)
            gfile.MakeDirs(test_dir)
            return test_dir
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 7 other locations - About 55 mins to fix
        tensorflow/python/checkpoint/checkpoint_management_test.py on lines 149..152
        tensorflow/python/training/saver_test.py on lines 926..929
        tensorflow/python/training/saver_test.py on lines 1313..1316
        tensorflow/python/training/saver_test.py on lines 1679..1682
        tensorflow/python/training/saver_test.py on lines 1875..1878
        tensorflow/python/training/saver_test.py on lines 2720..2723
        tensorflow/python/training/saver_test.py on lines 2751..2754

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
        Open

          def _get_test_dir(self, dirname):
            test_dir = os.path.join(self.get_temp_dir(), dirname)
            gfile.MakeDirs(test_dir)
            return test_dir
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 7 other locations - About 55 mins to fix
        tensorflow/python/checkpoint/checkpoint_management_test.py on lines 149..152
        tensorflow/python/training/saver_test.py on lines 926..929
        tensorflow/python/training/saver_test.py on lines 1313..1316
        tensorflow/python/training/saver_test.py on lines 1679..1682
        tensorflow/python/training/saver_test.py on lines 1740..1743
        tensorflow/python/training/saver_test.py on lines 1875..1878
        tensorflow/python/training/saver_test.py on lines 2720..2723

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
        Open

          def _get_test_dir(self, dirname):
            test_dir = os.path.join(self.get_temp_dir(), dirname)
            gfile.MakeDirs(test_dir)
            return test_dir
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 7 other locations - About 55 mins to fix
        tensorflow/python/checkpoint/checkpoint_management_test.py on lines 149..152
        tensorflow/python/training/saver_test.py on lines 926..929
        tensorflow/python/training/saver_test.py on lines 1313..1316
        tensorflow/python/training/saver_test.py on lines 1679..1682
        tensorflow/python/training/saver_test.py on lines 1740..1743
        tensorflow/python/training/saver_test.py on lines 1875..1878
        tensorflow/python/training/saver_test.py on lines 2751..2754

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 8 locations. Consider refactoring.
        Open

          def _get_test_dir(self, dirname):
            test_dir = os.path.join(self.get_temp_dir(), dirname)
            gfile.MakeDirs(test_dir)
            return test_dir
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 7 other locations - About 55 mins to fix
        tensorflow/python/checkpoint/checkpoint_management_test.py on lines 149..152
        tensorflow/python/training/saver_test.py on lines 926..929
        tensorflow/python/training/saver_test.py on lines 1313..1316
        tensorflow/python/training/saver_test.py on lines 1679..1682
        tensorflow/python/training/saver_test.py on lines 1740..1743
        tensorflow/python/training/saver_test.py on lines 2720..2723
        tensorflow/python/training/saver_test.py on lines 2751..2754

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 37.

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

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

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

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

        Refactorings

        Further Reading

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

                if call_saver_with_dict:
                  saver = saver_module.Saver({var_name: vs[0]})
                else:
                  saver = saver_module.Saver(vs)
        Severity: Minor
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 55 mins to fix
        tensorflow/python/training/saver_test.py on lines 1130..1135

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 37.

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

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

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

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

        Refactorings

        Further Reading

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

                if call_saver_with_dict:
                  saver = saver_module.Saver({
                      var_name: new_vs[0]
                  })
                else:
        Severity: Minor
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 55 mins to fix
        tensorflow/python/training/saver_test.py on lines 1101..1104

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

              with self.assertRaisesWithPredicateMatch(
                  errors_impl.OpError, lambda e: "uninitialized value v" in e.message):
                self.evaluate(v)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 3 other locations - About 50 mins to fix
        tensorflow/python/training/saver_test.py on lines 503..505
        tensorflow/python/training/saver_test.py on lines 506..508
        tensorflow/python/training/saver_test.py on lines 2025..2027

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

              with self.assertRaisesWithPredicateMatch(
                  errors_impl.OpError, lambda e: "uninitialized value v1" in e.message):
                self.evaluate(v1)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 3 other locations - About 50 mins to fix
        tensorflow/python/training/saver_test.py on lines 412..414
        tensorflow/python/training/saver_test.py on lines 503..505
        tensorflow/python/training/saver_test.py on lines 2025..2027

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

              with self.assertRaisesWithPredicateMatch(
                  errors_impl.OpError, lambda e: "uninitialized value v0" in e.message):
                self.evaluate(v0)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 3 other locations - About 50 mins to fix
        tensorflow/python/training/saver_test.py on lines 412..414
        tensorflow/python/training/saver_test.py on lines 506..508
        tensorflow/python/training/saver_test.py on lines 2025..2027

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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

              with self.assertRaisesWithPredicateMatch(
                  errors_impl.OpError, lambda e: "uninitialized value v1" in e.message):
                self.evaluate(v1)
        Severity: Major
        Found in tensorflow/python/training/saver_test.py and 3 other locations - About 50 mins to fix
        tensorflow/python/training/saver_test.py on lines 412..414
        tensorflow/python/training/saver_test.py on lines 503..505
        tensorflow/python/training/saver_test.py on lines 506..508

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
        Open

              _, var_list = meta_graph.export_scoped_meta_graph(
                  filename=os.path.join(test_dir, exported_filename),
                  graph=ops_lib.get_default_graph(),
        Severity: Minor
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 45 mins to fix
        tensorflow/python/framework/meta_graph_test.py on lines 713..715

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 35.

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

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

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

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

        Refactorings

        Further Reading

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

              save = saver_module.Saver(
                  {
                      "v0": v0,
                      "v1": v1,
                      "t0": t0.saveable,
        Severity: Minor
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 40 mins to fix
        tensorflow/python/training/saver_test.py on lines 944..951

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 34.

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

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

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

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

        Refactorings

        Further Reading

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

              save = saver_module.Saver(
                  {
                      "v0": v0,
                      "v1": v1,
                      "t0": t0.saveable,
        Severity: Minor
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 40 mins to fix
        tensorflow/python/training/saver_test.py on lines 1023..1030

        Duplicated Code

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

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

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 2 locations. Consider refactoring.
        Open

            if save._write_version is saver_pb2.SaverDef.V1:
              self.assertEqual(
                  checkpoint_management.latest_checkpoint(self.get_temp_dir()),
                  os.path.join(self.get_temp_dir(), "sharded_basics-?????-of-00002"))
        Severity: Minor
        Found in tensorflow/python/training/saver_test.py and 1 other location - About 35 mins to fix
        tensorflow/python/training/saver_test.py on lines 1053..1060

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 33.

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

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

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

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

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status