tensorflow/tensorflow

View on GitHub
tensorflow/lite/python/lite_test.py

Summary

Maintainability
F
1 mo
Test Coverage

File lite_test.py has 2236 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2018 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/lite/python/lite_test.py - About 6 days to fix

    FromSessionTest has 43 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class FromSessionTest(TestModels, parameterized.TestCase):
    
      def testFloatModel(self):
        with ops.Graph().as_default():
          in_tensor = array_ops.placeholder(
    Severity: Minor
    Found in tensorflow/lite/python/lite_test.py - About 5 hrs to fix

      Function testFunctionalSequentialModel has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def testFunctionalSequentialModel(self):
          """Test a Functional tf.keras model containing a Sequential model."""
          model = keras.models.Sequential()
          model.add(keras.layers.Dense(2, input_shape=(3,)))
          model.add(keras.layers.RepeatVector(3))
      Severity: Minor
      Found in tensorflow/lite/python/lite_test.py - About 1 hr to fix

        Function testIntegerQuantizationWithUnsupportedOps has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          def testIntegerQuantizationWithUnsupportedOps(self,
                                                        is_int_only,
                                                        is_int16_quantize,
                                                        inference_input_output_type,
                                                        enable_mlir_quantizer=False):
        Severity: Minor
        Found in tensorflow/lite/python/lite_test.py - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function testQuantizeInt8AllowFloat has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def testQuantizeInt8AllowFloat(self):
            with ops.Graph().as_default():
              inp, output, calibration_gen = self._getIntegerQuantizeModel()
              sess = session.Session()
        
        
        Severity: Minor
        Found in tensorflow/lite/python/lite_test.py - About 1 hr to fix

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

            def testQuantizeFloat16(self, use_rep_data, include_int8,
                                    is_float16_quantized, is_float16_accumulation,
                                    is_post_training_quantized, enable_mlir_quantizer,
                                    expected_opt_modes):
              with ops.Graph().as_default():
          Severity: Minor
          Found in tensorflow/lite/python/lite_test.py - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function testQuantizeInt8And16x8 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def testQuantizeInt8And16x8(self, supported_ops, expected_opt_modes):
              with ops.Graph().as_default():
                inp, output, calibration_gen = self._getIntegerQuantizeModel()
                sess = session.Session()
          
          
          Severity: Minor
          Found in tensorflow/lite/python/lite_test.py - About 1 hr to fix

            Function testQuantizeFloat16 has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def testQuantizeFloat16(self, use_rep_data, include_int8,
            Severity: Major
            Found in tensorflow/lite/python/lite_test.py - About 50 mins to fix

              Function testDisablePerChannelQuantization has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def testDisablePerChannelQuantization(self,
                                                      disable_per_channel=False,
                                                      enable_mlir_quantizer=False,
                                                      representative_dataset=True):
                  if enable_mlir_quantizer:
              Severity: Minor
              Found in tensorflow/lite/python/lite_test.py - About 45 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

              Function testModifyIOToUint8 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def testModifyIOToUint8(self):
                  # Tests the object detection model that cannot be loaded in TensorFlow.
                  self._initObjectDetectionArgs()
              
                  def representative_dataset_gen():
              Severity: Minor
              Found in tensorflow/lite/python/lite_test.py - About 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                def testPbtxt(self):
                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[1, 16, 16, 3], dtype=dtypes.float32)
                    _ = in_tensor + in_tensor
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 3 days to fix
              tensorflow/lite/python/lite_test.py on lines 1628..1662

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 387.

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

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

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testFloat(self):
                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[1, 16, 16, 3], dtype=dtypes.float32)
                    _ = in_tensor + in_tensor
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 3 days to fix
              tensorflow/lite/python/lite_test.py on lines 1762..1796

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 387.

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

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

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 testSequentialModelInputArray(self):
                  """Test a Sequential tf.keras model testing input arrays argument."""
                  ops.disable_eager_execution()
                  self._getSequentialModel()
              
              
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 6 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 2410..2426

              Duplicated Code

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

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

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both 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 testSequentialModelOutputArray(self):
                  """Test a Sequential tf.keras model testing output arrays argument."""
                  ops.disable_eager_execution()
                  self._getSequentialModel()
              
              
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 6 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 2365..2381

              Duplicated Code

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

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

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

                  with ops.Graph().as_default():
                    in_tensor_1 = array_ops.placeholder(
                        shape=[33, 33], dtype=dtypes.float32, name='inputA')
                    in_tensor_2 = constant_op.constant(
                        np.random.uniform(low=-10., high=10., size=(33, 33)),
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 6 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 826..837
              tensorflow/lite/python/lite_test.py on lines 1036..1047

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 106.

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

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

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

                  with ops.Graph().as_default():
                    # We need the tensor to have more than 1024 elements for quantize_weights
                    # to kick in. Thus, the [33, 33] shape.
                    in_tensor_1 = array_ops.placeholder(
                        shape=[33, 33], dtype=dtypes.float32, name='inputA')
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 6 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 826..837
              tensorflow/lite/python/lite_test.py on lines 858..867

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 106.

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

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

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

                  with ops.Graph().as_default():
                    # We need the tensor to have more than 1024 elements for quantize_weights
                    # to kick in. Thus, the [33, 33] shape.
                    in_tensor_1 = array_ops.placeholder(
                        shape=[33, 33], dtype=dtypes.float32, name='inputA')
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 6 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 858..867
              tensorflow/lite/python/lite_test.py on lines 1036..1047

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 106.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    placeholder = array_ops.placeholder(
                        dtype=dtypes.float32, shape=[1], name='input')
                    variable_node = variables.Variable(1.0, name='variable_node')
                    defun_node = plus_placeholder(variable_node, placeholder)
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 6 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 1587..1596

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 102.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    placeholder = array_ops.placeholder(
                        dtype=dtypes.float32, shape=[1], name='input')
                    variable_node = variables.Variable(1.0, name='variable_node')
                    defun_node = plus_placeholder(variable_node, placeholder)
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 6 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 1396..1405

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 102.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor_1 = array_ops.placeholder(
                        shape=[1, 16, 16, 3], dtype=dtypes.float32, name='inputA')
                    in_tensor_2 = array_ops.placeholder(
                        shape=[1, 16, 16, 3], dtype=dtypes.float32, name='inputB')
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 4 other locations - About 6 hrs to fix
              tensorflow/lite/python/convert_test.py on lines 182..189
              tensorflow/lite/python/convert_test.py on lines 229..236
              tensorflow/lite/python/lite_test.py on lines 1279..1286
              tensorflow/lite/python/tflite_convert_test.py on lines 196..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 100.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor_1 = array_ops.placeholder(
                        shape=[1, 16, 16, 3], dtype=dtypes.float32, name='inputA')
                    in_tensor_2 = array_ops.placeholder(
                        shape=[1, 16, 16, 3], dtype=dtypes.float32, name='inputB')
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 4 other locations - About 6 hrs to fix
              tensorflow/lite/python/convert_test.py on lines 182..189
              tensorflow/lite/python/convert_test.py on lines 229..236
              tensorflow/lite/python/lite_test.py on lines 1063..1070
              tensorflow/lite/python/tflite_convert_test.py on lines 196..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 100.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    with session.Session() as sess:
                      in_tensor_1 = array_ops.placeholder(
                          shape=shape, dtype=dtypes.float32, name='inputB')
                      in_tensor_2 = array_ops.placeholder(
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 5 hrs to fix
              tensorflow/lite/python/convert_saved_model_test.py on lines 52..60

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 95.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[1, 16, 16, 3], dtype=dtypes.float32)
                    out_tensor = array_ops.fake_quant_with_min_max_args(
                        in_tensor + in_tensor, min=0., max=1., name='output')
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 3 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 1461..1466

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 71.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[1, 16, 16, 3], dtype=dtypes.float32)
                    out_tensor = array_ops.fake_quant_with_min_max_args(
                        in_tensor + in_tensor, min=0., max=1., name='output')
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 3 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 1493..1498

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 71.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[1, 16, 16, 3], dtype=dtypes.float32)
                    out_tensor = array_ops.fake_quant_with_min_max_args(
                        in_tensor + in_tensor, min=0., max=1.)
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 3 hrs to fix
              tensorflow/lite/python/convert_test.py on lines 132..137

              Duplicated Code

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

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

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

                  if not os.path.exists(filename):
                    filename = os.path.join(
                        resource_loader.get_root_dir_with_all_resources(),
                        '../tflite_mobilenet_ssd_quant_protobuf/tflite_graph.pb')
                    if not os.path.exists(filename):
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 3 hrs to fix
              tensorflow/lite/python/tflite_convert_test.py on lines 370..375

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 63.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[None, 16, 16, 3], dtype=dtypes.float32, name='in_tensor')
                    math_ops.add(in_tensor, in_tensor, name='add')
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 207..211
              tensorflow/lite/python/metrics/metrics_nonportable_test.py on lines 131..135

              Duplicated Code

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

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

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[None, 16, 16, 3], dtype=dtypes.float32, name='in_tensor')
                    math_ops.add(in_tensor, in_tensor, name='add')
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 150..154
              tensorflow/lite/python/metrics/metrics_nonportable_test.py on lines 131..135

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 61.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[1, None, 16, 3], dtype=dtypes.float32)
                    out_tensor = in_tensor + in_tensor
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 2 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 581..585

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 55.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[1, None, 16, 3], dtype=dtypes.float32)
                    out_tensor = in_tensor + in_tensor
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 2 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 562..566

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 55.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[None, 16, 16, 3], dtype=dtypes.float32)
                    out_tensor = in_tensor + in_tensor
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 1666..1670
              tensorflow/lite/python/lite_test.py on lines 1694..1698

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 55.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[None, 16, 16, 3], dtype=dtypes.float32)
                    _ = in_tensor + in_tensor
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 654..658
              tensorflow/lite/python/lite_test.py on lines 1694..1698

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 55.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(
                        shape=[None, 16, 16, 3], dtype=dtypes.float32)
                    _ = in_tensor + in_tensor
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/lite/python/lite_test.py on lines 654..658
              tensorflow/lite/python/lite_test.py on lines 1666..1670

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 55.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    in_tensor = array_ops.placeholder(shape=[2, 2], dtype=dtypes.float32)
                    out_tensor = in_tensor + in_tensor
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 2 hrs to fix
              tensorflow/lite/python/lite_flex_test.py on lines 51..54
              tensorflow/lite/python/lite_flex_test.py on lines 93..96

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 53.

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

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

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ 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 calibration_gen():
                    for _ in range(5):
                      yield [np.random.uniform(-1, 1, size=(1, 5, 5, 3)).astype(np.float32)]
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 1 hr to fix
              tensorflow/lite/python/metrics/metrics_nonportable_test.py on lines 195..197

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 47.

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

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

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

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

              Refactorings

              Further Reading

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

                  interpreter.set_tensor(input_details[1]['index'],
                                         np.array([[1, 1], [1, 1]], dtype=np.int32))
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 1 hr to fix
              tensorflow/lite/python/lite_test.py on lines 1576..1577

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 43.

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

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

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

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

              Refactorings

              Further Reading

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

                  interpreter.set_tensor(input_details[1]['index'],
                                         np.array([[2, 2], [2, 2]], dtype=np.int32))
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 1 other location - About 1 hr to fix
              tensorflow/lite/python/lite_test.py on lines 1570..1571

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 43.

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

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

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

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

              Refactorings

              Further Reading

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

                  matrix_b_values = [
                      0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 1
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 1 hr to fix
              tensorflow/lite/python/lite_test.py on lines 2745..2747
              tensorflow/lite/python/lite_test.py on lines 2762..2764

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 38.

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

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

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

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

              Refactorings

              Further Reading

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

                  matrix_b_values = [
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 1, 0
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 1 hr to fix
              tensorflow/lite/python/lite_test.py on lines 2729..2731
              tensorflow/lite/python/lite_test.py on lines 2762..2764

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 38.

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

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

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

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

              Refactorings

              Further Reading

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

                  matrix_b_values = [
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 1, 0
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 2 other locations - About 1 hr to fix
              tensorflow/lite/python/lite_test.py on lines 2729..2731
              tensorflow/lite/python/lite_test.py on lines 2745..2747

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 38.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    inp, output, calibration_gen = self._getIntegerQuantizeModel()
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 5 other locations - About 40 mins to fix
              tensorflow/lite/python/lite_test.py on lines 898..900
              tensorflow/lite/python/lite_test.py on lines 955..957
              tensorflow/lite/python/lite_test.py on lines 1157..1159
              tensorflow/lite/python/lite_test.py on lines 1216..1218
              tensorflow/lite/python/lite_test.py on lines 1301..1303

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    inp, output, _ = self._getIntegerQuantizeModel()
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 5 other locations - About 40 mins to fix
              tensorflow/lite/python/lite_test.py on lines 898..900
              tensorflow/lite/python/lite_test.py on lines 955..957
              tensorflow/lite/python/lite_test.py on lines 1002..1004
              tensorflow/lite/python/lite_test.py on lines 1157..1159
              tensorflow/lite/python/lite_test.py on lines 1301..1303

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    inp, output, calibration_gen = self._getIntegerQuantizeModel()
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 5 other locations - About 40 mins to fix
              tensorflow/lite/python/lite_test.py on lines 955..957
              tensorflow/lite/python/lite_test.py on lines 1002..1004
              tensorflow/lite/python/lite_test.py on lines 1157..1159
              tensorflow/lite/python/lite_test.py on lines 1216..1218
              tensorflow/lite/python/lite_test.py on lines 1301..1303

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    inp, output, calibration_gen = self._getIntegerQuantizeModel()
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 5 other locations - About 40 mins to fix
              tensorflow/lite/python/lite_test.py on lines 898..900
              tensorflow/lite/python/lite_test.py on lines 955..957
              tensorflow/lite/python/lite_test.py on lines 1002..1004
              tensorflow/lite/python/lite_test.py on lines 1157..1159
              tensorflow/lite/python/lite_test.py on lines 1216..1218

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    inp, output, calibration_gen = self._getIntegerQuantizeModel()
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 5 other locations - About 40 mins to fix
              tensorflow/lite/python/lite_test.py on lines 898..900
              tensorflow/lite/python/lite_test.py on lines 1002..1004
              tensorflow/lite/python/lite_test.py on lines 1157..1159
              tensorflow/lite/python/lite_test.py on lines 1216..1218
              tensorflow/lite/python/lite_test.py on lines 1301..1303

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

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

                  with ops.Graph().as_default():
                    inp, output, calibration_gen = self._getIntegerQuantizeModel()
                    sess = session.Session()
              Severity: Major
              Found in tensorflow/lite/python/lite_test.py and 5 other locations - About 40 mins to fix
              tensorflow/lite/python/lite_test.py on lines 898..900
              tensorflow/lite/python/lite_test.py on lines 955..957
              tensorflow/lite/python/lite_test.py on lines 1002..1004
              tensorflow/lite/python/lite_test.py on lines 1216..1218
              tensorflow/lite/python/lite_test.py on lines 1301..1303

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

              There are no issues that match your filters.

              Category
              Status