tensorflow/models

View on GitHub
research/object_detection/models/feature_map_generators_test.py

Summary

Maintainability
F
2 wks
Test Coverage

File feature_map_generators_test.py has 751 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/models/feature_map_generators_test.py - About 1 day to fix

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

      def _build_feature_map_generator(
    Severity: Minor
    Found in research/object_detection/models/feature_map_generators_test.py - About 45 mins to fix

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

        def test_get_expected_feature_map_shapes_with_depthwise(
            self, use_native_resize_op):
          with test_utils.GraphContextOrNone() as g:
            image_features = [
                ('block2', tf.random_uniform([4, 8, 8, 256], dtype=tf.float32)),
      research/object_detection/models/feature_map_generators_test.py on lines 461..487

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

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

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

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

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

      Refactorings

      Further Reading

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

        def test_get_expected_feature_map_shapes_with_explicit_padding(
            self, use_native_resize_op):
          with test_utils.GraphContextOrNone() as g:
            image_features = [
                ('block2', tf.random_uniform([4, 8, 8, 256], dtype=tf.float32)),
      research/object_detection/models/feature_map_generators_test.py on lines 582..608

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

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

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

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

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

      Refactorings

      Further Reading

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

        def test_get_expected_feature_map_shapes_use_explicit_padding(self):
          with test_utils.GraphContextOrNone() as g:
            image_features = {
                'Mixed_3c': tf.random_uniform([4, 28, 28, 256], dtype=tf.float32),
                'Mixed_4c': tf.random_uniform([4, 14, 14, 576], dtype=tf.float32),
      research/object_detection/models/feature_map_generators_test.py on lines 124..149

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

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

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

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

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

      Refactorings

      Further Reading

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

        def test_get_expected_feature_map_shapes_with_inception_v2_use_depthwise(
            self):
          with test_utils.GraphContextOrNone() as g:
            image_features = {
                'Mixed_3c': tf.random_uniform([4, 28, 28, 256], dtype=tf.float32),
      research/object_detection/models/feature_map_generators_test.py on lines 151..176

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

      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:
            image_features = [
                ('block2', tf.random_uniform([4, 8, 8, 256], dtype=tf.float32)),
                ('block3', tf.random_uniform([4, 4, 4, 256], dtype=tf.float32)),
                ('block4', tf.random_uniform([4, 2, 2, 256], dtype=tf.float32)),
      research/object_detection/models/feature_map_generators_test.py on lines 436..443

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

      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:
            image_features = [
                ('block2', tf.random_uniform([4, 8, 8, 256], dtype=tf.float32)),
                ('block3', tf.random_uniform([4, 4, 4, 256], dtype=tf.float32)),
                ('block4', tf.random_uniform([4, 2, 2, 256], dtype=tf.float32)),
      research/object_detection/models/feature_map_generators_test.py on lines 612..619

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

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

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

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

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

      Refactorings

      Further Reading

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

          if tf_version.is_tf2():
            actual_variable_set = set(
                [var.name.split(':')[0] for var in feature_map_generator.variables])
            self.assertSetEqual(expected_keras_variables, actual_variable_set)
          else:
      research/object_detection/models/feature_map_generators_test.py on lines 375..383
      research/object_detection/models/feature_map_generators_test.py on lines 660..668
      research/object_detection/models/feature_map_generators_test.py on lines 727..735

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 95.

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

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

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

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

      Refactorings

      Further Reading

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

          if tf_version.is_tf2():
            actual_variable_set = set(
                [var.name.split(':')[0] for var in feature_map_generator.variables])
            self.assertSetEqual(expected_keras_variables, actual_variable_set)
          else:
      research/object_detection/models/feature_map_generators_test.py on lines 300..308
      research/object_detection/models/feature_map_generators_test.py on lines 375..383
      research/object_detection/models/feature_map_generators_test.py on lines 660..668

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 95.

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

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

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

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

      Refactorings

      Further Reading

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

          if tf_version.is_tf2():
            actual_variable_set = set(
                [var.name.split(':')[0] for var in feature_map_generator.variables])
            self.assertSetEqual(expected_keras_variables, actual_variable_set)
          else:
      research/object_detection/models/feature_map_generators_test.py on lines 300..308
      research/object_detection/models/feature_map_generators_test.py on lines 375..383
      research/object_detection/models/feature_map_generators_test.py on lines 727..735

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 95.

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

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

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

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

      Refactorings

      Further Reading

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

          if tf_version.is_tf2():
            actual_variable_set = set(
                [var.name.split(':')[0] for var in feature_map_generator.variables])
            self.assertSetEqual(expected_keras_variables, actual_variable_set)
          else:
      research/object_detection/models/feature_map_generators_test.py on lines 300..308
      research/object_detection/models/feature_map_generators_test.py on lines 660..668
      research/object_detection/models/feature_map_generators_test.py on lines 727..735

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 95.

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

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

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

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

      Refactorings

      Further Reading

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

          with test_utils.GraphContextOrNone() as g:
            image_features = {
                'Mixed_3c': tf.random_uniform([4, 28, 28, 256], dtype=tf.float32),
                'Mixed_4c': tf.random_uniform([4, 14, 14, 576], dtype=tf.float32),
                'Mixed_5c': tf.random_uniform([4, 7, 7, 1024], dtype=tf.float32)
      research/object_detection/models/feature_map_generators_test.py on lines 100..106
      research/object_detection/models/feature_map_generators_test.py on lines 179..186

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 87.

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

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

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

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

      Refactorings

      Further Reading

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

          with test_utils.GraphContextOrNone() as g:
            image_features = {
                'Mixed_3c': tf.random_uniform([4, 28, 28, 256], dtype=tf.float32),
                'Mixed_4c': tf.random_uniform([4, 14, 14, 576], dtype=tf.float32),
                'Mixed_5c': tf.random_uniform([4, 7, 7, 1024], dtype=tf.float32)
      research/object_detection/models/feature_map_generators_test.py on lines 179..186
      research/object_detection/models/feature_map_generators_test.py on lines 257..263

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 87.

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

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

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

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

      Refactorings

      Further Reading

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

          with test_utils.GraphContextOrNone() as g:
            image_features = {
                'Mixed_5d': tf.random_uniform([4, 35, 35, 256], dtype=tf.float32),
                'Mixed_6e': tf.random_uniform([4, 17, 17, 576], dtype=tf.float32),
                'Mixed_7c': tf.random_uniform([4, 8, 8, 1024], dtype=tf.float32)
      research/object_detection/models/feature_map_generators_test.py on lines 100..106
      research/object_detection/models/feature_map_generators_test.py on lines 257..263

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 87.

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

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

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

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

      Refactorings

      Further Reading

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

        def _build_conv_hyperparams(self):
          conv_hyperparams = hyperparams_pb2.Hyperparams()
          conv_hyperparams_text_proto = """
            regularizer {
              l2_regularizer {
      research/object_detection/models/bidirectional_feature_pyramid_generators_tf2_test.py on lines 37..51
      research/object_detection/models/faster_rcnn_resnet_v1_fpn_keras_feature_extractor_tf2_test.py on lines 31..44
      research/object_detection/models/feature_map_generators_test.py on lines 60..73
      research/object_detection/models/keras_models/mobilenet_v1_tf2_test.py on lines 70..91
      research/object_detection/models/keras_models/mobilenet_v2_tf2_test.py on lines 59..80
      research/object_detection/models/keras_models/resnet_v1_tf2_test.py on lines 73..95
      research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 36..50
      research/object_detection/predictors/heads/keras_box_head_tf2_test.py on lines 31..45
      research/object_detection/predictors/heads/keras_box_head_tf2_test.py on lines 127..141
      research/object_detection/predictors/heads/keras_class_head_tf2_test.py on lines 32..46
      research/object_detection/predictors/heads/keras_class_head_tf2_test.py on lines 130..144
      research/object_detection/predictors/heads/keras_mask_head_tf2_test.py on lines 31..45
      research/object_detection/predictors/heads/keras_mask_head_tf2_test.py on lines 202..216
      research/object_detection/predictors/rfcn_keras_box_predictor_tf2_test.py on lines 32..45

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 39.

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

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

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

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

      Refactorings

      Further Reading

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

        def _build_conv_hyperparams(self):
          conv_hyperparams = hyperparams_pb2.Hyperparams()
          conv_hyperparams_text_proto = """
            regularizer {
              l2_regularizer {
      research/object_detection/models/bidirectional_feature_pyramid_generators_tf2_test.py on lines 37..51
      research/object_detection/models/faster_rcnn_resnet_v1_fpn_keras_feature_extractor_tf2_test.py on lines 31..44
      research/object_detection/models/feature_map_generators_test.py on lines 390..403
      research/object_detection/models/keras_models/mobilenet_v1_tf2_test.py on lines 70..91
      research/object_detection/models/keras_models/mobilenet_v2_tf2_test.py on lines 59..80
      research/object_detection/models/keras_models/resnet_v1_tf2_test.py on lines 73..95
      research/object_detection/predictors/convolutional_keras_box_predictor_tf2_test.py on lines 36..50
      research/object_detection/predictors/heads/keras_box_head_tf2_test.py on lines 31..45
      research/object_detection/predictors/heads/keras_box_head_tf2_test.py on lines 127..141
      research/object_detection/predictors/heads/keras_class_head_tf2_test.py on lines 32..46
      research/object_detection/predictors/heads/keras_class_head_tf2_test.py on lines 130..144
      research/object_detection/predictors/heads/keras_mask_head_tf2_test.py on lines 31..45
      research/object_detection/predictors/heads/keras_mask_head_tf2_test.py on lines 202..216
      research/object_detection/predictors/rfcn_keras_box_predictor_tf2_test.py on lines 32..45

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 39.

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

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

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

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

      Refactorings

      Further Reading

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

        def test_return_correct_depth_with_multiplier(self):
          depth_fn = feature_map_generators.get_depth_fn(depth_multiplier=0.5,
                                                         min_depth=16)
          self.assertEqual(depth_fn(64), 32)
      Severity: Minor
      Found in research/object_detection/models/feature_map_generators_test.py and 1 other location - About 50 mins to fix
      research/object_detection/models/feature_map_generators_test.py on lines 740..743

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

        def test_return_min_depth_when_multiplier_is_small(self):
          depth_fn = feature_map_generators.get_depth_fn(depth_multiplier=0.5,
                                                         min_depth=16)
          self.assertEqual(depth_fn(16), 16)
      Severity: Minor
      Found in research/object_detection/models/feature_map_generators_test.py and 1 other location - About 50 mins to fix
      research/object_detection/models/feature_map_generators_test.py on lines 745..748

      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

      There are no issues that match your filters.

      Category
      Status