tensorflow/models

View on GitHub
research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py

Summary

Maintainability
F
1 mo
Test Coverage

File faster_rcnn_meta_arch_test_lib.py has 1890 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

    FasterRCNNMetaArchTestBase has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class FasterRCNNMetaArchTestBase(test_case.TestCase, parameterized.TestCase):
      """Base class to test Faster R-CNN and R-FCN meta architectures."""
    
      def _build_arg_scope_with_hyperparams(self,
                                            hyperparams_text_proto,

      Function _build_model has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

        def _build_model(self,
                         is_training,
                         number_of_stages,
                         second_stage_batch_size,
                         first_stage_max_proposals=8,

      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 _build_model has 19 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def _build_model(self,

        Function _build_model has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def _build_model(self,
                           is_training,
                           number_of_stages,
                           second_stage_batch_size,
                           first_stage_max_proposals=8,

          Function graph_fn has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def graph_fn(anchors, rpn_box_encodings,

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

              def _get_second_stage_box_predictor(self, num_classes, is_training,

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

              class FakeFasterRCNNKerasFeatureExtractor(
                  faster_rcnn_meta_arch.FasterRCNNKerasFeatureExtractor):
                """Fake feature extractor to use in tests."""
              
                def __init__(self):
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 76..108

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

              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 image_resizer_fn(image, masks=None):
                    """Fake image resizer function."""
                    resized_inputs = []
                    resized_image = tf.identity(image)
                    if pad_to_max_dimension is not None:
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 225..243

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

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

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

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

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

              Refactorings

              Further Reading

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

              class FakeFasterRCNNFeatureExtractor(
                  faster_rcnn_meta_arch.FasterRCNNFeatureExtractor):
                """Fake feature extractor to use in tests."""
              
                def __init__(self):
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 50..72

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

              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 test_graph_classification.as_default():
                    image = tf.placeholder(dtype=tf.float32, shape=[1, 20, 20, 3])
                    with tf.variable_scope('mock_model'):
                      net = slim.conv2d(image, num_outputs=3, kernel_size=1, scope='layer1')
                      slim.conv2d(net, num_outputs=3, kernel_size=1, scope='layer2')
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 581..593

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

              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 _get_second_stage_box_predictor(self, num_classes, is_training,
                                                    predict_masks, masks_are_class_agnostic,
                                                    share_box_across_classes=False,
                                                    use_keras=False):
                  box_predictor_proto = box_predictor_pb2.BoxPredictor()
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 174..202

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

              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

                  proposal_boxes = np.array(
                      [[[0, 0, 16, 16],
                        [0, 16, 16, 32],
                        [16, 0, 32, 16],
                        [0, 0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1986..1998

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

              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

                    proposal_boxes = tf.constant(
                        [[[0, 0, 16, 16],  # first image
                          [0, 16, 16, 32],
                          [16, 0, 32, 16],
                          [0, 0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1795..1807

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

              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

                    class_predictions_with_background = tf.constant(
                        [[-10, 10, -10],  # first image
                         [-10, -10, 10],
                         [10, -10, -10],
                         [0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1813..1825

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

              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

                  class_predictions_with_background = np.array(
                      [[-10, 10, -10],  # first image
                       [10, -10, -10],
                       [10, -10, -10],
                       [0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2004..2016

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

              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

                    rpn_objectness_predictions_with_background = tf.constant(
                        [[[-10, 13], [10, -10], [10, -11], [-10, 12]],
                         [[10, -10], [-10, 13], [-10, 12], [10, -11]],
                         [[10, -10], [-10, 13], [-10, 12], [10, -11]]],
                        dtype=tf.float32)
              research/object_detection/utils/test_utils_test.py on lines 43..54

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

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

                  expected_raw_proposal_boxes = [[[0., 0., 0.5, 0.5], [0., 0.5, 0.5, 1.],
                                                  [0.5, 0., 1., 0.5], [0.5, 0.5, 1., 1.]],
                                                 [[0., 0., 0.5, 0.5], [0., 0.5, 0.5, 1.],
                                                  [0.5, 0., 1., 0.5], [0.5, 0.5, 1., 1.]]]
              official/vision/dataloaders/tf_example_decoder_test.py on lines 103..110
              official/vision/dataloaders/tf_example_decoder_test.py on lines 225..232
              official/vision/dataloaders/tf_example_label_map_decoder_test.py on lines 106..113
              research/object_detection/core/batch_multiclass_nms_test.py on lines 453..460
              research/object_detection/core/batch_multiclass_nms_test.py on lines 528..535
              research/object_detection/core/target_assigner_test.py on lines 534..541
              research/object_detection/core/target_assigner_test.py on lines 583..590
              research/object_detection/core/target_assigner_test.py on lines 591..598
              research/object_detection/core/target_assigner_test.py on lines 599..606
              research/object_detection/core/target_assigner_test.py on lines 658..665
              research/object_detection/core/target_assigner_test.py on lines 666..673
              research/object_detection/core/target_assigner_test.py on lines 674..681
              research/object_detection/core/target_assigner_test.py on lines 763..770
              research/object_detection/core/target_assigner_test.py on lines 970..977
              research/object_detection/core/target_assigner_test.py on lines 1025..1032
              research/object_detection/core/target_assigner_test.py on lines 1033..1040
              research/object_detection/core/target_assigner_test.py on lines 1041..1048
              research/object_detection/core/target_assigner_test.py on lines 1107..1114
              research/object_detection/core/target_assigner_test.py on lines 1115..1122
              research/object_detection/core/target_assigner_test.py on lines 1123..1130
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1069..1072
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 251..254
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 290..301

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 58.

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

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

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

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

              Refactorings

              Further Reading

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

                  expected_raw_proposal_boxes = [[[0., 0., 0.5, 0.5], [0., 0.5, 0.5, 1.],
                                                  [0.5, 0., 1., 0.5], [0.5, 0.5, 1., 1.]],
                                                 [[0., 0., 0.5, 0.5], [0., 0.5, 0.5, 1.],
                                                  [0.5, 0., 1., 0.5], [0.5, 0.5, 1., 1.]]]
              official/vision/dataloaders/tf_example_decoder_test.py on lines 103..110
              official/vision/dataloaders/tf_example_decoder_test.py on lines 225..232
              official/vision/dataloaders/tf_example_label_map_decoder_test.py on lines 106..113
              research/object_detection/core/batch_multiclass_nms_test.py on lines 453..460
              research/object_detection/core/batch_multiclass_nms_test.py on lines 528..535
              research/object_detection/core/target_assigner_test.py on lines 534..541
              research/object_detection/core/target_assigner_test.py on lines 583..590
              research/object_detection/core/target_assigner_test.py on lines 591..598
              research/object_detection/core/target_assigner_test.py on lines 599..606
              research/object_detection/core/target_assigner_test.py on lines 658..665
              research/object_detection/core/target_assigner_test.py on lines 666..673
              research/object_detection/core/target_assigner_test.py on lines 674..681
              research/object_detection/core/target_assigner_test.py on lines 763..770
              research/object_detection/core/target_assigner_test.py on lines 970..977
              research/object_detection/core/target_assigner_test.py on lines 1025..1032
              research/object_detection/core/target_assigner_test.py on lines 1033..1040
              research/object_detection/core/target_assigner_test.py on lines 1041..1048
              research/object_detection/core/target_assigner_test.py on lines 1107..1114
              research/object_detection/core/target_assigner_test.py on lines 1115..1122
              research/object_detection/core/target_assigner_test.py on lines 1123..1130
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1159..1162
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 251..254
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 290..301

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 58.

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

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

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

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

              Refactorings

              Further Reading

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

                    groundtruth_boxes_list = [
                        tf.constant([[0, 0, .5, .5], [.5, .5, 1, 1]], dtype=tf.float32),
                        tf.constant([[0, .5, .5, 1], [.5, 0, 1, .5]], dtype=tf.float32)]
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 332..334
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1124..1126
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2029..2033

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 58.

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

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

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

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

              Refactorings

              Further Reading

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

                    groundtruth_boxes_list = [
                        tf.constant([[0, 0, .5, .5], [.5, .5, 1, 1]], dtype=tf.float32),
                        tf.constant([[0, .5, .5, 1], [.5, 0, 1, .5]], dtype=tf.float32)]
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 332..334
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1369..1371
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2029..2033

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 58.

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

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

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

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

              Refactorings

              Further Reading

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

                    groundtruth_boxes_list = [
                        tf.constant([[0.05, 0.05, 0.45, 0.45],
                                     [0.02, 0.52, 0.48, 0.98]], dtype=tf.float32),
                        tf.constant([[0.05, 0.05, 0.45, 0.45],
                                     [0.02, 0.52, 0.48, 0.98]], dtype=tf.float32)]
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 332..334
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1124..1126
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1369..1371

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 58.

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

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

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

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

              Refactorings

              Further Reading

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

                    proposal_boxes = tf.constant(
                        [[[0, 0, 16, 16],
                          [0, 16, 16, 32],
                          [16, 0, 32, 16],
                          [0, 0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1549..1555
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1889..1895

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

              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

                    proposal_boxes = tf.constant(
                        [[[0, 0, 16, 16],
                          [0, 16, 16, 32],
                          [16, 0, 32, 16],
                          [0, 0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1549..1555
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1647..1653

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

              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

                    proposal_boxes = tf.constant(
                        [[[0, 0, 16, 16],
                          [0, 16, 16, 32],
                          [16, 0, 32, 16],
                          [0, 0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1647..1653
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1889..1895

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

              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

                  rpn_objectness_predictions_with_background = np.array(
                      [[[-10, 13],
                        [10, -10],
                        [10, -11],
                        [10, -12]],
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1037..1045
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1113..1121
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1358..1366
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1971..1979

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

              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

                    rpn_objectness_predictions_with_background = tf.constant([
                        [[-10, 13],
                         [-10, 12],
                         [-10, 11],
                         [-10, 10]],
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1037..1045
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1358..1366
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1781..1789
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1971..1979

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

              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

                    rpn_objectness_predictions_with_background = tf.constant([
                        [[-10, 13],
                         [10, -10],
                         [10, -11],
                         [-10, 12]],
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1037..1045
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1113..1121
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1781..1789
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1971..1979

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

              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

                  rpn_objectness_predictions_with_background = np.array([
                      [[-10, 13],
                       [10, -10],
                       [10, -11],
                       [-10, 12]],
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1113..1121
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1358..1366
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1781..1789
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1971..1979

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

              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

                    rpn_objectness_predictions_with_background = tf.constant(
                        [[[-10, 13],
                          [-10, 12],
                          [10, -11],
                          [10, -12]],
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1037..1045
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1113..1121
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1358..1366
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1781..1789

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

              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

                    groundtruth_classes_list = [tf.constant([[1, 0], [0, 1]],
                                                            dtype=tf.float32),
                                                tf.constant([[1, 0], [1, 0]],
                                                            dtype=tf.float32)]
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 336..338
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1127..1130
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2034..2036

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

              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

                    groundtruth_classes_list = [tf.constant([[1, 0], [0, 1]],
                                                            dtype=tf.float32),
                                                tf.constant([[1, 0], [1, 0]],
                                                            dtype=tf.float32)]
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 336..338
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1372..1375
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2034..2036

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

              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

                    groundtruth_classes_list = [
                        tf.constant([[1, 0], [0, 1]], dtype=tf.float32),
                        tf.constant([[1, 0], [0, 1]], dtype=tf.float32)]
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 336..338
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1127..1130
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1372..1375

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

              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 use_static_shapes:
                    results = self.execute(graph_fn,
                                           [images, rpn_box_encodings,
                                            rpn_objectness_predictions_with_background,
                                            rpn_features_to_crop, anchors], graph=g)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1260..1269

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

              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 use_static_shapes:
                    results = self.execute(graph_fn,
                                           [images, refined_box_encodings,
                                            class_predictions_with_background,
                                            num_proposals, proposal_boxes], graph=g)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1050..1059

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

              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

                    class_predictions_with_background = tf.constant(
                        [[-100, 100, 100],
                         [100, -100, -100],
                         [100, -100, -100],
                         [0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1561..1567
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1901..1907

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

              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

                    class_predictions_with_background = tf.constant(
                        [[-10, 10, -10],  # first image
                         [-10, -10, 10],
                         [10, -10, -10],
                         [0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1561..1567
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1665..1671

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

              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

                    class_predictions_with_background = tf.constant(
                        [[-10, 10, -10],
                         [10, -10, -10],
                         [10, -10, -10],
                         [0, 0, 0],  # begin paddings
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1665..1671
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1901..1907

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

              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

                      [[0, 0, .5, .5], [.5, .5, 1, 1], [0, .5, .5, 1], [.5, 0, 1.0, .5]]
                      + 4 * [4 * [0]],
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1064..1065

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

              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

                      [[0, .5, .5, 1], [.5, 0, 1.0, .5], [0, 0, .5, .5], [.5, .5, 1, 1]]
                      + 4 * [4 * [0]]]
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1062..1063

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

              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

                    return (proposals['detection_boxes'], proposals['detection_scores'],
                            proposals['num_detections'],
                            proposals['detection_multiclass_scores'],
                            proposals['raw_detection_boxes'],
                            proposals['raw_detection_scores'])
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 247..249
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 387..390

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 45.

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

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

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

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

              Refactorings

              Further Reading

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

                    self.assertAllClose(results[1][indx][0:num_proposals],
                                        expected_proposal_boxes[indx][0:num_proposals])
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1086..1087
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1302..1303
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1304..1305
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1306..1307
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1308..1309

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 44.

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

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

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

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

              Refactorings

              Further Reading

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

                    self.assertAllClose(results[2][indx][0:num_proposals],
                                        expected_detection_scores[indx][0:num_proposals])
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1084..1085
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1086..1087
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1304..1305
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1306..1307
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1308..1309

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 44.

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

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

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

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

              Refactorings

              Further Reading

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

                    self.assertAllClose(results[2][indx][0:num_proposals],
                                        expected_proposal_scores[indx][0:num_proposals])
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1084..1085
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1302..1303
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1304..1305
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1306..1307
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1308..1309

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 44.

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

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

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

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

              Refactorings

              Further Reading

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

                    self.assertAllClose(results[3][indx][0:num_proposals],
                                        expected_detection_classes[indx][0:num_proposals])
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1084..1085
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1086..1087
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1302..1303
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1306..1307
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1308..1309

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 44.

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

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

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

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

              Refactorings

              Further Reading

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

                    self.assertAllClose(results[6][indx][0:num_proposals],
                                        expected_multiclass_scores[indx][0:num_proposals])
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1084..1085
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1086..1087
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1302..1303
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1304..1305
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1308..1309

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 44.

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

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

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

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

              Refactorings

              Further Reading

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

                    self.assertAllClose(results[7][indx][0:num_proposals],
                                        expected_anchor_indices[indx][0:num_proposals])
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1084..1085
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1086..1087
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1302..1303
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1304..1305
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1306..1307

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 44.

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

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

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

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

              Refactorings

              Further Reading

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

                  expected_raw_scores = [[[0., 1.], [1., 0.], [1., 0.], [0., 1.]],
                                         [[1., 0.], [0., 1.], [0., 1.], [1., 0.]]]
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1163..1164
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 255..256
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 305..306
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 356..358

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

                  expected_raw_scores = [[[0., 1.], [0., 1.], [0., 1.], [0., 1.]],
                                         [[0., 1.], [0., 1.], [0., 1.], [0., 1.]]]
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1073..1074
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 255..256
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 305..306
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 356..358

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 42.

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

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

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

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

              Refactorings

              Further Reading

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

                  if use_static_shapes:
                    results = self.execute(graph_fn, [images], graph=g)
                  else:
                    results = self.execute_cpu(graph_fn, [images], graph=g)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 674..677

              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

                  if use_static_shapes:
                    results = self.execute(graph_fn, [images], graph=g)
                  else:
                    results = self.execute_cpu(graph_fn, [images], graph=g)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 592..595

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 41.

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

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

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

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

              Refactorings

              Further Reading

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

                  with test_utils.GraphContextOrNone() as g:
                    model = self._build_model(
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 897..898

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 41.

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

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

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

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

              Refactorings

              Further Reading

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

                  with test_utils.GraphContextOrNone() as g:
                    model = self._build_model(
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 811..812

              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

                def _build_arg_scope_with_hyperparams(self,
                                                      hyperparams_text_proto,
                                                      is_training):
                  hyperparams = hyperparams_pb2.Hyperparams()
                  text_format.Merge(hyperparams_text_proto, hyperparams)
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 124..128

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 40.

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

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

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

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

              Refactorings

              Further Reading

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

                    mask_predictions_logits = 20 * tf.ones((batch_size *
                                                            model.max_num_proposals,
                                                            model.num_classes,
                                                            14, 14),
                                                           dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1457..1461
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1673..1677

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 38.

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

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

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

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

              Refactorings

              Further Reading

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

                    mask_predictions_logits = 20 * tf.ones((batch_size *
                                                            model.max_num_proposals,
                                                            model.num_classes,
                                                            14, 14),
                                                           dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1569..1573
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1673..1677

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 38.

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

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

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

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

              Refactorings

              Further Reading

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

                    mask_predictions_logits = 20 * tf.ones((batch_size *
                                                            model.max_num_proposals,
                                                            model.num_classes,
                                                            14, 14),
                                                           dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1457..1461
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1569..1573

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 38.

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

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

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

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

              Refactorings

              Further Reading

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

                    groundtruth_weights_list = [
                        tf.constant([1, 1], dtype=tf.float32),
                        tf.constant([1, 1], dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 340..342

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

                  groundtruth_classes = np.stack([np.array([[1, 0]], dtype=np.float32),
                                                  np.array([[0, 1]], dtype=np.float32)])
              research/object_detection/meta_architectures/center_net_meta_arch_tf2_test.py on lines 3091..3093

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 37.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_objectness_predictions_with_background = tf.constant([
                        [[-10, 13],
                         [10, -10],
                         [10, -11],
                         [10, -12]],], dtype=tf.float32)
              official/vision/modeling/layers/detection_generator_test.py on lines 87..89
              official/vision/modeling/layers/detection_generator_test.py on lines 237..238
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1637..1641
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1879..1883

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 36.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_objectness_predictions_with_background = tf.constant(
                        [[[-10, 13],
                          [-10, 12],
                          [10, -11],
                          [10, -12]]], dtype=tf.float32)
              official/vision/modeling/layers/detection_generator_test.py on lines 87..89
              official/vision/modeling/layers/detection_generator_test.py on lines 237..238
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1539..1543
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1637..1641

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 36.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_objectness_predictions_with_background = tf.constant([
                        [[-10, 13],
                         [10, -10],
                         [10, -11],
                         [10, -12]],], dtype=tf.float32)
              official/vision/modeling/layers/detection_generator_test.py on lines 87..89
              official/vision/modeling/layers/detection_generator_test.py on lines 237..238
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1539..1543
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1879..1883

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 36.

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

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

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

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

              Refactorings

              Further Reading

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

                def _get_second_stage_box_predictor_text_proto(
                    self, share_box_across_classes=False):
                  share_box_field = 'true' if share_box_across_classes else 'false'
                  box_predictor_text_proto = """
                    mask_rcnn_box_predictor {{
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 135..160

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 36.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_box_encodings = tf.zeros(
                        [batch_size,
                         anchors.get_shape().as_list()[0],
                         BOX_CODE_SIZE], dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1108..1110
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1352..1355
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1412..1415
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1631..1634
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1873..1876
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1965..1968

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_box_encodings = tf.zeros(
                        [batch_size, anchors.get_shape().as_list()[0],
                         BOX_CODE_SIZE], dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1352..1355
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1412..1415
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1533..1536
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1631..1634
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1873..1876
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1965..1968

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_box_encodings = tf.zeros(
                        [batch_size,
                         anchors.get_shape().as_list()[0],
                         BOX_CODE_SIZE], dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1108..1110
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1352..1355
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1412..1415
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1533..1536
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1873..1876
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1965..1968

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_box_encodings = tf.zeros(
                        [batch_size,
                         anchors.get_shape().as_list()[0],
                         BOX_CODE_SIZE], dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1108..1110
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1412..1415
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1533..1536
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1631..1634
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1873..1876
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1965..1968

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_box_encodings = tf.zeros(
                        [batch_size,
                         anchors.get_shape().as_list()[0],
                         BOX_CODE_SIZE], dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1108..1110
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1352..1355
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1533..1536
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1631..1634
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1873..1876
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1965..1968

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_box_encodings = tf.zeros(
                        [batch_size,
                         anchors.get_shape().as_list()[0],
                         BOX_CODE_SIZE], dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1108..1110
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1352..1355
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1412..1415
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1533..1536
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1631..1634
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1873..1876

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                    rpn_box_encodings = tf.zeros(
                        [batch_size,
                         anchors.get_shape().as_list()[0],
                         BOX_CODE_SIZE], dtype=tf.float32)
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1108..1110
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1352..1355
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1412..1415
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1533..1536
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1631..1634
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1965..1968

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

                    inputs2 = tf.cast(tf.random_uniform(
                        inputs_shape2, minval=0, maxval=255, dtype=tf.int32),
                                      dtype=tf.float32)
              research/object_detection/builders/image_resizer_builder_test.py on lines 32..34
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 461..463
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 502..504
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2091..2092
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2115..2116
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2167..2169
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 601..602
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 622..624
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 642..644

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

                    inputs = tf.cast(
                        tf.random_uniform(inputs_shape, minval=0, maxval=255, dtype=tf.int32),
                        dtype=tf.float32)
              research/object_detection/builders/image_resizer_builder_test.py on lines 32..34
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 461..463
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 502..504
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2091..2092
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2115..2116
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2136..2138
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 601..602
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 622..624
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 642..644

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

                    inputs = tf.cast(tf.random_uniform(
                        inputs_shape, minval=0, maxval=255, dtype=tf.int32), dtype=tf.float32)
              research/object_detection/builders/image_resizer_builder_test.py on lines 32..34
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 461..463
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 502..504
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2115..2116
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2136..2138
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2167..2169
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 601..602
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 622..624
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 642..644

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

                    inputs = tf.cast(tf.random_uniform(
                        inputs_shape, minval=0, maxval=255, dtype=tf.int32), dtype=tf.float32)
              research/object_detection/builders/image_resizer_builder_test.py on lines 32..34
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 461..463
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 502..504
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2091..2092
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2136..2138
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2167..2169
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 601..602
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 622..624
              research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 642..644

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                  with test_utils.GraphContextOrNone() as g:
                    model = self._build_model(is_training=True,
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1859..1860

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                def _build_keras_layer_hyperparams(self, hyperparams_text_proto):
                  hyperparams = hyperparams_pb2.Hyperparams()
                  text_format.Merge(hyperparams_text_proto, hyperparams)
                  return hyperparams_builder.KerasLayerHyperparams(hyperparams)
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 130..133

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                  with test_utils.GraphContextOrNone() as g:
                    model = self._build_model(is_training=True,
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1950..1951

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

                  with test_utils.GraphContextOrNone() as g:
                    model = self._build_model(
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 229..230
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 267..268
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 319..320

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                  if calibration_mapping_value:
                    calibration_text_proto = """
                    calibration_config {
                      function_approximation {
                        x_y_pairs {
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 318..332

              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

                    def call(self, inputs):
                      output_1 = self.conv(inputs)
                      output_2 = self.conv_1(output_1)
                      return [output_1, output_2]
              research/delf/delf/python/training/model/delf_model.py on lines 115..118

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 35.

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

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

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

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

              Refactorings

              Further Reading

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

                @parameterized.parameters(
                    {'use_static_shapes': False, 'pad_to_max_dimension': None},
                    {'use_static_shapes': True, 'pad_to_max_dimension': None},
                    {'use_static_shapes': False, 'pad_to_max_dimension': 56,},
                    {'use_static_shapes': True, 'pad_to_max_dimension': 56},
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1198..1202

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

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

                @parameterized.parameters(
                    {'use_static_shapes': False, 'pad_to_max_dimension': None},
                    {'use_static_shapes': True, 'pad_to_max_dimension': None},
                    {'use_static_shapes': False, 'pad_to_max_dimension': 56},
                    {'use_static_shapes': True, 'pad_to_max_dimension': 56},
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 987..991

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 34.

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

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

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

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

              Refactorings

              Further Reading

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

                  return self._get_model(
                      self._get_second_stage_box_predictor(
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 432..433

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

                  expected_proposal_boxes = [
                      [[0, 0, .5, .5], [.5, .5, 1, 1]], [[0, .5, .5, 1], [.5, 0, 1, .5]]]
              research/object_detection/core/box_coder_test.py on lines 41..42

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

                  with test_utils.GraphContextOrNone() as g:
                    model = self._build_model(
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 364..365
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 438..439
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1618..1619

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 32.

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

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

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

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

              Refactorings

              Further Reading

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

                  if hard_mining:
                    hard_example_miner = losses.HardExampleMiner(
              research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 354..355

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 32.

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

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

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

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

              Refactorings

              Further Reading

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

                  with test_utils.GraphContextOrNone() as g:
                    model = self._build_model(
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 364..365
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test.py on lines 438..439
              research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1094..1095

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 32.

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

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

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

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

              Refactorings

              Further Reading

              There are no issues that match your filters.

              Category
              Status