tensorflow/models

View on GitHub
research/object_detection/builders/model_builder.py

Summary

Maintainability
F
1 wk
Test Coverage

File model_builder.py has 1103 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/builders/model_builder.py - About 2 days to fix

    Function _build_faster_rcnn_model has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def _build_faster_rcnn_model(frcnn_config, is_training, add_summaries):
      """Builds a Faster R-CNN or R-FCN detection model based on the model config.
    
      Builds R-FCN model if the second_stage_box_predictor in the config is of type
      `rfcn_box_predictor` else builds a Faster R-CNN model.
    Severity: Minor
    Found in research/object_detection/builders/model_builder.py - About 3 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

    Function _build_center_net_model has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def _build_center_net_model(center_net_config, is_training, add_summaries):
      """Build a CenterNet detection model.
    
      Args:
        center_net_config: A CenterNet proto object with model configuration.
    Severity: Minor
    Found in research/object_detection/builders/model_builder.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

    Function _build_faster_rcnn_model has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def _build_faster_rcnn_model(frcnn_config, is_training, add_summaries):
      """Builds a Faster R-CNN or R-FCN detection model based on the model config.
    
      Builds R-FCN model if the second_stage_box_predictor in the config is of type
      `rfcn_box_predictor` else builds a Faster R-CNN model.
    Severity: Minor
    Found in research/object_detection/builders/model_builder.py - About 1 hr to fix

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

      def _build_ssd_feature_extractor(feature_extractor_config,
                                       is_training,
                                       freeze_batchnorm,
                                       reuse_weights=None):
        """Builds a ssd_meta_arch.SSDFeatureExtractor based on config.
      Severity: Minor
      Found in research/object_detection/builders/model_builder.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 keypoint_proto_to_params has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def keypoint_proto_to_params(kp_config, keypoint_map_dict):
        """Converts CenterNet.KeypointEstimation proto to parameter namedtuple."""
        label_map_item = keypoint_map_dict[kp_config.keypoint_class_name]
      
        classification_loss, localization_loss, _, _, _, _, _ = (
      Severity: Minor
      Found in research/object_detection/builders/model_builder.py - About 55 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 _build_center_net_feature_extractor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def _build_center_net_feature_extractor(feature_extractor_config, is_training):
        """Build a CenterNet feature extractor from the given config."""
      
        if feature_extractor_config.type not in CENTER_NET_EXTRACTOR_FUNCTION_MAP:
          raise ValueError('\'{}\' is not a known CenterNet feature extractor type'
      Severity: Minor
      Found in research/object_detection/builders/model_builder.py - About 25 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

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

        CENTER_NET_EXTRACTOR_FUNCTION_MAP = {
            'resnet_v2_50':
                center_net_resnet_feature_extractor.resnet_v2_50,
            'resnet_v2_101':
                center_net_resnet_feature_extractor.resnet_v2_101,
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 3 other locations - About 3 hrs to fix
      official/nlp/modeling/layers/transformer_xl.py on lines 434..462
      official/projects/pix2seq/modeling/transformer.py on lines 519..533
      official/vision/modeling/layers/nn_blocks_3d.py on lines 236..250

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

      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

        SSD_KERAS_FEATURE_EXTRACTOR_CLASS_MAP = {
            'ssd_mobilenet_v1_keras': SSDMobileNetV1KerasFeatureExtractor,
            'ssd_mobilenet_v1_fpn_keras': SSDMobileNetV1FpnKerasFeatureExtractor,
            'ssd_mobilenet_v2_keras': SSDMobileNetV2KerasFeatureExtractor,
            'ssd_mobilenet_v2_fpn_keras': SSDMobileNetV2FpnKerasFeatureExtractor,
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 1 other location - About 2 hrs to fix
      research/deeplab/core/feature_extractor.py on lines 232..247

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

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

        if od_config.HasField('scale_head_params'):
          scale_head_num_filters = list(od_config.scale_head_params.num_filters)
          scale_head_kernel_sizes = list(od_config.scale_head_params.kernel_sizes)
        else:
          scale_head_num_filters = [256]
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 6 other locations - About 2 hrs to fix
      research/object_detection/builders/model_builder.py on lines 884..889
      research/object_detection/builders/model_builder.py on lines 890..895
      research/object_detection/builders/model_builder.py on lines 896..902
      research/object_detection/builders/model_builder.py on lines 961..966
      research/object_detection/builders/model_builder.py on lines 992..997
      research/object_detection/builders/model_builder.py on lines 1019..1024

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

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

        if kp_config.HasField('heatmap_head_params'):
          heatmap_head_num_filters = list(kp_config.heatmap_head_params.num_filters)
          heatmap_head_kernel_sizes = list(kp_config.heatmap_head_params.kernel_sizes)
        else:
          heatmap_head_num_filters = [256]
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 6 other locations - About 2 hrs to fix
      research/object_detection/builders/model_builder.py on lines 890..895
      research/object_detection/builders/model_builder.py on lines 896..902
      research/object_detection/builders/model_builder.py on lines 955..960
      research/object_detection/builders/model_builder.py on lines 961..966
      research/object_detection/builders/model_builder.py on lines 992..997
      research/object_detection/builders/model_builder.py on lines 1019..1024

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

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

        if oc_config.HasField('center_head_params'):
          center_head_num_filters = list(oc_config.center_head_params.num_filters)
          center_head_kernel_sizes = list(oc_config.center_head_params.kernel_sizes)
        else:
          center_head_num_filters = [256]
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 6 other locations - About 2 hrs to fix
      research/object_detection/builders/model_builder.py on lines 884..889
      research/object_detection/builders/model_builder.py on lines 890..895
      research/object_detection/builders/model_builder.py on lines 896..902
      research/object_detection/builders/model_builder.py on lines 955..960
      research/object_detection/builders/model_builder.py on lines 961..966
      research/object_detection/builders/model_builder.py on lines 1019..1024

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

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

        if od_config.HasField('offset_head_params'):
          offset_head_num_filters = list(od_config.offset_head_params.num_filters)
          offset_head_kernel_sizes = list(od_config.offset_head_params.kernel_sizes)
        else:
          offset_head_num_filters = [256]
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 6 other locations - About 2 hrs to fix
      research/object_detection/builders/model_builder.py on lines 884..889
      research/object_detection/builders/model_builder.py on lines 890..895
      research/object_detection/builders/model_builder.py on lines 896..902
      research/object_detection/builders/model_builder.py on lines 955..960
      research/object_detection/builders/model_builder.py on lines 992..997
      research/object_detection/builders/model_builder.py on lines 1019..1024

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

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

        if kp_config.HasField('offset_head_params'):
          offset_head_num_filters = list(kp_config.offset_head_params.num_filters)
          offset_head_kernel_sizes = list(kp_config.offset_head_params.kernel_sizes)
        else:
          offset_head_num_filters = [256]
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 6 other locations - About 2 hrs to fix
      research/object_detection/builders/model_builder.py on lines 884..889
      research/object_detection/builders/model_builder.py on lines 896..902
      research/object_detection/builders/model_builder.py on lines 955..960
      research/object_detection/builders/model_builder.py on lines 961..966
      research/object_detection/builders/model_builder.py on lines 992..997
      research/object_detection/builders/model_builder.py on lines 1019..1024

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

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

        if mask_config.HasField('mask_head_params'):
          mask_head_num_filters = list(mask_config.mask_head_params.num_filters)
          mask_head_kernel_sizes = list(mask_config.mask_head_params.kernel_sizes)
        else:
          mask_head_num_filters = [256]
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 6 other locations - About 2 hrs to fix
      research/object_detection/builders/model_builder.py on lines 884..889
      research/object_detection/builders/model_builder.py on lines 890..895
      research/object_detection/builders/model_builder.py on lines 896..902
      research/object_detection/builders/model_builder.py on lines 955..960
      research/object_detection/builders/model_builder.py on lines 961..966
      research/object_detection/builders/model_builder.py on lines 992..997

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

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

        if kp_config.HasField('regress_head_params'):
          regress_head_num_filters = list(kp_config.regress_head_params.num_filters)
          regress_head_kernel_sizes = list(
              kp_config.regress_head_params.kernel_sizes)
        else:
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 6 other locations - About 2 hrs to fix
      research/object_detection/builders/model_builder.py on lines 884..889
      research/object_detection/builders/model_builder.py on lines 890..895
      research/object_detection/builders/model_builder.py on lines 955..960
      research/object_detection/builders/model_builder.py on lines 961..966
      research/object_detection/builders/model_builder.py on lines 992..997
      research/object_detection/builders/model_builder.py on lines 1019..1024

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

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

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

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

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

      Refactorings

      Further Reading

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

        if feature_extractor_config.HasField('fpn'):
          kwargs.update({
              'fpn_min_level':
                  feature_extractor_config.fpn.min_level,
              'fpn_max_level':
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 1 other location - About 1 hr to fix
      research/object_detection/builders/model_builder.py on lines 582..589

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 39.

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

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

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

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

      Refactorings

      Further Reading

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

        if feature_extractor_config.HasField('fpn'):
          kwargs.update({
              'fpn_min_level':
                  feature_extractor_config.fpn.min_level,
              'fpn_max_level':
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 1 other location - About 1 hr to fix
      research/object_detection/builders/model_builder.py on lines 367..374

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

        FASTER_RCNN_KERAS_FEATURE_EXTRACTOR_CLASS_MAP = {
            'faster_rcnn_resnet50_keras':
                frcnn_resnet_keras.FasterRCNNResnet50KerasFeatureExtractor,
            'faster_rcnn_resnet101_keras':
                frcnn_resnet_keras.FasterRCNNResnet101KerasFeatureExtractor,
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 4 other locations - About 45 mins to fix
      official/projects/pix2seq/modeling/transformer.py on lines 318..325
      research/deep_speech/deep_speech.py on lines 252..259
      research/object_detection/builders/model_builder.py on lines 240..254
      research/object_detection/model_lib.py on lines 53..67

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

        FASTER_RCNN_FEATURE_EXTRACTOR_CLASS_MAP = {
            'faster_rcnn_nas':
            frcnn_nas.FasterRCNNNASFeatureExtractor,
            'faster_rcnn_pnas':
            frcnn_pnas.FasterRCNNPNASFeatureExtractor,
      Severity: Major
      Found in research/object_detection/builders/model_builder.py and 4 other locations - About 45 mins to fix
      official/projects/pix2seq/modeling/transformer.py on lines 318..325
      research/deep_speech/deep_speech.py on lines 252..259
      research/object_detection/builders/model_builder.py on lines 132..146
      research/object_detection/model_lib.py on lines 53..67

      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

        common_kwargs = {
            'is_training':
                is_training,
            'num_classes':
                num_classes,
      Severity: Minor
      Found in research/object_detection/builders/model_builder.py and 1 other location - About 45 mins to fix
      research/slim/preprocessing/preprocessing_factory.py on lines 44..78

      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

          common_kwargs.update({
              'attention_bottleneck_dimension':
                  context_config.attention_bottleneck_dimension,
              'attention_temperature':
                  context_config.attention_temperature,
      Severity: Minor
      Found in research/object_detection/builders/model_builder.py and 1 other location - About 45 mins to fix
      research/lstm_object_detection/evaluator.py on lines 36..52

      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

        if is_keras:
          conv_hyperparams = hyperparams_builder.KerasLayerHyperparams(
              feature_extractor_config.conv_hyperparams)
        else:
          conv_hyperparams = hyperparams_builder.build(
      Severity: Minor
      Found in research/object_detection/builders/model_builder.py and 1 other location - About 30 mins to fix
      research/object_detection/builders/model_builder.py on lines 639..645

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

        if (frcnn_config.first_stage_nms_iou_threshold < 0 or
            frcnn_config.first_stage_nms_iou_threshold > 1.0):
          raise ValueError('iou_threshold not in [0, 1.0].')
      Severity: Minor
      Found in research/object_detection/builders/model_builder.py and 1 other location - About 30 mins to fix
      research/object_detection/builders/post_processing_builder.py on lines 84..85

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 32.

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

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

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

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

      Refactorings

      Further Reading

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

        if is_keras:
          first_stage_box_predictor_arg_scope_fn = (
              hyperparams_builder.KerasLayerHyperparams(
                  frcnn_config.first_stage_box_predictor_conv_hyperparams))
        else:
      Severity: Minor
      Found in research/object_detection/builders/model_builder.py and 1 other location - About 30 mins to fix
      research/object_detection/builders/model_builder.py on lines 305..310

      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