tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

    s = [op.outputs[0].get_shape().as_list()[-1] for op in find_ops('Conv2D')]
Severity: Major
Found in research/slim/nets/mobilenet/mobilenet_v2_test.py and 3 other locations - About 1 hr to fix
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 120..120
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 134..134
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 174..174

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 = """
      activation: RELU_6
      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/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/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 = """
      activation: RELU_6,
      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/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/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 = """
      activation: RELU_6
      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/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/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 = """
    activation: NONE
      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/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/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/feature_map_generators_test.py on lines 60..73
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

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

      s = [op.outputs[0].get_shape().as_list()[-1] for op in find_ops('Conv2D')]
Severity: Major
Found in research/slim/nets/mobilenet/mobilenet_v2_test.py and 3 other locations - About 1 hr to fix
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 106..106
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 134..134
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 174..174

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 = """
    activation: NONE
      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/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 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 = """
    activation: NONE
      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/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 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 = """
    activation: NONE
      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/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_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

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

    s = [op.outputs[0].get_shape().as_list()[-1] for op in find_ops('Conv2D')]
Severity: Major
Found in research/slim/nets/mobilenet/mobilenet_v2_test.py and 3 other locations - About 1 hr to fix
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 106..106
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 120..120
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 174..174

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

    s = [op.outputs[0].get_shape().as_list()[-1] for op in find_ops('Conv2D')]
Severity: Major
Found in research/slim/nets/mobilenet/mobilenet_v2_test.py and 3 other locations - About 1 hr to fix
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 106..106
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 120..120
research/slim/nets/mobilenet/mobilenet_v2_test.py on lines 134..134

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

  def _build_conv_hyperparams(self):
    conv_hyperparams = hyperparams_pb2.Hyperparams()
    conv_hyperparams_text_proto = """
    activation: NONE
    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/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_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 = """
    activation: NONE
      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/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 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 10 locations. Consider refactoring.
Open

  if boxes.shape[-1] != 4:
    raise ValueError('boxes.shape[1] is {:d}, but must be 4.'.format(
        boxes.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 57..59
official/legacy/detection/utils/box_utils.py on lines 88..90
official/legacy/detection/utils/box_utils.py on lines 130..132
official/legacy/detection/utils/box_utils.py on lines 202..204
official/legacy/detection/utils/box_utils.py on lines 270..272
official/legacy/detection/utils/box_utils.py on lines 323..325
official/legacy/detection/utils/box_utils.py on lines 391..393
official/legacy/detection/utils/box_utils.py on lines 477..480
official/legacy/detection/utils/box_utils.py on lines 596..598

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

    similarity = np.array([[1, 1, 1, 3, 1],
                           [-1, 0, -2, -2, -1],
                           [3, 0, -1, 2, 0]], dtype=np.float32)
Severity: Major
Found in research/object_detection/matchers/argmax_matcher_test.py and 9 other locations - About 1 hr to fix
research/object_detection/matchers/argmax_matcher_test.py on lines 37..39
research/object_detection/matchers/argmax_matcher_test.py on lines 69..71
research/object_detection/matchers/argmax_matcher_test.py on lines 94..96
research/object_detection/matchers/argmax_matcher_test.py on lines 121..123
research/object_detection/matchers/argmax_matcher_test.py on lines 146..148
research/object_detection/utils/np_box_list_ops_test.py on lines 394..397
research/object_detection/utils/np_box_mask_list_ops_test.py on lines 170..173
research/object_detection/utils/target_assigner_utils_test.py on lines 127..130
research/object_detection/utils/target_assigner_utils_test.py on lines 158..161

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

      class_onehot = tf.constant(
          [[0, 0, 1, 0, 0],
           [0, 1, 0, 0, 0],
           [0, 0, 1, 0, 1]], dtype=tf.float32)
research/object_detection/matchers/argmax_matcher_test.py on lines 37..39
research/object_detection/matchers/argmax_matcher_test.py on lines 69..71
research/object_detection/matchers/argmax_matcher_test.py on lines 94..96
research/object_detection/matchers/argmax_matcher_test.py on lines 121..123
research/object_detection/matchers/argmax_matcher_test.py on lines 146..148
research/object_detection/matchers/argmax_matcher_test.py on lines 171..173
research/object_detection/utils/np_box_list_ops_test.py on lines 394..397
research/object_detection/utils/np_box_mask_list_ops_test.py on lines 170..173
research/object_detection/utils/target_assigner_utils_test.py on lines 158..161

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

  if boxes.shape[-1] != 4:
    raise ValueError('boxes.shape[-1] is {:d}, but must be 4.'.format(
        boxes.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 57..59
official/legacy/detection/utils/box_utils.py on lines 88..90
official/legacy/detection/utils/box_utils.py on lines 202..204
official/legacy/detection/utils/box_utils.py on lines 270..272
official/legacy/detection/utils/box_utils.py on lines 323..325
official/legacy/detection/utils/box_utils.py on lines 391..393
official/legacy/detection/utils/box_utils.py on lines 477..480
official/legacy/detection/utils/box_utils.py on lines 539..541
official/legacy/detection/utils/box_utils.py on lines 596..598

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

  if boxes.shape[-1] != 4:
    raise ValueError('boxes.shape[-1] is {:d}, but must be 4.'.format(
        boxes.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 57..59
official/legacy/detection/utils/box_utils.py on lines 88..90
official/legacy/detection/utils/box_utils.py on lines 130..132
official/legacy/detection/utils/box_utils.py on lines 202..204
official/legacy/detection/utils/box_utils.py on lines 323..325
official/legacy/detection/utils/box_utils.py on lines 391..393
official/legacy/detection/utils/box_utils.py on lines 477..480
official/legacy/detection/utils/box_utils.py on lines 539..541
official/legacy/detection/utils/box_utils.py on lines 596..598

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

Severity
Category
Status
Source
Language