tensorflow/tensorflow

View on GitHub
tensorflow/python/framework/importer_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File importer_test.py has 1023 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/framework/importer_test.py - About 2 days to fix

    ImportGraphDefTest has 58 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ImportGraphDefTest(test.TestCase):
    
      def _MakeGraphDef(self,
                        text,
                        producer=versions.GRAPH_DEF_VERSION,
    Severity: Major
    Found in tensorflow/python/framework/importer_test.py - About 1 day to fix

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

        def testColocationWithDeviceFn(self):
          original_graph_def = self._MakeGraphDef("""
                node { name: 'A' op: 'None' attr {
                  key: '_class'
                  value { list { s: 'loc:@A' } }
      Severity: Minor
      Found in tensorflow/python/framework/importer_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 3 locations. Consider refactoring.
      Open

        def testInputMapUnicode(self):
          with ops.Graph().as_default():
            feed_a_0 = constant_op.constant(0, dtype=dtypes.int32)
            feed_b_1 = constant_op.constant(1, dtype=dtypes.int32)
      
      
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 2 other locations - About 1 day to fix
      tensorflow/python/framework/importer_test.py on lines 234..259
      tensorflow/python/framework/importer_test.py on lines 261..286

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 180.

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

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

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

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

      Refactorings

      Further Reading

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

        def testInputMap(self):
          with ops.Graph().as_default():
            feed_a_0 = constant_op.constant(0, dtype=dtypes.int32)
            feed_b_1 = constant_op.constant(1, dtype=dtypes.int32)
      
      
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 2 other locations - About 1 day to fix
      tensorflow/python/framework/importer_test.py on lines 261..286
      tensorflow/python/framework/importer_test.py on lines 288..313

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 180.

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

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

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

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

      Refactorings

      Further Reading

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

        def testInputMapBytes(self):
          with ops.Graph().as_default():
            feed_a_0 = constant_op.constant(0, dtype=dtypes.int32)
            feed_b_1 = constant_op.constant(1, dtype=dtypes.int32)
      
      
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 2 other locations - About 1 day to fix
      tensorflow/python/framework/importer_test.py on lines 234..259
      tensorflow/python/framework/importer_test.py on lines 288..313

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 180.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.Graph().as_default() as g3:
            p1, p2, a, b = importer.import_graph_def(
                gdef, return_elements=["p1:0", "p2:0", "f:0", "f:1"], name="")
            # Create new gradient functions (in additional to the imported gradient
            # functions created in g2).
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 1 day to fix
      tensorflow/python/framework/importer_test.py on lines 1189..1202

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 172.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.Graph().as_default() as g2:
            p1, p2, a, b = importer.import_graph_def(
                gdef, return_elements=["p1:0", "p2:0", "f:0", "f:1"], name="")
            grad = gradients_impl.gradients([a], [p1, p2])
      
      
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 1 day to fix
      tensorflow/python/framework/importer_test.py on lines 1207..1221

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 172.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.Graph().as_default():
            with ops.device(BDeviceFn):
              a, b = importer.import_graph_def(original_graph_def,
                                               return_elements=["A", "B"],
                                               name="imported_graph")
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 2 other locations - About 6 hrs to fix
      tensorflow/python/framework/importer_test.py on lines 767..775
      tensorflow/python/framework/importer_test.py on lines 801..809

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 102.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.Graph().as_default():
            with ops.device(CustomDeviceFn):
              a, b = importer.import_graph_def(original_graph_def,
                                               return_elements=["A", "B"],
                                               name="imported_graph")
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 2 other locations - About 6 hrs to fix
      tensorflow/python/framework/importer_test.py on lines 785..793
      tensorflow/python/framework/importer_test.py on lines 801..809

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 102.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.Graph().as_default():
            with ops.device(ADeviceFn):
              a, b = importer.import_graph_def(original_graph_def,
                                               return_elements=["A", "B"],
                                               name="imported_graph")
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 2 other locations - About 6 hrs to fix
      tensorflow/python/framework/importer_test.py on lines 767..775
      tensorflow/python/framework/importer_test.py on lines 785..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 102.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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.Graph().as_default():
            with ops.device(device.merge_device("/task:0")):
              a3, b3, c3 = importer.import_graph_def(
                  gdef, return_elements=["a", "b", "c"])
              self.assertEqual("/task:0", a3.device)
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/framework/importer_test.py on lines 986..992

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 95.

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

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

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

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

      Refactorings

      Further Reading

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

          with ops.Graph().as_default():
            with ops.device(device.merge_device("/device:GPU:0")):
              a5, b5, c5 = importer.import_graph_def(
                  gdef, return_elements=["a", "b", "c"])
              self.assertEqual("/device:GPU:0", a5.device)
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/framework/importer_test.py on lines 970..976

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 95.

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

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

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

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

      Refactorings

      Further Reading

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

          with ops.Graph().as_default():
            a, b = importer.import_graph_def(original_graph_def,
                                             return_elements=["A", "B"],
                                             name="")
            # TODO(skyewm): this behavior seems inconsistent with the above. Why is
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/framework/importer_test.py on lines 716..723

      Duplicated Code

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

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

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 ops.Graph().as_default():
            a, b = importer.import_graph_def(original_graph_def,
                                             return_elements=["A", "B"],
                                             name="")
            self.assertEqual(a.device, "/device:CPU:0")
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 5 hrs to fix
      tensorflow/python/framework/importer_test.py on lines 736..745

      Duplicated Code

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

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

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

        def testMissingInputMap(self):
          with ops.Graph().as_default():
            with self.assertRaisesRegex(
                ValueError,
                r"Attempted to map inputs that were not found in graph_def: \[B:0\]"):
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/framework/importer_test.py on lines 645..655

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 58.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testInputMapTypeMismatch(self):
          with ops.Graph().as_default():
            with self.assertRaisesRegex(
                ValueError, "Input 0 of node import/B was passed float from Const:0 "
                "incompatible with expected int32."):
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 2 hrs to fix
      tensorflow/python/framework/importer_test.py on lines 615..624

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 58.

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

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

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 graph.as_default():
            r = while_loop.while_loop(lambda i: i < 10, lambda i: i + 1, [0])
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/framework/importer_test.py on lines 446..447

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

          with graph.as_default():
            r = while_loop.while_loop(lambda i: i < 10, lambda i: i + 1, [0])
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 1 hr to fix
      tensorflow/python/framework/importer_test.py on lines 425..426

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 47.

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

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

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

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

      Refactorings

      Further Reading

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

        def testMissingInputTensorInGraphDef(self):
          with ops.Graph().as_default():
            with self.assertRaisesRegex(
                ValueError,
                "Node 'B': Connecting to invalid output 1 of source node A "
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 6 other locations - About 1 hr to fix
      tensorflow/python/framework/importer_test.py on lines 494..501
      tensorflow/python/framework/importer_test.py on lines 506..514
      tensorflow/python/framework/importer_test.py on lines 519..524
      tensorflow/python/framework/importer_test.py on lines 551..556
      tensorflow/python/framework/importer_test.py on lines 560..565
      tensorflow/python/framework/importer_test.py on lines 569..574

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 44.

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

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

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

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

      Refactorings

      Further Reading

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

        def testMissingControlInputInGraphDef(self):
          with ops.Graph().as_default():
            with self.assertRaisesRegex(ValueError,
                                        r"Node 'B': Unknown input node '\^A'"):
              importer.import_graph_def(
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 6 other locations - About 1 hr to fix
      tensorflow/python/framework/importer_test.py on lines 494..501
      tensorflow/python/framework/importer_test.py on lines 506..514
      tensorflow/python/framework/importer_test.py on lines 519..524
      tensorflow/python/framework/importer_test.py on lines 539..546
      tensorflow/python/framework/importer_test.py on lines 560..565
      tensorflow/python/framework/importer_test.py on lines 569..574

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 44.

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

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

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

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

      Refactorings

      Further Reading

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

        def testInvalidSignatureNotEnoughInputsInGraphDef(self):
          with ops.Graph().as_default():
            # TODO(skyewm): improve error message
            with self.assertRaisesRegex(
                ValueError,
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 6 other locations - About 1 hr to fix
      tensorflow/python/framework/importer_test.py on lines 494..501
      tensorflow/python/framework/importer_test.py on lines 519..524
      tensorflow/python/framework/importer_test.py on lines 539..546
      tensorflow/python/framework/importer_test.py on lines 551..556
      tensorflow/python/framework/importer_test.py on lines 560..565
      tensorflow/python/framework/importer_test.py on lines 569..574

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 44.

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

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

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

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

      Refactorings

      Further Reading

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

        def testInvalidTensorNameInGraphDef(self):
          with ops.Graph().as_default():
            with self.assertRaisesRegex(ValueError,
                                        "Node 'B': Unknown input node 'A:B:0'"):
              importer.import_graph_def(
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 6 other locations - About 1 hr to fix
      tensorflow/python/framework/importer_test.py on lines 494..501
      tensorflow/python/framework/importer_test.py on lines 506..514
      tensorflow/python/framework/importer_test.py on lines 519..524
      tensorflow/python/framework/importer_test.py on lines 539..546
      tensorflow/python/framework/importer_test.py on lines 551..556
      tensorflow/python/framework/importer_test.py on lines 560..565

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 44.

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

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

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

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

      Refactorings

      Further Reading

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

        def testMissingInputOpInGraphDef(self):
          with ops.Graph().as_default():
            with self.assertRaisesRegex(ValueError,
                                        "Node 'B': Unknown input node 'A:0'"):
              importer.import_graph_def(
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 6 other locations - About 1 hr to fix
      tensorflow/python/framework/importer_test.py on lines 494..501
      tensorflow/python/framework/importer_test.py on lines 506..514
      tensorflow/python/framework/importer_test.py on lines 539..546
      tensorflow/python/framework/importer_test.py on lines 551..556
      tensorflow/python/framework/importer_test.py on lines 560..565
      tensorflow/python/framework/importer_test.py on lines 569..574

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 44.

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

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

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

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

      Refactorings

      Further Reading

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

        def testInvalidSignatureTooManyInputsInGraphDef(self):
          with ops.Graph().as_default():
            # TODO(skyewm): improve error message
            with self.assertRaisesRegex(
                ValueError,
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 6 other locations - About 1 hr to fix
      tensorflow/python/framework/importer_test.py on lines 506..514
      tensorflow/python/framework/importer_test.py on lines 519..524
      tensorflow/python/framework/importer_test.py on lines 539..546
      tensorflow/python/framework/importer_test.py on lines 551..556
      tensorflow/python/framework/importer_test.py on lines 560..565
      tensorflow/python/framework/importer_test.py on lines 569..574

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 44.

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

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

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

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

      Refactorings

      Further Reading

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

        def testInvalidTensorNameOutputIndexInGraphDef(self):
          with ops.Graph().as_default():
            with self.assertRaisesRegex(ValueError,
                                        "Node 'B': Unknown input node 'A:B'"):
              importer.import_graph_def(
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 6 other locations - About 1 hr to fix
      tensorflow/python/framework/importer_test.py on lines 494..501
      tensorflow/python/framework/importer_test.py on lines 506..514
      tensorflow/python/framework/importer_test.py on lines 519..524
      tensorflow/python/framework/importer_test.py on lines 539..546
      tensorflow/python/framework/importer_test.py on lines 551..556
      tensorflow/python/framework/importer_test.py on lines 569..574

      Duplicated Code

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

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

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

          with self.cached_session() as sess:
            z1_val, z2_val = sess.run((z1, z2))
            self.assertAllEqual(z1_val, z2_val)
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 2 other locations - About 55 mins to fix
      tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1119..1121
      tensorflow/python/ops/parallel_for/control_flow_ops_test.py on lines 1762..1764

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 37.

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

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

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

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

      Refactorings

      Further Reading

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

          with ops.name_scope("second"):
            z2 = importer.import_graph_def(gdef, return_elements=["z:0"],
      Severity: Minor
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 50 mins to fix
      tensorflow/python/framework/importer_test.py on lines 1269..1270

      Duplicated Code

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

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

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

          with ops.name_scope("first"):
            z1 = importer.import_graph_def(gdef, return_elements=["z:0"],
      Severity: Minor
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 50 mins to fix
      tensorflow/python/framework/importer_test.py on lines 1273..1274

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 36.

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

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

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

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

      Refactorings

      Further Reading

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

            with self.assertRaisesRegex(
                ValueError,
                r"Invalid return output 1 of node 'A', which has 1 output\(s\)"):
              importer.import_graph_def(
                  self._MakeGraphDef("""
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 4 other locations - About 30 mins to fix
      tensorflow/python/framework/importer_test.py on lines 579..586
      tensorflow/python/framework/importer_test.py on lines 599..605
      tensorflow/python/framework/importer_test.py on lines 607..613
      tensorflow/python/framework/importer_test.py on lines 926..929

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

          with ops.Graph().as_default():
            with self.assertRaisesRegex(
                ValueError, "Requested return node 'B' not found in graph def"):
              importer.import_graph_def(
                  self._MakeGraphDef("""
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 4 other locations - About 30 mins to fix
      tensorflow/python/framework/importer_test.py on lines 590..597
      tensorflow/python/framework/importer_test.py on lines 599..605
      tensorflow/python/framework/importer_test.py on lines 607..613
      tensorflow/python/framework/importer_test.py on lines 926..929

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

            with self.assertRaisesRegex(ValueError,
                                        "Cannot convert 'a:b:c' to a tensor name."):
              importer.import_graph_def(
                  self._MakeGraphDef(""), return_elements=["a:b:c"])
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 4 other locations - About 30 mins to fix
      tensorflow/python/framework/importer_test.py on lines 579..586
      tensorflow/python/framework/importer_test.py on lines 590..597
      tensorflow/python/framework/importer_test.py on lines 599..605
      tensorflow/python/framework/importer_test.py on lines 607..613

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

            with self.assertRaisesRegex(
                ValueError, "Requested return tensor 'B:0' not found in graph def"):
              importer.import_graph_def(
                  self._MakeGraphDef("""
                  node { name: 'A' op: 'IntOutput' }
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 4 other locations - About 30 mins to fix
      tensorflow/python/framework/importer_test.py on lines 579..586
      tensorflow/python/framework/importer_test.py on lines 590..597
      tensorflow/python/framework/importer_test.py on lines 607..613
      tensorflow/python/framework/importer_test.py on lines 926..929

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

            with self.assertRaisesRegex(ValueError,
                                        "Cannot convert 'A:B:0' to a tensor name."):
              importer.import_graph_def(
                  self._MakeGraphDef("""
                  node { name: 'A' op: 'IntOutput' }
      Severity: Major
      Found in tensorflow/python/framework/importer_test.py and 4 other locations - About 30 mins to fix
      tensorflow/python/framework/importer_test.py on lines 579..586
      tensorflow/python/framework/importer_test.py on lines 590..597
      tensorflow/python/framework/importer_test.py on lines 599..605
      tensorflow/python/framework/importer_test.py on lines 926..929

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

            with ops.device("/job:ps"):
              v1 = constant_op.constant(1.0)
              v2 = constant_op.constant(1.0)
      Severity: Minor
      Found in tensorflow/python/framework/importer_test.py and 2 other locations - About 30 mins to fix
      tensorflow/python/eager/backprop_test.py on lines 703..705
      tensorflow/python/eager/backprop_test.py on lines 1130..1132

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

            b, = importer.import_graph_def(
                self._MakeGraphDef("""
                node { name: 'B' op: 'FloatInput' input: 'A:0' }
                """),
                input_map={"A:0": feed_a_0},
      Severity: Minor
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 30 mins to fix
      tensorflow/python/framework/importer_test.py on lines 329..335

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

        def testDuplicateOperationNames(self):
          with self.assertRaisesRegex(ValueError, "Node 'A' is not unique"):
            importer.import_graph_def(
                self._MakeGraphDef("""
      Severity: Minor
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 30 mins to fix
      tensorflow/python/autograph/operators/variables_test.py on lines 45..47

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

            b, = importer.import_graph_def(
                self._MakeGraphDef("""
                node { name: 'A' op: 'TwoIntOutputs' }
                node { name: 'B' op: 'IntInput' input: 'A:0' }
                """),
      Severity: Minor
      Found in tensorflow/python/framework/importer_test.py and 1 other location - About 30 mins to fix
      tensorflow/python/framework/importer_test.py on lines 531..536

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status