tensorflow/tensorflow

View on GitHub
tensorflow/python/saved_model/saved_model_test.py

Summary

Maintainability
F
3 wks
Test Coverage

File saved_model_test.py has 1083 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/saved_model/saved_model_test.py - About 2 days to fix

    SavedModelTest has 41 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SavedModelTest(SavedModelTestBase):
    
      def _validate_assets(self,
                           export_dir,
                           asset_file_def,
    Severity: Minor
    Found in tensorflow/python/saved_model/saved_model_test.py - About 5 hrs to fix

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

        def _validate_asset_collection(self,
      Severity: Minor
      Found in tensorflow/python/saved_model/saved_model_test.py - About 45 mins to fix

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

          def _validate_assets(self,
        Severity: Minor
        Found in tensorflow/python/saved_model/saved_model_test.py - About 45 mins to fix

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

            def testDuplicateAssets(self):
              export_dir = self._get_export_dir("test_duplicate_assets")
              builder = saved_model_builder._SavedModelBuilder(export_dir)
          
              with ops.Graph().as_default():
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 2 days to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 1005..1044

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 258.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testMultipleAssets(self):
              export_dir = self._get_export_dir("test_multiple_assets")
              builder = saved_model_builder._SavedModelBuilder(export_dir)
          
              with ops.Graph().as_default():
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 2 days to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 1046..1091

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 258.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testWritingAssetsToCollection(self):
              export_dir = self._get_export_dir("test_writing_assets_to_collection")
              builder = saved_model_builder.SavedModelBuilder(export_dir)
          
              with ops.Graph().as_default():
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 2 days to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 690..722

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 243.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testAssets(self):
              export_dir = self._get_export_dir("test_assets")
              builder = saved_model_builder._SavedModelBuilder(export_dir)
          
              with ops.Graph().as_default():
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 2 days to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 1421..1454

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 243.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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=ops.Graph()) as sess:
                  foo_graph = loader.load(sess, ["foo"], export_dir)
                  self._validate_assets(export_dir, foo_graph.asset_file_def,
                                        "hello42.txt", "foo bar baz",
                                        "asset_file_tensor:0")
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 7 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 780..797

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 117.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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=ops.Graph()) as sess:
                  foo_graph = loader.load(sess, ["foo"], export_dir)
                  self._validate_assets(export_dir, foo_graph.asset_file_def,
                                        "hello42.txt", "foo bar baz",
                                        "asset_file_tensor:0")
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 7 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 822..839

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 117.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  loader.load(sess, ["foo"], export_dir)
                  collection_foo_vars = ops.get_collection("foo_vars")
                  self.assertEqual(len(collection_foo_vars), 1)
                  self.assertEqual(42, self._eval(collection_foo_vars[0]))
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 6 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 550..556

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 98.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  loader.load(sess, ["bar"], export_dir)
                  collection_bar_vars = ops.get_collection("bar_vars")
                  self.assertEqual(len(collection_bar_vars), 1)
                  self.assertEqual(42, self._eval(collection_bar_vars[0]))
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 6 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 537..543

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 98.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=graph) as sess:
                  saved_graph = loader.load(sess, ["tag"], export_dir)
                  graph_ops = [x.name for x in graph.get_operations()]
                  self.assertTrue("my_saver/restore_all" in graph_ops)
                  self.assertFalse("save/restore_all" in graph_ops)
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 5 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 1198..1204

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 92.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=graph) as sess:
                  saved_graph = loader.load(sess, ["tag"], export_dir)
                  graph_ops = [x.name for x in graph.get_operations()]
                  self.assertTrue("my_saver/restore_all" in graph_ops)
                  self.assertTrue("save/restore_all" in graph_ops)
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 5 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 1176..1182

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 92.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  loader.load(sess, ["bar"], export_dir)
                  # Read the constant a from the graph.
                  a = ops.get_default_graph().get_tensor_by_name(constant_6_name)
                  b = constant_op.constant(5.0)
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 431..437

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 84.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  loader.load(sess, ["foo"], export_dir)
                  # Read the constant a from the graph.
                  a = ops.get_default_graph().get_tensor_by_name(constant_5_name)
                  b = constant_op.constant(6.0)
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 440..446

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 84.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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=ops.Graph()) as sess:
                  loader.load(sess, ["foo"], export_dir)
                  self.assertEqual(1, self._eval("v1"))
                  self.assertEqual(2, self._eval("v2"))
                  # Evaluates to the sum of the first two variables and assigned as part
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 1589..1595

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 79.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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=ops.Graph()) as sess:
                  loader.load(sess, ["foo"], export_dir)
                  self.assertEqual(1, self._eval("v1"))
                  self.assertEqual(2, self._eval("v2"))
                  # Evaluates to the sum of the first two variables and assigned as part
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 906..912

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 79.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 42)
          
                  asset_list = self._build_asset_collection(
                      "hello42.txt", "foo bar baz", "asset_file_tensor", asset_subdir="1")
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 729..742

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 79.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 42)
          
                  asset_list = self._build_asset_collection(
                      "hello42.txt", "foo bar bak", "asset_file_tensor", asset_subdir="1")
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 804..817

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 79.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  loader.load(sess, [tag_constants.SERVING, tag_constants.GPU],
                              export_dir)
                  self.assertEqual(
                      42,
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 331..336

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 68.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  loader.load(sess, [tag_constants.SERVING, tag_constants.TPU],
                              export_dir)
                  self.assertEqual(
                      42,
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 322..327

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 68.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  loader.load(sess, [tag_constants.TRAINING], export_dir)
                  self.assertEqual(
                      42,
                      self._eval(ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)[0]))
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 314..318

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 65.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  loader.load(sess, [tag_constants.SERVING], export_dir)
                  self.assertEqual(
                      42,
                      self._eval(ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)[0]))
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 306..310

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 65.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.session(graph=ops.Graph()) as sess:
                  loader.load(sess, ["foo"], export_dir)
                  self.assertEqual(
                      42,
                      self._eval(ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)[0]))
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 500..504

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 63.

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

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

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

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

          Refactorings

          Further Reading

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

                with self.session(graph=ops.Graph()) as sess:
                  loader.load(sess, ["bar"], export_dir)
                  self.assertEqual(
                      42,
                      self._eval(ops.get_collection(ops.GraphKeys.GLOBAL_VARIABLES)[0]))
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 493..497

          Duplicated Code

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

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

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

                  if resource_variables_toggle.resource_variables_enabled():
                    self.assertEqual(
                        loader_impl.get_train_op(meta_graph_def).type,
                        "AssignAddVariableOp")
                  else:
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 937..943

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 45.

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

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

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

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

          Refactorings

          Further Reading

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

                  if resource_variables_toggle.resource_variables_enabled():
                    self.assertEqual(
                        loader_impl.get_train_op(meta_graph_def).type,
                        "AssignAddVariableOp")
                  else:
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 993..999

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 45.

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

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

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

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

          Refactorings

          Further Reading

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 45)
                  builder.add_meta_graph([tag_constants.SERVING, tag_constants.TPU])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 3 other locations - About 1 hr to fix
          tensorflow/python/tools/saved_model_utils_test.py on lines 85..87
          tensorflow/python/tools/saved_model_utils_test.py on lines 92..94
          tensorflow/python/saved_model/saved_model_test.py on lines 283..285

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 45.

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

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

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

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

          Refactorings

          Further Reading

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 45)
                  builder.add_meta_graph([tag_constants.SERVING, tag_constants.GPU])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 3 other locations - About 1 hr to fix
          tensorflow/python/tools/saved_model_utils_test.py on lines 85..87
          tensorflow/python/tools/saved_model_utils_test.py on lines 92..94
          tensorflow/python/saved_model/saved_model_test.py on lines 290..292

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 45.

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

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

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

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

          Refactorings

          Further Reading

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 42)
                  builder.add_meta_graph_and_variables(sess, [tag_constants.TRAINING])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 3 other locations - About 1 hr to fix
          tensorflow/python/tools/saved_model_utils_test.py on lines 44..46
          tensorflow/python/tools/saved_model_utils_test.py on lines 71..73
          tensorflow/python/saved_model/saved_model_test.py on lines 225..227

          Duplicated Code

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

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

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

          Tuning

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 42)
                  builder.add_meta_graph_and_variables(sess, [tag_constants.TRAINING])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 3 other locations - About 1 hr to fix
          tensorflow/python/tools/saved_model_utils_test.py on lines 44..46
          tensorflow/python/tools/saved_model_utils_test.py on lines 71..73
          tensorflow/python/saved_model/saved_model_test.py on lines 269..271

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 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=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 43)
                  builder.add_meta_graph([tag_constants.SERVING])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/tools/saved_model_utils_test.py on lines 78..80

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 42.

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

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

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

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

          Refactorings

          Further Reading

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 42)
                  builder.add_meta_graph_and_variables(sess, ["foo"])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 455..457

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 41.

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

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

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

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

          Refactorings

          Further Reading

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 42)
                  builder.add_meta_graph_and_variables(sess, ["foo"])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 479..481

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 41.

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

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

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

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

          Refactorings

          Further Reading

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 44)
                  builder.add_meta_graph(["foo", "bar"])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/tools/saved_model_utils_test.py on lines 99..101

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 41.

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

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

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

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

          Refactorings

          Further Reading

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v", 43)
                  builder.add_meta_graph(["bar"])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 2 other locations - About 1 hr to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 374..376
          tensorflow/python/saved_model/saved_model_test.py on lines 381..383

          Duplicated Code

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

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

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v2", 3)
                  builder.add_meta_graph(["bar"])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 2 other locations - About 1 hr to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 381..383
          tensorflow/python/saved_model/saved_model_test.py on lines 485..487

          Duplicated Code

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

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

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

                with self.session(graph=ops.Graph()) as sess:
                  self._init_and_validate_variable(sess, "v3", 4)
                  builder.add_meta_graph(["baz"])
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 2 other locations - About 1 hr to fix
          tensorflow/python/saved_model/saved_model_test.py on lines 374..376
          tensorflow/python/saved_model/saved_model_test.py on lines 485..487

          Duplicated Code

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

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

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

              assets_path = os.path.join(
                  compat.as_bytes(export_dir),
                  compat.as_bytes(constants.ASSETS_DIRECTORY),
                  compat.as_bytes(expected_asset_file_name))
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 2 other locations - About 45 mins to fix
          tensorflow/python/keras/saving/saved_model_experimental.py on lines 409..412
          tensorflow/python/saved_model/saved_model_test.py on lines 1411..1414

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

              assets_path = os.path.join(
                  compat.as_bytes(export_dir),
                  compat.as_bytes(constants.ASSETS_DIRECTORY),
                  compat.as_bytes(expected_asset_file_name))
          Severity: Major
          Found in tensorflow/python/saved_model/saved_model_test.py and 2 other locations - About 45 mins to fix
          tensorflow/python/keras/saving/saved_model_experimental.py on lines 409..412
          tensorflow/python/saved_model/saved_model_test.py on lines 113..116

          Duplicated Code

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

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

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

          There are no issues that match your filters.

          Category
          Status