tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

    self.assertAllEqual(
        [train_batch_size, 100, model_config.faster_rcnn.num_classes],
        labels[fields.InputDataFields.groundtruth_classes].shape.as_list())
Severity: Major
Found in research/object_detection/inputs_test.py and 9 other locations - About 40 mins to fix
research/object_detection/inputs_test.py on lines 210..212
research/object_detection/inputs_test.py on lines 260..262
research/object_detection/inputs_test.py on lines 270..272
research/object_detection/inputs_test.py on lines 304..306
research/object_detection/inputs_test.py on lines 345..347
research/object_detection/inputs_test.py on lines 390..392
research/object_detection/inputs_test.py on lines 423..425
research/object_detection/inputs_test.py on lines 466..468
research/object_detection/inputs_test.py on lines 532..534

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

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

    self.assertAllEqual(
        [eval_batch_size, 100, model_config.faster_rcnn.num_classes],
        labels[fields.InputDataFields.groundtruth_classes].shape.as_list())
Severity: Major
Found in research/object_detection/inputs_test.py and 9 other locations - About 40 mins to fix
research/object_detection/inputs_test.py on lines 210..212
research/object_detection/inputs_test.py on lines 260..262
research/object_detection/inputs_test.py on lines 270..272
research/object_detection/inputs_test.py on lines 304..306
research/object_detection/inputs_test.py on lines 380..382
research/object_detection/inputs_test.py on lines 390..392
research/object_detection/inputs_test.py on lines 423..425
research/object_detection/inputs_test.py on lines 466..468
research/object_detection/inputs_test.py on lines 532..534

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

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

    decoder_inputs = tf.convert_to_tensor(
        np.array([[2, 2, 1, 3, 1, 0], [3, 3, 1, 2, 2, 1]]))
Severity: Major
Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
official/nlp/modeling/models/t5_test.py on lines 480..481
official/nlp/modeling/models/t5_test.py on lines 482..483
official/nlp/modeling/models/t5_test.py on lines 525..526
official/nlp/modeling/models/t5_test.py on lines 528..529
official/nlp/modeling/models/t5_test.py on lines 583..584
official/nlp/modeling/models/t5_test.py on lines 585..586
official/nlp/modeling/models/t5_test.py on lines 646..647
official/nlp/modeling/models/t5_test.py on lines 648..649
official/nlp/modeling/models/t5_test.py on lines 707..708
official/nlp/modeling/models/t5_test.py on lines 756..757
official/nlp/modeling/models/t5_test.py on lines 758..759

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

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

    self.assertAllClose(
        [0.3],
        seq_feature_dict['region/bbox/ymax'].feature[1].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 193..195
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 196..198
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 202..204
research/object_detection/dataset_tools/seq_example_util_test.py on lines 411..413
research/object_detection/dataset_tools/seq_example_util_test.py on lines 415..417
research/object_detection/dataset_tools/seq_example_util_test.py on lines 419..421
research/object_detection/dataset_tools/seq_example_util_test.py on lines 423..425
research/object_detection/dataset_tools/seq_example_util_test.py on lines 427..429
research/object_detection/dataset_tools/seq_example_util_test.py on lines 431..433
research/object_detection/dataset_tools/seq_example_util_test.py on lines 440..442
research/object_detection/dataset_tools/seq_example_util_test.py on lines 443..445
research/object_detection/dataset_tools/seq_example_util_test.py on lines 446..448
research/object_detection/dataset_tools/seq_example_util_test.py on lines 449..451

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

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

    segments = tf.convert_to_tensor(
        np.array([[1, 1, 1, 2, 2, 0], [1, 1, 1, 2, 2, 2]]))
Severity: Major
Found in official/nlp/modeling/models/t5_test.py and 11 other locations - About 40 mins to fix
official/nlp/modeling/models/t5_test.py on lines 480..481
official/nlp/modeling/models/t5_test.py on lines 482..483
official/nlp/modeling/models/t5_test.py on lines 525..526
official/nlp/modeling/models/t5_test.py on lines 528..529
official/nlp/modeling/models/t5_test.py on lines 583..584
official/nlp/modeling/models/t5_test.py on lines 585..586
official/nlp/modeling/models/t5_test.py on lines 646..647
official/nlp/modeling/models/t5_test.py on lines 648..649
official/nlp/modeling/models/t5_test.py on lines 705..706
official/nlp/modeling/models/t5_test.py on lines 707..708
official/nlp/modeling/models/t5_test.py on lines 756..757

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

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

    self.assertAllEqual(
        [eval_batch_size, 100, model_config.faster_rcnn.num_classes],
        labels[fields.InputDataFields.groundtruth_classes].shape.as_list())
Severity: Major
Found in research/object_detection/inputs_test.py and 9 other locations - About 40 mins to fix
research/object_detection/inputs_test.py on lines 210..212
research/object_detection/inputs_test.py on lines 260..262
research/object_detection/inputs_test.py on lines 270..272
research/object_detection/inputs_test.py on lines 345..347
research/object_detection/inputs_test.py on lines 380..382
research/object_detection/inputs_test.py on lines 390..392
research/object_detection/inputs_test.py on lines 423..425
research/object_detection/inputs_test.py on lines 466..468
research/object_detection/inputs_test.py on lines 532..534

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

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

    self.assertAllEqual(
        [train_batch_size, 100, model_config.faster_rcnn.num_classes],
        labels[fields.InputDataFields.groundtruth_confidences].shape.as_list())
Severity: Major
Found in research/object_detection/inputs_test.py and 9 other locations - About 40 mins to fix
research/object_detection/inputs_test.py on lines 210..212
research/object_detection/inputs_test.py on lines 260..262
research/object_detection/inputs_test.py on lines 270..272
research/object_detection/inputs_test.py on lines 304..306
research/object_detection/inputs_test.py on lines 345..347
research/object_detection/inputs_test.py on lines 380..382
research/object_detection/inputs_test.py on lines 423..425
research/object_detection/inputs_test.py on lines 466..468
research/object_detection/inputs_test.py on lines 532..534

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

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

    self.assertAllEqual(
        [train_batch_size, 100, model_config.faster_rcnn.num_classes],
        labels[fields.InputDataFields.groundtruth_confidences].shape.as_list())
Severity: Major
Found in research/object_detection/inputs_test.py and 9 other locations - About 40 mins to fix
research/object_detection/inputs_test.py on lines 210..212
research/object_detection/inputs_test.py on lines 260..262
research/object_detection/inputs_test.py on lines 304..306
research/object_detection/inputs_test.py on lines 345..347
research/object_detection/inputs_test.py on lines 380..382
research/object_detection/inputs_test.py on lines 390..392
research/object_detection/inputs_test.py on lines 423..425
research/object_detection/inputs_test.py on lines 466..468
research/object_detection/inputs_test.py on lines 532..534

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

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

    self.assertAllEqual(
        [eval_batch_size, 100, model_config.ssd.num_classes],
        labels[fields.InputDataFields.groundtruth_classes].shape.as_list())
Severity: Major
Found in research/object_detection/inputs_test.py and 9 other locations - About 40 mins to fix
research/object_detection/inputs_test.py on lines 210..212
research/object_detection/inputs_test.py on lines 260..262
research/object_detection/inputs_test.py on lines 270..272
research/object_detection/inputs_test.py on lines 304..306
research/object_detection/inputs_test.py on lines 345..347
research/object_detection/inputs_test.py on lines 380..382
research/object_detection/inputs_test.py on lines 390..392
research/object_detection/inputs_test.py on lines 423..425
research/object_detection/inputs_test.py on lines 532..534

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

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

    sampled_idx = tf.multiply(
        tf.cast(tf.greater_equal(sampled_idx, tf.constant(0)), tf.int32),
        sampled_idx)
official/vision/ops/sampling_ops.py on lines 305..307
research/object_detection/core/balanced_positive_negative_sampler.py on lines 189..191

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

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

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

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

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

Refactorings

Further Reading

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

    if self.num_classes:
      self.final_fc = dense_layers.BaseQDense(
          units=self.num_classes,
          rank=2,
          parameters=self.parameters,
Severity: Major
Found in research/seq_flow_lite/models/pqrnn.py and 2 other locations - About 40 mins to fix
research/seq_flow_lite/models/byteqrnn.py on lines 106..110
research/seq_flow_lite/models/charformer.py on lines 99..103

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

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

  with tf.io.gfile.GFile(input_file, "r") as reader:
    input_data = json.load(reader)["data"]
Severity: Major
Found in official/legacy/xlnet/squad_utils.py and 2 other locations - About 40 mins to fix
official/nlp/data/squad_lib.py on lines 165..166
official/nlp/data/squad_lib_sp.py on lines 118..119

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

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

      self.assertTrue(np.all(np.isclose(annotation['bbox'], coco_boxes[i])))
Severity: Major
Found in research/object_detection/metrics/coco_tools_test.py and 7 other locations - About 40 mins to fix
research/object_detection/metrics/coco_tools_test.py on lines 214..214
research/object_detection/metrics/coco_tools_test.py on lines 268..268
research/object_detection/metrics/coco_tools_test.py on lines 287..287
research/object_detection/metrics/coco_tools_test.py on lines 348..348
research/object_detection/metrics/coco_tools_test.py on lines 390..390
research/object_detection/metrics/coco_tools_test.py on lines 393..393
research/object_detection/metrics/lvis_tools_test.py on lines 151..151

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

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

      self.assertTrue(np.all(np.isclose(annotation['bbox'], coco_boxes[i])))
Severity: Major
Found in research/object_detection/metrics/coco_tools_test.py and 7 other locations - About 40 mins to fix
research/object_detection/metrics/coco_tools_test.py on lines 214..214
research/object_detection/metrics/coco_tools_test.py on lines 268..268
research/object_detection/metrics/coco_tools_test.py on lines 287..287
research/object_detection/metrics/coco_tools_test.py on lines 324..324
research/object_detection/metrics/coco_tools_test.py on lines 348..348
research/object_detection/metrics/coco_tools_test.py on lines 390..390
research/object_detection/metrics/lvis_tools_test.py on lines 151..151

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

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

    self.assertAllEqual(
        [train_batch_size, 100, model_config.faster_rcnn.num_classes],
        labels[fields.InputDataFields.groundtruth_classes].shape.as_list())
Severity: Major
Found in research/object_detection/inputs_test.py and 9 other locations - About 40 mins to fix
research/object_detection/inputs_test.py on lines 210..212
research/object_detection/inputs_test.py on lines 270..272
research/object_detection/inputs_test.py on lines 304..306
research/object_detection/inputs_test.py on lines 345..347
research/object_detection/inputs_test.py on lines 380..382
research/object_detection/inputs_test.py on lines 390..392
research/object_detection/inputs_test.py on lines 423..425
research/object_detection/inputs_test.py on lines 466..468
research/object_detection/inputs_test.py on lines 532..534

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

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

  with tf.io.gfile.GFile(input_file, "r") as reader:
    input_data = json.load(reader)["data"]
Severity: Major
Found in official/nlp/data/squad_lib.py and 2 other locations - About 40 mins to fix
official/legacy/xlnet/squad_utils.py on lines 436..437
official/nlp/data/squad_lib_sp.py on lines 118..119

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

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

    sampled_idx = tf.multiply(
        tf.cast(tf.greater_equal(sampled_idx, tf.constant(0)), tf.int32),
        sampled_idx)
official/vision/ops/sampling_ops.py on lines 305..307
official/vision/utils/object_detection/balanced_positive_negative_sampler.py on lines 197..199

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

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

    self.assertAllEqual(
        [eval_batch_size, 100, model_config.ssd.num_classes],
        labels[fields.InputDataFields.groundtruth_classes].shape.as_list())
Severity: Major
Found in research/object_detection/inputs_test.py and 9 other locations - About 40 mins to fix
research/object_detection/inputs_test.py on lines 210..212
research/object_detection/inputs_test.py on lines 260..262
research/object_detection/inputs_test.py on lines 270..272
research/object_detection/inputs_test.py on lines 304..306
research/object_detection/inputs_test.py on lines 345..347
research/object_detection/inputs_test.py on lines 380..382
research/object_detection/inputs_test.py on lines 390..392
research/object_detection/inputs_test.py on lines 423..425
research/object_detection/inputs_test.py on lines 466..468

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

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

  with tf.io.gfile.GFile(input_file, "r") as reader:
    input_data = json.load(reader)["data"]
Severity: Major
Found in official/nlp/data/squad_lib_sp.py and 2 other locations - About 40 mins to fix
official/legacy/xlnet/squad_utils.py on lines 436..437
official/nlp/data/squad_lib.py on lines 165..166

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

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

      self.assertTrue(np.all(np.isclose(annotation['bbox'], coco_boxes[i])))
Severity: Major
Found in research/object_detection/metrics/coco_tools_test.py and 7 other locations - About 40 mins to fix
research/object_detection/metrics/coco_tools_test.py on lines 214..214
research/object_detection/metrics/coco_tools_test.py on lines 268..268
research/object_detection/metrics/coco_tools_test.py on lines 287..287
research/object_detection/metrics/coco_tools_test.py on lines 324..324
research/object_detection/metrics/coco_tools_test.py on lines 390..390
research/object_detection/metrics/coco_tools_test.py on lines 393..393
research/object_detection/metrics/lvis_tools_test.py on lines 151..151

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

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