tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

    positional_decoder_ = positional_decoder.PositionalDecoder(
        decoder=decoder_,
        output_index_dim=perceiver_classification_decoder_cfg.output_index_dim,
        z_index_dim=perceiver_classification_decoder_cfg.z_index_dim,
        d_latents=perceiver_classification_decoder_cfg.d_latents,
official/projects/perceiver/modeling/models/classifier_test.py on lines 60..66
official/projects/perceiver/modeling/models/classifier_test.py on lines 122..128
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 65..71
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 140..146
official/projects/perceiver/tasks/pretrain.py on lines 48..54
official/projects/perceiver/tasks/sentence_prediction.py on lines 43..49

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

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

  @parameterized.named_parameters([
      ('padded_decode_true_with_name', True, 0.0, 'decoding'),
      ('padded_decode_false_with_name', False, 0.0, 'decoding'),
      ('padded_decode_true_without_name', True, 0.0, None),
      ('padded_decode_false_without_name', False, 0.0, None),
Severity: Major
Found in official/nlp/modeling/ops/beam_search_test.py and 2 other locations - About 1 hr to fix
official/nlp/modeling/ops/beam_search_test.py on lines 106..111
official/nlp/modeling/ops/beam_search_test.py on lines 153..158

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

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

      for v in slim.get_variables():
        self.assertDeviceEqual(v.device, 'CPU:0')
        self.assertDeviceEqual(v.value().device, 'CPU:0')
Severity: Major
Found in research/slim/deployment/model_deploy_test.py and 2 other locations - About 1 hr to fix
research/slim/deployment/model_deploy_test.py on lines 224..226
research/slim/deployment/model_deploy_test.py on lines 250..252

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

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

      mask_predictions_logits = 20 * tf.ones((batch_size *
                                              model.max_num_proposals,
                                              model.num_classes,
                                              14, 14),
                                             dtype=tf.float32)
research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1457..1461
research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1673..1677

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

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

      mask_predictions_logits = 20 * tf.ones((batch_size *
                                              model.max_num_proposals,
                                              model.num_classes,
                                              14, 14),
                                             dtype=tf.float32)
research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1457..1461
research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1569..1573

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

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

      for v in slim.get_variables():
        self.assertDeviceEqual(v.device, 'CPU:0')
        self.assertDeviceEqual(v.value().device, 'CPU:0')
Severity: Major
Found in research/slim/deployment/model_deploy_test.py and 2 other locations - About 1 hr to fix
research/slim/deployment/model_deploy_test.py on lines 198..200
research/slim/deployment/model_deploy_test.py on lines 224..226

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

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

    positional_decoder_ = positional_decoder.PositionalDecoder(
        decoder=decoder_,
        output_index_dim=perceiver_mlm_decoder_cfg.output_index_dim,
        z_index_dim=perceiver_mlm_decoder_cfg.z_index_dim,
        d_latents=perceiver_mlm_decoder_cfg.d_latents,
official/projects/perceiver/modeling/models/classifier_test.py on lines 60..66
official/projects/perceiver/modeling/models/classifier_test.py on lines 122..128
official/projects/perceiver/modeling/models/classifier_test.py on lines 184..190
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 140..146
official/projects/perceiver/tasks/pretrain.py on lines 48..54
official/projects/perceiver/tasks/sentence_prediction.py on lines 43..49

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

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

    positional_decoder_ = positional_decoder.PositionalDecoder(
        decoder=decoder_,
        output_index_dim=perceiver_classification_decoder_cfg.output_index_dim,
        z_index_dim=perceiver_classification_decoder_cfg.z_index_dim,
        d_latents=perceiver_classification_decoder_cfg.d_latents,
official/projects/perceiver/modeling/models/classifier_test.py on lines 122..128
official/projects/perceiver/modeling/models/classifier_test.py on lines 184..190
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 65..71
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 140..146
official/projects/perceiver/tasks/pretrain.py on lines 48..54
official/projects/perceiver/tasks/sentence_prediction.py on lines 43..49

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

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

  @parameterized.named_parameters([
      ('padded_decode_true_with_name', True, 0.0, 'decoding'),
      ('padded_decode_false_with_name', False, 0.0, 'decoding'),
      ('padded_decode_true_without_name', True, 0.0, None),
      ('padded_decode_false_without_name', False, 0.0, None),
Severity: Major
Found in official/nlp/modeling/ops/beam_search_test.py and 2 other locations - About 1 hr to fix
official/nlp/modeling/ops/beam_search_test.py on lines 62..67
official/nlp/modeling/ops/beam_search_test.py on lines 106..111

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

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

    classification_decoder = positional_decoder.PositionalDecoder(
        decoder=decoder_,
        d_model=decoder_config.d_model,
        output_index_dim=decoder_config.output_index_dim,
        z_index_dim=decoder_config.z_index_dim,
Severity: Major
Found in official/projects/perceiver/tasks/sentence_prediction.py and 6 other locations - About 1 hr to fix
official/projects/perceiver/modeling/models/classifier_test.py on lines 60..66
official/projects/perceiver/modeling/models/classifier_test.py on lines 122..128
official/projects/perceiver/modeling/models/classifier_test.py on lines 184..190
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 65..71
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 140..146
official/projects/perceiver/tasks/pretrain.py on lines 48..54

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

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

    positional_decoder_ = positional_decoder.PositionalDecoder(
        decoder=decoder_,
        output_index_dim=perceiver_classification_decoder_cfg.output_index_dim,
        z_index_dim=perceiver_classification_decoder_cfg.z_index_dim,
        d_latents=perceiver_classification_decoder_cfg.d_latents,
official/projects/perceiver/modeling/models/classifier_test.py on lines 60..66
official/projects/perceiver/modeling/models/classifier_test.py on lines 184..190
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 65..71
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 140..146
official/projects/perceiver/tasks/pretrain.py on lines 48..54
official/projects/perceiver/tasks/sentence_prediction.py on lines 43..49

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

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

    positional_decoder_ = positional_decoder.PositionalDecoder(
        decoder=decoder_,
        output_index_dim=perceiver_mlm_decoder_cfg.output_index_dim,
        z_index_dim=perceiver_mlm_decoder_cfg.z_index_dim,
        d_latents=perceiver_mlm_decoder_cfg.d_latents,
official/projects/perceiver/modeling/models/classifier_test.py on lines 60..66
official/projects/perceiver/modeling/models/classifier_test.py on lines 122..128
official/projects/perceiver/modeling/models/classifier_test.py on lines 184..190
official/projects/perceiver/modeling/models/pretrainer_test.py on lines 65..71
official/projects/perceiver/tasks/pretrain.py on lines 48..54
official/projects/perceiver/tasks/sentence_prediction.py on lines 43..49

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

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

            tf.constant([[[50., 50., 100., 100.]],
                         [[25., 25., 50., 50.]],
                         [[100., 100., 200., 200.]]],
                        dtype=tf.float32),
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 63..66
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 68..71
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 111..114
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 179..182
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 184..187

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

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

            tf.constant([[[100., 100., 200., 200.]],
                         [[50., 50., 100., 100.]],
                         [[25., 25., 50., 50.]]],
                        dtype=tf.float32),
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 63..66
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 68..71
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 116..119
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 179..182
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 184..187

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

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

  def test_model_is_savable(self):
    model = self._get_compiled_model()
    inputs = self._get_inputs()
    self.assertModelSavable(model=model, inputs=inputs)
official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network_test.py on lines 209..212
official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network_test.py on lines 214..217
official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network_test.py on lines 219..222
official/recommendation/uplift/models/two_tower_uplift_model_test.py on lines 256..259

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

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

  def test_multiple_layer_calls_with_same_input_returns_same_output(self):
    layer = self._get_full_layer()
    inputs = self._get_full_layer_inputs()
    self.assertLayerStable(layer=layer, inputs=inputs)
official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network_test.py on lines 214..217
official/recommendation/uplift/layers/uplift_networks/two_tower_uplift_network_test.py on lines 219..222
official/recommendation/uplift/models/two_tower_uplift_model_test.py on lines 256..259
official/recommendation/uplift/models/two_tower_uplift_model_test.py on lines 261..264

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

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

    self.assertAllClose(roi_features[0][2], 3 * np.ones((2, 2, 1)))
research/object_detection/utils/spatial_transform_ops_test.py on lines 356..356
research/object_detection/utils/spatial_transform_ops_test.py on lines 357..357
research/object_detection/utils/spatial_transform_ops_test.py on lines 359..359
research/object_detection/utils/spatial_transform_ops_test.py on lines 360..360

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

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

            tf.constant([[[100., 100., 200., 200.]],
                         [[50., 50., 100., 100.]],
                         [[25., 25., 50., 50.]]],
                        dtype=tf.float32),
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 63..66
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 68..71
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 111..114
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 116..119
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 184..187

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

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

            tf.constant([[[100., 100., 200., 200.]],
                         [[50., 50., 100., 100.]],
                         [[25., 25., 50., 50.]]],
                        dtype=tf.float32),
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 63..66
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 68..71
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 111..114
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 116..119
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 179..182

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

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

            tf.constant([[[100., 100., 200., 200.]],
                         [[50., 50., 100., 100.]],
                         [[25., 25., 50., 50.]]],
                        dtype=tf.float32),
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 63..66
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 111..114
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 116..119
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 179..182
research/object_detection/metrics/calibration_evaluation_tf1_test.py on lines 184..187

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

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