tensorflow/models

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

Summary

Maintainability
F
1 wk
Test Coverage

File ssd_meta_arch_test.py has 611 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Major
Found in research/object_detection/meta_architectures/ssd_meta_arch_test.py - About 1 day to fix

    Function _create_model has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def _create_model(
    Severity: Major
    Found in research/object_detection/meta_architectures/ssd_meta_arch_test.py - About 1 hr to fix

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

          def graph_fn(preprocessed_tensor, groundtruth_boxes1, groundtruth_boxes2,
      Severity: Minor
      Found in research/object_detection/meta_architectures/ssd_meta_arch_test.py - About 45 mins to fix

        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=32, kernel_size=1, scope='layer1')
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2069..2080

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

            def graph_fn(preprocessed_tensor, groundtruth_boxes1, groundtruth_boxes2,
                         groundtruth_classes1, groundtruth_classes2):
              groundtruth_boxes_list = [groundtruth_boxes1, groundtruth_boxes2]
              groundtruth_classes_list = [groundtruth_classes1, groundtruth_classes2]
              model.provide_groundtruth(groundtruth_boxes_list,
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 437..449
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 673..685

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 86.

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

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

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

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

        Refactorings

        Further Reading

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

            def graph_fn(preprocessed_tensor, groundtruth_boxes1, groundtruth_boxes2,
                         groundtruth_classes1, groundtruth_classes2):
              groundtruth_boxes_list = [groundtruth_boxes1, groundtruth_boxes2]
              groundtruth_classes_list = [groundtruth_classes1, groundtruth_classes2]
              model.provide_groundtruth(groundtruth_boxes_list,
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 370..382
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 673..685

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 86.

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

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

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

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

        Refactorings

        Further Reading

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

            def graph_fn(preprocessed_tensor, groundtruth_boxes1, groundtruth_boxes2,
                         groundtruth_classes1, groundtruth_classes2):
              groundtruth_boxes_list = [groundtruth_boxes1, groundtruth_boxes2]
              groundtruth_classes_list = [groundtruth_classes1, groundtruth_classes2]
              model.provide_groundtruth(groundtruth_boxes_list,
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 370..382
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 437..449

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 86.

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

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

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

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

        Refactorings

        Further Reading

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

            expected_boxes = [
                [
                    [0, 0, .5, .5],
                    [0, .5, .5, 1],
                    [.5, 0, 1, .5],
        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/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

        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_detection_boxes = [[[0., 0., 0.5, 0.5], [0., 0.5, 0.5, 1.],
                                             [0.5, 0., 1., 0.5], [1., 1., 1.5, 1.5]],
                                            [[0., 0., 0.5, 0.5], [0., 0.5, 0.5, 1.],
                                             [0.5, 0., 1., 0.5], [1., 1., 1.5, 1.5]]]
        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/faster_rcnn_meta_arch_test_lib.py on lines 1159..1162
        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 3 locations. Consider refactoring.
        Open

              self.assertAllClose(
                  detection_classes[image_idx][0:expected_num_detections[image_idx]],
                  expected_classes[image_idx][0:expected_num_detections[image_idx]])
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 323..325
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 326..330

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

              self.assertAllClose(
                  detection_scores[image_idx][0:expected_num_detections[image_idx]],
                  expected_scores[image_idx][0:expected_num_detections[image_idx]])
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 326..330
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 331..333

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

              self.assertAllClose(
                  detection_multiclass_scores[image_idx]
                  [0:expected_num_detections[image_idx]],
                  expected_multiclass_scores[image_idx]
                  [0:expected_num_detections[image_idx]])
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 323..325
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 331..333

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

            expected_raw_detection_scores = [[[0, 0], [0, 0], [0, 0], [0, 0]],
                                             [[0, 0], [0, 0], [0, 0], [0, 0]]]
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1073..1074
        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 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_multiclass_scores = [[[0, 0], [0, 0], [0, 0], [0, 0]],
                                          [[0, 0], [0, 0], [0, 0], [0, 0]]]
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1073..1074
        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 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_detection_scores = [
                [[0.5, 0.5], [0.5, 0.5], [0.5, 0.5], [0.5, 0.5]],
                [[0.5, 0.5], [0.5, 0.5], [0.5, 0.5], [0.5, 0.5]]
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1073..1074
        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

        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 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/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 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/faster_rcnn_meta_arch_test_lib.py on lines 2167..2169
        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/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

        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

            expected_classification_loss = (batch_size * num_anchors
                                            * (num_classes+1) * np.log(2.0))
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 397..398

        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

            expected_classification_loss = (batch_size * num_anchors
                                            * (num_classes+1) * np.log(2.0))
        research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 458..459

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 35.

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

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

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

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

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status