tensorflow/tensorflow

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

Summary

Maintainability
F
3 wks
Test Coverage

File convert_to_constants_test.py has 1351 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2019 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/convert_to_constants_test.py - About 3 days to fix

    ConvertVariablesToConstantsSessionTest has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ConvertVariablesToConstantsSessionTest(test.TestCase):
    
      def _assertGraphContains(self, graph, subgraph):
        """Asserts that the given subgraph is contained within the given graph."""
    
    
    Severity: Minor
    Found in tensorflow/python/framework/convert_to_constants_test.py - About 2 hrs to fix

      Function _assertGraphContains has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def _assertGraphContains(self, graph, subgraph):
          """Asserts that the given subgraph is contained within the given graph."""
      
          def normalize_uids(msg):
            """Replace auto-id function names with something consistent."""
      Severity: Minor
      Found in tensorflow/python/framework/convert_to_constants_test.py - About 55 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

      Avoid deeply nested control flow statements.
      Open

                  if node.name == "variable_node":
                    variable_node = node
                self.assertIsNotNone(variable_node)
      Severity: Major
      Found in tensorflow/python/framework/convert_to_constants_test.py - About 45 mins to fix

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

          def _testConvertedFunction(self, sess, obj, func, converted_concrete_func,
        Severity: Minor
        Found in tensorflow/python/framework/convert_to_constants_test.py - About 35 mins to fix

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

            def testConvertOneVariableOfTwo(self):
              """Tests that one variable can be kept unconverted."""
              with ops.Graph().as_default():
                with variable_scope.variable_scope("", use_resource=False):
                  x = variable_scope.get_variable("x", initializer=1.0)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 day to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 1217..1258

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 146.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testConvertOneResourceVariableOfTwo(self):
              """Tests that one variable can be kept unconverted."""
              with ops.Graph().as_default():
                with variable_scope.variable_scope("", use_resource=True):
                  x = variable_scope.get_variable("x", initializer=1.0)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 day to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 1175..1215

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 146.

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

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

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

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

          Refactorings

          Further Reading

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

              class BasicModel(autotrackable.AutoTrackable):
          
                def __init__(self):
                  self.y = None
                  self.z = None
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 7 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 696..712

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 120.

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

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

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

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

          Refactorings

          Further Reading

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

              class BasicModel(autotrackable.AutoTrackable):
          
                def __init__(self):
                  self.y = None
                  self.z = None
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 7 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 298..314

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 120.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testConvertSingleVariable(self):
              """Tests that a single variable is properly converted to a constant."""
          
              with ops.Graph().as_default():
                with variable_scope.variable_scope("", use_resource=False):
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 6 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 1149..1173

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 109.

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

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

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

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

          Refactorings

          Further Reading

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

            def testConvertSingleResourceVariable(self):
              """Tests that a resource variable is properly converted to a constant."""
              with ops.Graph().as_default():
                with variable_scope.variable_scope("", use_resource=True):
                  _ = variable_scope.get_variable("x", initializer=1.0)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 6 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 1122..1147

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 109.

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

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

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

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

          Refactorings

          Further Reading

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

                  @def_function.function(input_signature=[
                      tensor_spec.TensorSpec(shape=[], dtype=dtypes.int32),
                      tensor_spec.TensorSpec(shape=[10, 3], dtype=dtypes.float32),
                  ])
                  def model(i, x):
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 5 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 522..528

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 87.

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

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

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

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

          Refactorings

          Further Reading

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

              @def_function.function(input_signature=[
                  tensor_spec.TensorSpec(shape=[], dtype=dtypes.int32),
                  tensor_spec.TensorSpec(shape=[10, 3], dtype=dtypes.float32),
              ])
              def model(i, x):
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 5 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 901..907

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 87.

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 session_lib.Session() as session:
                  session.run([v.initializer, distractor.initializer,
                               local_variable.initializer])
                  path = os.path.join(self.get_temp_dir(), "saved_model", str(ops.uid()))
                  simple_save.simple_save(
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 5 hrs to fix
          tensorflow/python/saved_model/load_v1_in_v2_test.py on lines 84..94

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 86.

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

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

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

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

          Refactorings

          Further Reading

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

              @def_function.function(input_signature=[
                  tensor_spec.TensorSpec(shape=[1, 2], dtype=dtypes.float32),
                  tensor_spec.TensorSpec(shape=(), dtype=dtypes.bool)
              ])
              def model(x, b):
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 746..752

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 81.

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

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

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

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

          Refactorings

          Further Reading

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

                  @def_function.function(input_signature=[
                      tensor_spec.TensorSpec(shape=[1, 2], dtype=dtypes.float32),
                      tensor_spec.TensorSpec(shape=(), dtype=dtypes.bool)
                  ])
                  def model(x, b):
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 381..387

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 81.

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

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

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

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

          Refactorings

          Further Reading

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

              @def_function.function(input_signature=[
                  tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32)
              ])
              def model(x):
                return while_v2.while_loop(
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 836..842

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 75.

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

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

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

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

          Refactorings

          Further Reading

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

                  @def_function.function(input_signature=[
                      tensor_spec.TensorSpec(shape=(), dtype=dtypes.float32)
                  ])
                  def model(x):
                    return while_v2.while_loop(
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 4 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 464..470

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 75.

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

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

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

              merged.signature.output_arg.extend(
                  _GraphMerger.merge_lists(
                      fn1.signature.output_arg[:], fn2.signature.output_arg[:],
                      op_def_pb2.OpDef.ArgDef, lambda a: a.name,
                      lambda x, y: _GraphMerger.merge_any(x, y, op_def_pb2.OpDef.ArgDef)))
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 116..120

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 70.

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

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

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

              merged.signature.input_arg.extend(
                  _GraphMerger.merge_lists(
                      fn1.signature.input_arg[:], fn2.signature.input_arg[:],
                      op_def_pb2.OpDef.ArgDef, lambda a: a.name,
                      lambda x, y: _GraphMerger.merge_any(x, y, op_def_pb2.OpDef.ArgDef)))
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 123..127

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 70.

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

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

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

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

          Refactorings

          Further Reading

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

                  @def_function.function(input_signature=[
                      tensor_spec.TensorSpec(shape=[3, 10], dtype=dtypes.float32)
                  ])
                  def model(x):
                    seq = array_ops.split(x, 3, 0)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 424..430

          Duplicated Code

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

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

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

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

              @def_function.function(input_signature=[
                  tensor_spec.TensorSpec(shape=[3, 10], dtype=dtypes.float32)
              ])
              def model(x):
                seq = array_ops.split(x, 3, 0)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 3 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 793..799

          Duplicated Code

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

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

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

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

              input_data = {
                  "i": constant_op.constant(np.random.randint(0, 3, dtype=np.int32)),
                  "x": constant_op.constant(
                      np.asarray(np.random.random_sample((10, 3)), dtype=np.float32)),
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 2 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 876..882

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 61.

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

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

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

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

          Refactorings

          Further Reading

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

                  input_data = {
                      "i":
                          constant_op.constant(np.random.randint(0, 3, dtype=np.int32)),
                      "x":
                          constant_op.constant(
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 2 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 502..505

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 61.

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

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

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

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

          Refactorings

          Further Reading

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

            def _freezeModel(self, func):
              """Freezes the function.
          
              Args:
                func: Function.
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 2 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 536..552

          Duplicated Code

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

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

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 _freezeModel(self, func):
              """Freezes the function.
          
              Args:
                func: Function.
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 2 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 167..183

          Duplicated Code

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

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

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

              @def_function.function(input_signature=[
                  tensor_spec.TensorSpec(shape=[3, 10, 10], dtype=dtypes.float32)
              ])
              def model(x):
                return rnn.dynamic_rnn(cell, x, dtype=dtypes.float32)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 2 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 862..866

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 51.

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

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

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

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

          Refactorings

          Further Reading

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

                  @def_function.function(input_signature=[
                      tensor_spec.TensorSpec(shape=[3, 10, 10], dtype=dtypes.float32)
                  ])
                  def model(x):
                    return rnn.dynamic_rnn(cell, x, dtype=dtypes.float32)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 2 hrs to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 489..493

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 51.

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

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

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

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

          Refactorings

          Further Reading

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

              @def_function.function(input_signature=[
                  tensor_spec.TensorSpec(shape=[2, 2], dtype=dtypes.float32)
              ])
              def model(x):
                return while_loop.while_loop(condition, body, [x])
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 820..824

          Duplicated Code

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

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

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

          Tuning

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

                  @def_function.function(input_signature=[
                      tensor_spec.TensorSpec(shape=[2, 2], dtype=dtypes.float32)
                  ])
                  def model(x):
                    return while_loop.while_loop(condition, body, [x])
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 449..453

          Duplicated Code

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

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

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

              for tensor in converted_concrete_func.inputs:
                actual_shape = input_data[tensor.name.split(":")[0]].shape
                self.assertEqual(tensor.shape, actual_shape)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 570..572

          Duplicated Code

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

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

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

              for tensor in converted_concrete_func.inputs:
                actual_shape = input_data[tensor.name.split(":")[0]].shape
                self.assertEqual(tensor.shape, actual_shape)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 201..203

          Duplicated Code

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

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

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

                  @def_function.function(input_signature=[
                      tensor_spec.TensorSpec(shape=(), dtype=dtypes.bool)
                  ])
                  def model(b):
                    return cond_v2.cond_v2(b, true_fn, false_fn)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 405..408

          Duplicated Code

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

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

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

              @def_function.function(
                  input_signature=[tensor_spec.TensorSpec(shape=(), dtype=dtypes.bool)])
              def model(b):
                return cond_v2.cond_v2(b, true_fn, false_fn)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 771..775

          Duplicated Code

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

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

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

          Tuning

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

              input_data = {
                  "x":
                      constant_op.constant(
                          np.array(
                              np.random.random_sample((3, 10, 10)), dtype=np.float32))
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 853..857

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 39.

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

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

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

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

          Refactorings

          Further Reading

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

                  input_data = {
                      "x":
                          constant_op.constant(
                              np.array(
                                  np.random.random_sample((3, 10, 10)), dtype=np.float32))
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 480..484

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 39.

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

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

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

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

          Refactorings

          Further Reading

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

              for expected, actual in zip(expected_value, actual_value):
                np.testing.assert_almost_equal(sess.run(expected), sess.run(actual))
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 566..567

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 38.

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

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

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

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

          Refactorings

          Further Reading

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

                  input_data = {
                      "x":
                          constant_op.constant(
                              np.array(
                                  np.random.random_sample((3, 10)), dtype=np.float32))
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 416..419

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 38.

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

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

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

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

          Refactorings

          Further Reading

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

              for expected, actual in zip(expected_value, actual_value):
                np.testing.assert_almost_equal(sess.run(expected), sess.run(actual))
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 583..584

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 38.

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

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

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

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

          Refactorings

          Further Reading

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

              input_data = {
                  "x":
                      constant_op.constant(
                          np.array(np.random.random_sample((3, 10)), dtype=np.float32))
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 1 hr to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 784..788

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 38.

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

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

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

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

          Refactorings

          Further Reading

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

              def branch2(x):
                x = array_ops.pad(x, [[0, 0], [0, 1]])
                return x + w2
          Severity: Minor
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 50 mins to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 897..899

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 36.

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

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

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

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

          Refactorings

          Further Reading

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

                  def branch2(x):
                    x = array_ops.pad(x, [[0, 0], [0, 1]])
                    return x + w2
          Severity: Minor
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 50 mins to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 518..520

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 36.

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

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

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

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

          Refactorings

          Further Reading

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

              root.f = def_function.function(lambda x: root.v1 * root.v2 * x)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 8 other locations - About 45 mins to fix
          tensorflow/lite/python/lite_flex_test.py on lines 137..137
          tensorflow/python/framework/convert_to_constants_test.py on lines 262..262
          tensorflow/python/framework/convert_to_constants_test.py on lines 279..279
          tensorflow/python/framework/convert_to_constants_test.py on lines 592..592
          tensorflow/python/framework/convert_to_constants_test.py on lines 608..608
          tensorflow/python/framework/convert_to_constants_test.py on lines 627..627
          tensorflow/python/framework/convert_to_constants_test.py on lines 677..677
          tensorflow/python/saved_model/save_test.py on lines 468..468

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

                  root.f = def_function.function(lambda x: root.v1 * root.v2 * x)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 8 other locations - About 45 mins to fix
          tensorflow/lite/python/lite_flex_test.py on lines 137..137
          tensorflow/python/framework/convert_to_constants_test.py on lines 245..245
          tensorflow/python/framework/convert_to_constants_test.py on lines 262..262
          tensorflow/python/framework/convert_to_constants_test.py on lines 279..279
          tensorflow/python/framework/convert_to_constants_test.py on lines 592..592
          tensorflow/python/framework/convert_to_constants_test.py on lines 608..608
          tensorflow/python/framework/convert_to_constants_test.py on lines 677..677
          tensorflow/python/saved_model/save_test.py on lines 468..468

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

                  root.f = def_function.function(lambda x: root.v1 * root.v2 * x)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 8 other locations - About 45 mins to fix
          tensorflow/lite/python/lite_flex_test.py on lines 137..137
          tensorflow/python/framework/convert_to_constants_test.py on lines 245..245
          tensorflow/python/framework/convert_to_constants_test.py on lines 262..262
          tensorflow/python/framework/convert_to_constants_test.py on lines 279..279
          tensorflow/python/framework/convert_to_constants_test.py on lines 592..592
          tensorflow/python/framework/convert_to_constants_test.py on lines 627..627
          tensorflow/python/framework/convert_to_constants_test.py on lines 677..677
          tensorflow/python/saved_model/save_test.py on lines 468..468

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

              root.f = def_function.function(lambda x: root.v1 * root.v2 * x)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 8 other locations - About 45 mins to fix
          tensorflow/lite/python/lite_flex_test.py on lines 137..137
          tensorflow/python/framework/convert_to_constants_test.py on lines 245..245
          tensorflow/python/framework/convert_to_constants_test.py on lines 279..279
          tensorflow/python/framework/convert_to_constants_test.py on lines 592..592
          tensorflow/python/framework/convert_to_constants_test.py on lines 608..608
          tensorflow/python/framework/convert_to_constants_test.py on lines 627..627
          tensorflow/python/framework/convert_to_constants_test.py on lines 677..677
          tensorflow/python/saved_model/save_test.py on lines 468..468

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

              root.f = def_function.function(lambda x: root.v1 * root.v2 * x)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 8 other locations - About 45 mins to fix
          tensorflow/lite/python/lite_flex_test.py on lines 137..137
          tensorflow/python/framework/convert_to_constants_test.py on lines 245..245
          tensorflow/python/framework/convert_to_constants_test.py on lines 262..262
          tensorflow/python/framework/convert_to_constants_test.py on lines 592..592
          tensorflow/python/framework/convert_to_constants_test.py on lines 608..608
          tensorflow/python/framework/convert_to_constants_test.py on lines 627..627
          tensorflow/python/framework/convert_to_constants_test.py on lines 677..677
          tensorflow/python/saved_model/save_test.py on lines 468..468

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

              root.f = def_function.function(lambda x: root.v1 * root.v2 * x)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 8 other locations - About 45 mins to fix
          tensorflow/lite/python/lite_flex_test.py on lines 137..137
          tensorflow/python/framework/convert_to_constants_test.py on lines 245..245
          tensorflow/python/framework/convert_to_constants_test.py on lines 262..262
          tensorflow/python/framework/convert_to_constants_test.py on lines 279..279
          tensorflow/python/framework/convert_to_constants_test.py on lines 608..608
          tensorflow/python/framework/convert_to_constants_test.py on lines 627..627
          tensorflow/python/framework/convert_to_constants_test.py on lines 677..677
          tensorflow/python/saved_model/save_test.py on lines 468..468

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

                  root.f = def_function.function(lambda x: root.v1 * root.v2 * x)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 8 other locations - About 45 mins to fix
          tensorflow/lite/python/lite_flex_test.py on lines 137..137
          tensorflow/python/framework/convert_to_constants_test.py on lines 245..245
          tensorflow/python/framework/convert_to_constants_test.py on lines 262..262
          tensorflow/python/framework/convert_to_constants_test.py on lines 279..279
          tensorflow/python/framework/convert_to_constants_test.py on lines 592..592
          tensorflow/python/framework/convert_to_constants_test.py on lines 608..608
          tensorflow/python/framework/convert_to_constants_test.py on lines 627..627
          tensorflow/python/saved_model/save_test.py on lines 468..468

          Duplicated Code

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

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

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

                  _ = control_flow_case.case([(gen_math_ops.less(x, y), lambda: x)],
                                             default=lambda: y)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 2 other locations - About 45 mins to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 1303..1304
          tensorflow/python/framework/convert_to_constants_test.py on lines 1354..1355

          Duplicated Code

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

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

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

                  _ = control_flow_case.case([(gen_math_ops.less(x, y), lambda: a)],
                                             default=lambda: y)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 2 other locations - About 45 mins to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 1303..1304
          tensorflow/python/framework/convert_to_constants_test.py on lines 1416..1417

          Duplicated Code

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

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

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

                  _ = control_flow_case.case([(gen_math_ops.less(x, y), lambda: x)],
                                             default=lambda: y)
          Severity: Major
          Found in tensorflow/python/framework/convert_to_constants_test.py and 2 other locations - About 45 mins to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 1354..1355
          tensorflow/python/framework/convert_to_constants_test.py on lines 1416..1417

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 35.

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

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

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

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

          Refactorings

          Further Reading

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

              for expected, actual in zip(expected_value, actual_value):
                np.testing.assert_almost_equal(expected.numpy(), actual.numpy())
          Severity: Minor
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 40 mins to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 197..198

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 34.

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

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

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

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

          Refactorings

          Further Reading

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

              for expected, actual in zip(expected_value, actual_value):
                np.testing.assert_almost_equal(expected.numpy(), actual.numpy())
          Severity: Minor
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 40 mins to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 214..215

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 34.

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

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

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

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

          Refactorings

          Further Reading

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

              input_data = {
                  "x": constant_op.constant([1., 2.], shape=[1, 2]),
                  "b": constant_op.constant(True)
          Severity: Minor
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 35 mins to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 732..734

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 33.

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

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

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

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

          Refactorings

          Further Reading

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

                  input_data = {
                      "x": constant_op.constant([1., 2.], shape=[1, 2]),
                      "b": constant_op.constant(True)
          Severity: Minor
          Found in tensorflow/python/framework/convert_to_constants_test.py and 1 other location - About 35 mins to fix
          tensorflow/python/framework/convert_to_constants_test.py on lines 368..370

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 33.

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

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

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

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

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status