tensorflow/models

View on GitHub
research/object_detection/exporter_tf1_test.py

Summary

Maintainability
F
3 wks
Test Coverage

File exporter_tf1_test.py has 1094 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2017 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 research/object_detection/exporter_tf1_test.py - About 2 days to fix

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

    class ExportInferenceGraphTest(tf.test.TestCase):
    
      def _save_checkpoint_from_mock_model(self,
                                           checkpoint_path,
                                           use_moving_averages,
    Severity: Minor
    Found in research/object_detection/exporter_tf1_test.py - About 4 hrs to fix

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

          with self.test_session(graph=inference_graph) as sess:
            tf_example = inference_graph.get_tensor_by_name('tf_example:0')
            boxes = inference_graph.get_tensor_by_name('detection_boxes:0')
            scores = inference_graph.get_tensor_by_name('detection_scores:0')
            classes = inference_graph.get_tensor_by_name('detection_classes:0')
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 2 days to fix
      research/object_detection/exporter_tf1_test.py on lines 697..719

      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 268.

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

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

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

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

      Refactorings

      Further Reading

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

          with self.test_session(graph=inference_graph) as sess:
            tf_example = inference_graph.get_tensor_by_name('tf_example:0')
            boxes = inference_graph.get_tensor_by_name('detection_boxes:0')
            scores = inference_graph.get_tensor_by_name('detection_scores:0')
            classes = inference_graph.get_tensor_by_name('detection_classes:0')
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 2 days to fix
      research/object_detection/exporter_tf1_test.py on lines 761..783

      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 268.

      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 test_export_graph_with_fixed_size_tf_example_input(self):
          input_shape = [1, 320, 320, 3]
      
          tmp_dir = self.get_temp_dir()
          trained_checkpoint_prefix = os.path.join(tmp_dir, 'model.ckpt')
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 1 day to fix
      research/object_detection/exporter_tf1_test.py on lines 308..329

      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 175.

      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 test_export_graph_with_fixed_size_encoded_image_string_input(self):
          input_shape = [1, 320, 320, 3]
      
          tmp_dir = self.get_temp_dir()
          trained_checkpoint_prefix = os.path.join(tmp_dir, 'model.ckpt')
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 1 day to fix
      research/object_detection/exporter_tf1_test.py on lines 266..287

      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 175.

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

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

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

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

      Refactorings

      Further Reading

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

        def test_export_graph_with_encoded_image_string_input(self):
          tmp_dir = self.get_temp_dir()
          trained_checkpoint_prefix = os.path.join(tmp_dir, 'model.ckpt')
          self._save_checkpoint_from_mock_model(trained_checkpoint_prefix,
                                                use_moving_averages=False)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 2 other locations - About 1 day to fix
      research/object_detection/exporter_tf1_test.py on lines 175..192
      research/object_detection/exporter_tf1_test.py on lines 247..264

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 149.

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

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

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

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

      Refactorings

      Further Reading

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

        def test_export_graph_with_tf_example_input(self):
          tmp_dir = self.get_temp_dir()
          trained_checkpoint_prefix = os.path.join(tmp_dir, 'model.ckpt')
          self._save_checkpoint_from_mock_model(trained_checkpoint_prefix,
                                                use_moving_averages=False)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 2 other locations - About 1 day to fix
      research/object_detection/exporter_tf1_test.py on lines 175..192
      research/object_detection/exporter_tf1_test.py on lines 289..306

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 149.

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

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

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

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

      Refactorings

      Further Reading

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

        def test_export_graph_with_image_tensor_input(self):
          tmp_dir = self.get_temp_dir()
          trained_checkpoint_prefix = os.path.join(tmp_dir, 'model.ckpt')
          self._save_checkpoint_from_mock_model(trained_checkpoint_prefix,
                                                use_moving_averages=False)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 2 other locations - About 1 day to fix
      research/object_detection/exporter_tf1_test.py on lines 247..264
      research/object_detection/exporter_tf1_test.py on lines 289..306

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 149.

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

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

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

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

      Refactorings

      Further Reading

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

            with tf.name_scope('nearest_upsampling'):
              x_2 = array_ops.placeholder(dtypes.float32, shape=(8, 10, 10, 8))
              x_2_stack_1 = tf.stack([x_2] * 2, axis=3)
              x_2_reshape_1 = tf.reshape(x_2_stack_1, [8, 10, 20, 8])
              x_2_stack_2 = tf.stack([x_2_reshape_1] * 2, axis=2)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 7 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 1170..1175

      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 112.

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

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

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

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

      Refactorings

      Further Reading

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

            with tf.name_scope('nearest_upsampling'):
              x_1 = array_ops.placeholder(dtypes.float32, shape=(8, 10, 10, 8))
              x_1_stack_1 = tf.stack([x_1] * 2, axis=3)
              x_1_reshape_1 = tf.reshape(x_1_stack_1, [8, 10, 20, 8])
              x_1_stack_2 = tf.stack([x_1_reshape_1] * 2, axis=2)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 7 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 1177..1182

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 112.

      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 op in g.get_operations():
            if op.type == 'ResizeNearestNeighbor':
              resize_op_found = True
              self.assertEqual(op.inputs[0].op.type, 'FakeQuantWithMinMaxVars')
              self.assertEqual(op.outputs[0].consumers()[0], t.op)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 4 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 1114..1119

      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 80.

      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 op in g.get_operations():
            if op.type == 'ResizeNearestNeighbor':
              resize_op_found = True
              self.assertEqual(op.inputs[0].op.type, 'FakeQuantWithMinMaxVars')
              self.assertEqual(op.outputs[0].consumers()[0], t.op)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 4 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 1158..1163

      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 80.

      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 op in g.get_operations():
            if op.type == 'ResizeNearestNeighbor':
              resize_op_found = True
              self.assertEqual(op.inputs[0], x)
              self.assertEqual(op.outputs[0].consumers()[0], t.op)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 4 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 1132..1137

      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 76.

      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 op in g.get_operations():
            if op.type == 'ResizeNearestNeighbor':
              resize_op_found = True
              self.assertEqual(op.inputs[0], x)
              self.assertEqual(op.outputs[0].consumers()[0], t.op)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 4 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 1087..1092

      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 76.

      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 mock.patch.object(
              model_builder, 'build', autospec=True) as mock_builder:
            mock_builder.return_value = FakeModel(
                add_detection_keypoints=True, add_detection_masks=True)
            pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 524..530
      research/object_detection/exporter_tf1_test.py on lines 581..587
      research/object_detection/exporter_tf1_test.py on lines 640..646
      research/object_detection/exporter_tf1_test.py on lines 818..824
      research/object_detection/exporter_tf1_test.py on lines 965..971

      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 73.

      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 mock.patch.object(
              model_builder, 'build', autospec=True) as mock_builder:
            mock_builder.return_value = FakeModel(
                add_detection_keypoints=True, add_detection_masks=True)
            pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 524..530
      research/object_detection/exporter_tf1_test.py on lines 581..587
      research/object_detection/exporter_tf1_test.py on lines 640..646
      research/object_detection/exporter_tf1_test.py on lines 682..688
      research/object_detection/exporter_tf1_test.py on lines 965..971

      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 73.

      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 mock.patch.object(
              model_builder, 'build', autospec=True) as mock_builder:
            mock_builder.return_value = FakeModel(
                add_detection_keypoints=True, add_detection_masks=True)
            pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 524..530
      research/object_detection/exporter_tf1_test.py on lines 581..587
      research/object_detection/exporter_tf1_test.py on lines 682..688
      research/object_detection/exporter_tf1_test.py on lines 818..824
      research/object_detection/exporter_tf1_test.py on lines 965..971

      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 73.

      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 mock.patch.object(
              model_builder, 'build', autospec=True) as mock_builder:
            mock_builder.return_value = FakeModel(
                add_detection_keypoints=True, add_detection_masks=True)
            pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 581..587
      research/object_detection/exporter_tf1_test.py on lines 640..646
      research/object_detection/exporter_tf1_test.py on lines 682..688
      research/object_detection/exporter_tf1_test.py on lines 818..824
      research/object_detection/exporter_tf1_test.py on lines 965..971

      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 73.

      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 mock.patch.object(
              model_builder, 'build', autospec=True) as mock_builder:
            mock_builder.return_value = FakeModel(
                add_detection_keypoints=True, add_detection_masks=True)
            pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 524..530
      research/object_detection/exporter_tf1_test.py on lines 640..646
      research/object_detection/exporter_tf1_test.py on lines 682..688
      research/object_detection/exporter_tf1_test.py on lines 818..824
      research/object_detection/exporter_tf1_test.py on lines 965..971

      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 73.

      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 mock.patch.object(
              model_builder, 'build', autospec=True) as mock_builder:
            mock_builder.return_value = FakeModel(
                add_detection_keypoints=True, add_detection_masks=True)
            pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 524..530
      research/object_detection/exporter_tf1_test.py on lines 581..587
      research/object_detection/exporter_tf1_test.py on lines 640..646
      research/object_detection/exporter_tf1_test.py on lines 682..688
      research/object_detection/exporter_tf1_test.py on lines 818..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 73.

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

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

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

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

      Refactorings

      Further Reading

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

          with mock.patch.object(
              model_builder, 'build', autospec=True) as mock_builder:
            mock_builder.return_value = FakeModel(add_detection_masks=False)
            pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
            exporter.export_inference_graph(
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 494..498

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 61.

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

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

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

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

      Refactorings

      Further Reading

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

          with mock.patch.object(
              model_builder, 'build', autospec=True) as mock_builder:
            mock_builder.return_value = FakeModel(add_detection_features=True)
            pipeline_config = pipeline_pb2.TrainEvalPipelineConfig()
            exporter.export_inference_graph(
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/exporter_tf1_test.py on lines 465..469

      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 4 locations. Consider refactoring.
      Open

          tf_example_np = np.hstack([self._create_tf_example(
              np.ones((4, 4, 3)).astype(np.uint8))] * 2)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 3 other locations - About 1 hr to fix
      research/object_detection/exporter_tf1_test.py on lines 916..917
      research/object_detection/exporter_tf1_test.py on lines 977..978
      research/object_detection/exporter_tf1_test.py on lines 1038..1039

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 43.

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

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

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

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

      Refactorings

      Further Reading

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

          tf_example_np = np.hstack([self._create_tf_example(
              np.ones((4, 4, 3)).astype(np.uint8))] * 2)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 3 other locations - About 1 hr to fix
      research/object_detection/exporter_tf1_test.py on lines 830..831
      research/object_detection/exporter_tf1_test.py on lines 916..917
      research/object_detection/exporter_tf1_test.py on lines 1038..1039

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 43.

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

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

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

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

      Refactorings

      Further Reading

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

          tf_example_np = np.hstack([self._create_tf_example(
              np.ones((4, 4, 3)).astype(np.uint8))] * 2)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 3 other locations - About 1 hr to fix
      research/object_detection/exporter_tf1_test.py on lines 830..831
      research/object_detection/exporter_tf1_test.py on lines 916..917
      research/object_detection/exporter_tf1_test.py on lines 977..978

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 43.

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

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

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

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

      Refactorings

      Further Reading

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

          tf_example_np = np.hstack([self._create_tf_example(
              np.ones((4, 4, 3)).astype(np.uint8))] * 2)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 3 other locations - About 1 hr to fix
      research/object_detection/exporter_tf1_test.py on lines 830..831
      research/object_detection/exporter_tf1_test.py on lines 977..978
      research/object_detection/exporter_tf1_test.py on lines 1038..1039

      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

            if self._add_detection_masks:
              postprocessed_tensors['detection_masks'] = tf.constant(
                  np.arange(64).reshape([2, 2, 4, 4]), tf.float32)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 1 hr to fix
      research/object_detection/exporter_tf1_test.py on lines 91..93

      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

            if self._add_detection_keypoints:
              postprocessed_tensors['detection_keypoints'] = tf.constant(
                  np.arange(48).reshape([2, 2, 6, 2]), tf.float32)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 1 hr to fix
      research/object_detection/exporter_tf1_test.py on lines 94..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 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

            if enable_quantization:
              graph_rewriter_config = graph_rewriter_pb2.GraphRewriter()
              graph_rewriter_config.quantization.delay = 500000
              graph_rewriter_fn = graph_rewriter_builder.build(
                  graph_rewriter_config, is_training=False)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 1 hr to fix
      research/object_detection/export_tflite_ssd_graph_lib_tf1_test.py on lines 105..110

      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

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

            exporter.freeze_graph_with_def_protos(
                input_graph_def=tf.get_default_graph().as_graph_def(),
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 1 hr to fix
      research/object_detection/exporter.py on lines 561..562

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 41.

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

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

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

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

      Refactorings

      Further Reading

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

          tf_example_np = np.expand_dims(self._create_tf_example(
              np.ones((4, 4, 3)).astype(np.uint8)), axis=0)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 1 hr to fix
      research/object_detection/exporter_tf1_test.py on lines 695..696

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 39.

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

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

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

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

      Refactorings

      Further Reading

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

                'raw_detection_boxes': tf.constant([[[0.0, 0.0, 0.5, 0.5],
                                                     [0.5, 0.5, 0.8, 0.8]],
                                                    [[0.5, 0.5, 1.0, 1.0],
                                                     [0.0, 0.5, 0.0, 0.5]]],
                                                   tf.float32),
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 3 other locations - About 1 hr to fix
      research/object_detection/export_tflite_graph_lib_tf2_test.py on lines 72..74
      research/object_detection/exporter_lib_tf2_test.py on lines 65..68
      research/object_detection/exporter_tf1_test.py on lines 71..74

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 39.

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

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

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

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

      Refactorings

      Further Reading

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

                'detection_boxes': tf.constant([[[0.0, 0.0, 0.5, 0.5],
                                                 [0.5, 0.5, 0.8, 0.8]],
                                                [[0.5, 0.5, 1.0, 1.0],
                                                 [0.0, 0.0, 0.0, 0.0]]], tf.float32),
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 3 other locations - About 1 hr to fix
      research/object_detection/export_tflite_graph_lib_tf2_test.py on lines 72..74
      research/object_detection/exporter_lib_tf2_test.py on lines 65..68
      research/object_detection/exporter_tf1_test.py on lines 83..87

      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

          tf_example_np = np.expand_dims(self._create_tf_example(
              np.ones((4, 4, 3)).astype(np.uint8)), axis=0)
      Severity: Major
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 1 hr to fix
      research/object_detection/exporter_tf1_test.py on lines 759..760

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 39.

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

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

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

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

      Refactorings

      Further Reading

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

              (boxes_np, scores_np, multiclass_scores_np, classes_np, keypoints_np,
               masks_np, num_detections_np) = sess.run(
                   [boxes, scores, multiclass_scores, classes, keypoints, masks,
                    num_detections],
                   feed_dict={tf_example: tf_example_np})
      Severity: Minor
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 45 mins to fix
      research/object_detection/exporter_tf1_test.py on lines 611..617

      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 2 locations. Consider refactoring.
      Open

              (boxes_np, scores_np, multiclass_scores_np, classes_np, keypoints_np,
               masks_np, num_detections_np) = sess.run(
                   [
                       boxes, scores, multiclass_scores, classes, keypoints, masks,
                       num_detections
      Severity: Minor
      Found in research/object_detection/exporter_tf1_test.py and 1 other location - About 45 mins to fix
      research/object_detection/exporter_tf1_test.py on lines 856..860

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 35.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status