tensorflow/models

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

Summary

Maintainability
F
1 wk
Test Coverage

File ssd_meta_arch.py has 1184 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.py - About 3 days to fix

    Function __init__ has 29 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def __init__(self,
    Severity: Major
    Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 3 hrs to fix

      Function postprocess has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

        def postprocess(self, prediction_dict, true_image_shapes):
          """Converts prediction tensors to final detections.
      
          This function converts raw predictions tensors to final detection results by
          slicing off the background class, decoding box predictions and applying
      Severity: Minor
      Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      SSDMetaArch has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class SSDMetaArch(model.DetectionModel):
        """SSD Meta-architecture definition."""
      
        @deprecated_args(None,
                         'NMS is always placed on TPU; do not use nms_on_host '
      Severity: Minor
      Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 2 hrs to fix

        Function loss has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

          def loss(self, prediction_dict, true_image_shapes, scope=None):
            """Compute scalar loss tensors with respect to provided groundtruth.
        
            Calling this function requires that groundtruth tensors have been
            provided via the provide_groundtruth function.
        Severity: Minor
        Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function predict has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          def predict(self, preprocessed_inputs, true_image_shapes):
            """Predicts unpostprocessed tensors from input tensor.
        
            This function takes an input batch of images and runs it through the forward
            pass of the network to yield unpostprocessesed predictions.
        Severity: Minor
        Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function restore_map has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          def restore_map(self,
                          fine_tune_checkpoint_type='detection',
                          load_all_detection_checkpoint_vars=False):
            """Returns a map of variables to load from a foreign checkpoint.
        
        
        Severity: Minor
        Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

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

          def __init__(self,
        Severity: Major
        Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 1 hr to fix

          Function __init__ has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def __init__(self,
                         is_training,
                         anchor_generator,
                         box_predictor,
                         box_coder,
          Severity: Minor
          Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 1 hr to fix

            Function __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def __init__(self,
            Severity: Major
            Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 1 hr to fix

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

                def _assign_targets(self,
                                    groundtruth_boxes_list,
                                    groundtruth_classes_list,
                                    groundtruth_keypoints_list=None,
                                    groundtruth_weights_list=None,
              Severity: Minor
              Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

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

                def __init__(self,
                             is_training,
                             anchor_generator,
                             box_predictor,
                             box_coder,
              Severity: Minor
              Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 45 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function _assign_targets has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def _assign_targets(self,
              Severity: Minor
              Found in research/object_detection/meta_architectures/ssd_meta_arch.py - About 35 mins to fix

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

                  @property
                  def anchors(self):
                    if not self._anchors:
                      raise RuntimeError('anchors have not been constructed yet!')
                    if not isinstance(self._anchors, box_list.BoxList):
                research/object_detection/meta_architectures/faster_rcnn_meta_arch.py on lines 645..651

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

                      if (nmsed_additional_fields is not None and
                          fields.InputDataFields.multiclass_scores in nmsed_additional_fields):
                        detection_dict[
                            fields.DetectionResultFields.detection_multiclass_scores] = (
                                nmsed_additional_fields[
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 800..803

                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 (nmsed_additional_fields is not None and
                          fields.BoxListFields.keypoints in nmsed_additional_fields):
                        detection_dict[fields.DetectionResultFields.detection_keypoints] = (
                            nmsed_additional_fields[fields.BoxListFields.keypoints])
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 788..793

                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

                    if self._feature_extractor.is_keras_model:
                      update_ops.extend(self._feature_extractor.get_updates_for(None))
                      update_ops.extend(self._feature_extractor.get_updates_for(
                          self._feature_extractor.inputs))
                research/object_detection/meta_architectures/faster_rcnn_meta_arch.py on lines 2944..2949
                research/object_detection/meta_architectures/faster_rcnn_meta_arch.py on lines 2959..2965
                research/object_detection/meta_architectures/rfcn_meta_arch.py on lines 388..393
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1360..1363

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

                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

                    if self._box_predictor.is_keras_model:
                      update_ops.extend(self._box_predictor.get_updates_for(None))
                      update_ops.extend(self._box_predictor.get_updates_for(
                          self._box_predictor.inputs))
                research/object_detection/meta_architectures/faster_rcnn_meta_arch.py on lines 2944..2949
                research/object_detection/meta_architectures/faster_rcnn_meta_arch.py on lines 2959..2965
                research/object_detection/meta_architectures/rfcn_meta_arch.py on lines 388..393
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1364..1367

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

                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

                    avg_ignored_anchors = tf.reduce_mean(
                        tf.cast(
                            tf.stack([match.num_ignored_columns() for match in match_list]),
                            dtype=tf.float32))
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1116..1119
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1120..1123
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1124..1127

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

                    avg_neg_anchors = tf.reduce_mean(
                        tf.cast(
                            tf.stack([match.num_unmatched_columns() for match in match_list]),
                            dtype=tf.float32))
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1116..1119
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1120..1123
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1128..1131

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

                    avg_num_matched_gt_boxes = tf.reduce_mean(
                        tf.cast(
                            tf.stack([match.num_matched_rows() for match in match_list]),
                            dtype=tf.float32))
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1120..1123
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1124..1127
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1128..1131

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

                    avg_pos_anchors = tf.reduce_mean(
                        tf.cast(
                            tf.stack([match.num_matched_columns() for match in match_list]),
                            dtype=tf.float32))
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1116..1119
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1124..1127
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1128..1131

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

                      if self.groundtruth_has_field(fields.InputDataFields.is_annotated):
                        losses_mask = tf.stack(self.groundtruth_lists(
                            fields.InputDataFields.is_annotated))
                Severity: Major
                Found in research/object_detection/meta_architectures/ssd_meta_arch.py and 2 other locations - About 45 mins to fix
                research/object_detection/meta_architectures/faster_rcnn_meta_arch.py on lines 2354..2356
                research/object_detection/meta_architectures/faster_rcnn_meta_arch.py on lines 2510..2512

                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

                      groundtruth_classes_with_background_list = [
                          tf.pad(one_hot_encoding, [[0, 0], [1, 0]], mode='CONSTANT')
                Severity: Minor
                Found in research/object_detection/meta_architectures/ssd_meta_arch.py and 1 other location - About 35 mins to fix
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1056..1058

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

                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 train_using_confidences:
                        groundtruth_confidences_with_background_list = [
                            tf.pad(groundtruth_confidences, [[0, 0], [1, 0]], mode='CONSTANT')
                Severity: Minor
                Found in research/object_detection/meta_architectures/ssd_meta_arch.py and 1 other location - About 35 mins to fix
                research/object_detection/meta_architectures/ssd_meta_arch.py on lines 1052..1053

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

                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

                    boxlist_list = self._anchor_generator.generate(
                        feature_map_spatial_dims,
                        im_height=image_shape[1],
                        im_width=image_shape[2])
                Severity: Minor
                Found in research/object_detection/meta_architectures/ssd_meta_arch.py and 1 other location - About 30 mins to fix
                research/lstm_object_detection/meta_architectures/lstm_ssd_meta_arch.py on lines 99..101

                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