tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

  def _create_test_tfrecord(self, tfrecord_file, example, num_samples):
    examples = [example] * num_samples
    tfexample_utils.dump_to_tfrecord(
Severity: Major
Found in official/projects/mosaic/mosaic_tasks_test.py and 3 other locations - About 50 mins to fix
official/projects/mosaic/qat/tasks/mosaic_tasks_test.py on lines 33..35
official/projects/qat/vision/tasks/image_classification_test.py on lines 33..35
official/projects/qat/vision/tasks/retinanet_test.py on lines 33..35

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

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

  def _create_test_tfrecord(self, tfrecord_file, example, num_samples):
    examples = [example] * num_samples
    tfexample_utils.dump_to_tfrecord(
Severity: Major
Found in official/projects/mosaic/qat/tasks/mosaic_tasks_test.py and 3 other locations - About 50 mins to fix
official/projects/mosaic/mosaic_tasks_test.py on lines 33..35
official/projects/qat/vision/tasks/image_classification_test.py on lines 33..35
official/projects/qat/vision/tasks/retinanet_test.py on lines 33..35

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

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

  def _create_test_tfrecord(self, tfrecord_file, example, num_samples):
    examples = [example] * num_samples
    tfexample_utils.dump_to_tfrecord(
official/projects/mosaic/mosaic_tasks_test.py on lines 33..35
official/projects/mosaic/qat/tasks/mosaic_tasks_test.py on lines 33..35
official/projects/qat/vision/tasks/retinanet_test.py on lines 33..35

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

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

  def _create_test_tfrecord(self, tfrecord_file, example, num_samples):
    examples = [example] * num_samples
    tfexample_utils.dump_to_tfrecord(
Severity: Major
Found in official/projects/qat/vision/tasks/retinanet_test.py and 3 other locations - About 50 mins to fix
official/projects/mosaic/mosaic_tasks_test.py on lines 33..35
official/projects/mosaic/qat/tasks/mosaic_tasks_test.py on lines 33..35
official/projects/qat/vision/tasks/image_classification_test.py on lines 33..35

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

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

    boxlist2 = np_box_list.BoxList(
        np.array(
            [[0.5, 0.25, 1.0, 1.0], [0.0, 0.0, 1.0, 1.0]], dtype=np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 59..62
research/object_detection/utils/np_box_list_ops_test.py on lines 63..65
research/object_detection/utils/np_box_list_ops_test.py on lines 73..76
research/object_detection/utils/np_box_list_ops_test.py on lines 78..80
research/object_detection/utils/np_box_list_ops_test.py on lines 106..109
research/object_detection/utils/np_box_list_ops_test.py on lines 113..116
research/object_detection/utils/np_box_list_ops_test.py on lines 131..134
research/object_detection/utils/np_box_list_ops_test.py on lines 137..138
research/object_detection/utils/np_box_list_ops_test.py on lines 142..145

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

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

    boxlist = np_box_list.BoxList(
        np.array(
            [[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75]], dtype=
            np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 59..62
research/object_detection/utils/np_box_list_ops_test.py on lines 63..65
research/object_detection/utils/np_box_list_ops_test.py on lines 73..76
research/object_detection/utils/np_box_list_ops_test.py on lines 78..80
research/object_detection/utils/np_box_list_ops_test.py on lines 106..109
research/object_detection/utils/np_box_list_ops_test.py on lines 113..116
research/object_detection/utils/np_box_list_ops_test.py on lines 117..119
research/object_detection/utils/np_box_list_ops_test.py on lines 137..138
research/object_detection/utils/np_box_list_ops_test.py on lines 142..145

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

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

    expected_boxlist_pruned = np_box_list.BoxList(
        np.array(
            [[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75]], dtype=
            np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 59..62
research/object_detection/utils/np_box_list_ops_test.py on lines 63..65
research/object_detection/utils/np_box_list_ops_test.py on lines 73..76
research/object_detection/utils/np_box_list_ops_test.py on lines 78..80
research/object_detection/utils/np_box_list_ops_test.py on lines 113..116
research/object_detection/utils/np_box_list_ops_test.py on lines 117..119
research/object_detection/utils/np_box_list_ops_test.py on lines 131..134
research/object_detection/utils/np_box_list_ops_test.py on lines 137..138
research/object_detection/utils/np_box_list_ops_test.py on lines 142..145

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

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

    expected_boxlist_coord = np_box_list.BoxList(
        np.array([[0.5, 0.5, 1.5, 1.5], [0, 0, 1.0, 1.5]], dtype=np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 59..62
research/object_detection/utils/np_box_list_ops_test.py on lines 63..65
research/object_detection/utils/np_box_list_ops_test.py on lines 73..76
research/object_detection/utils/np_box_list_ops_test.py on lines 78..80
research/object_detection/utils/np_box_list_ops_test.py on lines 106..109
research/object_detection/utils/np_box_list_ops_test.py on lines 113..116
research/object_detection/utils/np_box_list_ops_test.py on lines 117..119
research/object_detection/utils/np_box_list_ops_test.py on lines 131..134
research/object_detection/utils/np_box_list_ops_test.py on lines 142..145

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

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

      weights = tf.constant([
          [[1.0, 0.0, 1.0], [0.0, 0.0, 1.0]],
          [[1.0, 1.0, 1.0], [0.0, 0.0, 0.0]],
Severity: Major
Found in official/projects/centernet/losses/centernet_losses_test.py and 8 other locations - About 50 mins to fix
official/projects/waste_identification_ml/model_inference/color_and_property_extractor_test.py on lines 75..82
official/projects/waste_identification_ml/model_inference/color_and_property_extractor_test.py on lines 93..100
official/projects/yt8m/modeling/yt8m_model_utils_test.py on lines 29..31
research/deeplab/utils/get_dataset_colormap_test.py on lines 82..84
research/delf/delf/python/datum_io_test.py on lines 73..74
research/delf/delf/python/datum_io_test.py on lines 84..85
research/object_detection/core/losses_test.py on lines 1405..1407
research/object_detection/meta_architectures/center_net_meta_arch_tf2_test.py on lines 1501..1503

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

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

    boxlist = np_box_list.BoxList(
        np.array(
            [[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75]], dtype=
            np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 59..62
research/object_detection/utils/np_box_list_ops_test.py on lines 63..65
research/object_detection/utils/np_box_list_ops_test.py on lines 73..76
research/object_detection/utils/np_box_list_ops_test.py on lines 78..80
research/object_detection/utils/np_box_list_ops_test.py on lines 106..109
research/object_detection/utils/np_box_list_ops_test.py on lines 113..116
research/object_detection/utils/np_box_list_ops_test.py on lines 117..119
research/object_detection/utils/np_box_list_ops_test.py on lines 131..134
research/object_detection/utils/np_box_list_ops_test.py on lines 137..138

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

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

    boxlist2 = np_box_list.BoxList(
        np.array(
            [[0.5, 0.25, 1.0, 1.0], [0.0, 0.0, 1.0, 1.0]], dtype=np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 59..62
research/object_detection/utils/np_box_list_ops_test.py on lines 73..76
research/object_detection/utils/np_box_list_ops_test.py on lines 78..80
research/object_detection/utils/np_box_list_ops_test.py on lines 106..109
research/object_detection/utils/np_box_list_ops_test.py on lines 113..116
research/object_detection/utils/np_box_list_ops_test.py on lines 117..119
research/object_detection/utils/np_box_list_ops_test.py on lines 131..134
research/object_detection/utils/np_box_list_ops_test.py on lines 137..138
research/object_detection/utils/np_box_list_ops_test.py on lines 142..145

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

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

    boxlist = np_box_list.BoxList(
        np.array(
            [[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75]], dtype=
            np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 59..62
research/object_detection/utils/np_box_list_ops_test.py on lines 63..65
research/object_detection/utils/np_box_list_ops_test.py on lines 78..80
research/object_detection/utils/np_box_list_ops_test.py on lines 106..109
research/object_detection/utils/np_box_list_ops_test.py on lines 113..116
research/object_detection/utils/np_box_list_ops_test.py on lines 117..119
research/object_detection/utils/np_box_list_ops_test.py on lines 131..134
research/object_detection/utils/np_box_list_ops_test.py on lines 137..138
research/object_detection/utils/np_box_list_ops_test.py on lines 142..145

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

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

    frame = tf.constant([
        [[0.0, 0.0, 0.0], [0.0, 1.0, -1.0]],
        [[0.0, 0.0, 0.0], [0.0, 2.0, -2.0]],
Severity: Major
Found in official/projects/yt8m/modeling/yt8m_model_utils_test.py and 8 other locations - About 50 mins to fix
official/projects/centernet/losses/centernet_losses_test.py on lines 94..96
official/projects/waste_identification_ml/model_inference/color_and_property_extractor_test.py on lines 75..82
official/projects/waste_identification_ml/model_inference/color_and_property_extractor_test.py on lines 93..100
research/deeplab/utils/get_dataset_colormap_test.py on lines 82..84
research/delf/delf/python/datum_io_test.py on lines 73..74
research/delf/delf/python/datum_io_test.py on lines 84..85
research/object_detection/core/losses_test.py on lines 1405..1407
research/object_detection/meta_architectures/center_net_meta_arch_tf2_test.py on lines 1501..1503

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

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

    boxlist1 = np_box_list.BoxList(
        np.array(
            [[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75]], dtype=
            np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 59..62
research/object_detection/utils/np_box_list_ops_test.py on lines 63..65
research/object_detection/utils/np_box_list_ops_test.py on lines 73..76
research/object_detection/utils/np_box_list_ops_test.py on lines 78..80
research/object_detection/utils/np_box_list_ops_test.py on lines 106..109
research/object_detection/utils/np_box_list_ops_test.py on lines 117..119
research/object_detection/utils/np_box_list_ops_test.py on lines 131..134
research/object_detection/utils/np_box_list_ops_test.py on lines 137..138
research/object_detection/utils/np_box_list_ops_test.py on lines 142..145

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

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

    boxlist1 = np_box_list.BoxList(
        np.array(
            [[0.25, 0.25, 0.75, 0.75], [0.0, 0.0, 0.5, 0.75]], dtype=
            np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 63..65
research/object_detection/utils/np_box_list_ops_test.py on lines 73..76
research/object_detection/utils/np_box_list_ops_test.py on lines 78..80
research/object_detection/utils/np_box_list_ops_test.py on lines 106..109
research/object_detection/utils/np_box_list_ops_test.py on lines 113..116
research/object_detection/utils/np_box_list_ops_test.py on lines 117..119
research/object_detection/utils/np_box_list_ops_test.py on lines 131..134
research/object_detection/utils/np_box_list_ops_test.py on lines 137..138
research/object_detection/utils/np_box_list_ops_test.py on lines 142..145

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

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

    expected_boxlist_scaled = np_box_list.BoxList(
        np.array(
            [[0.5, 0.75, 1.5, 2.25], [0.0, 0.0, 1.0, 2.25]], dtype=np.float32))
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 50 mins to fix
research/object_detection/utils/np_box_list_ops_test.py on lines 59..62
research/object_detection/utils/np_box_list_ops_test.py on lines 63..65
research/object_detection/utils/np_box_list_ops_test.py on lines 73..76
research/object_detection/utils/np_box_list_ops_test.py on lines 106..109
research/object_detection/utils/np_box_list_ops_test.py on lines 113..116
research/object_detection/utils/np_box_list_ops_test.py on lines 117..119
research/object_detection/utils/np_box_list_ops_test.py on lines 131..134
research/object_detection/utils/np_box_list_ops_test.py on lines 137..138
research/object_detection/utils/np_box_list_ops_test.py on lines 142..145

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

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

    expected_result = np.array([
        [[120, 120, 120], [6, 230, 230]],
        [[4, 250, 7], [204, 70, 3]]
Severity: Major
Found in research/deeplab/utils/get_dataset_colormap_test.py and 8 other locations - About 50 mins to fix
official/projects/centernet/losses/centernet_losses_test.py on lines 94..96
official/projects/waste_identification_ml/model_inference/color_and_property_extractor_test.py on lines 75..82
official/projects/waste_identification_ml/model_inference/color_and_property_extractor_test.py on lines 93..100
official/projects/yt8m/modeling/yt8m_model_utils_test.py on lines 29..31
research/delf/delf/python/datum_io_test.py on lines 73..74
research/delf/delf/python/datum_io_test.py on lines 84..85
research/object_detection/core/losses_test.py on lines 1405..1407
research/object_detection/meta_architectures/center_net_meta_arch_tf2_test.py on lines 1501..1503

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

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

    original_image = np.array([
        [
            (0, 0, 0),
            (0, 0, 0),
        ],
official/projects/centernet/losses/centernet_losses_test.py on lines 94..96
official/projects/waste_identification_ml/model_inference/color_and_property_extractor_test.py on lines 75..82
official/projects/yt8m/modeling/yt8m_model_utils_test.py on lines 29..31
research/deeplab/utils/get_dataset_colormap_test.py on lines 82..84
research/delf/delf/python/datum_io_test.py on lines 73..74
research/delf/delf/python/datum_io_test.py on lines 84..85
research/object_detection/core/losses_test.py on lines 1405..1407
research/object_detection/meta_architectures/center_net_meta_arch_tf2_test.py on lines 1501..1503

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

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

    output_rates = [
        self.execute(graph_fn, [np.array(step).astype(np.int64)])
Severity: Major
Found in research/object_detection/utils/learning_schedules_test.py and 2 other locations - About 50 mins to fix
research/object_detection/utils/learning_schedules_test.py on lines 88..89
research/object_detection/utils/learning_schedules_test.py on lines 128..129

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

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

    output_rates = [
        self.execute(graph_fn, [np.array(step).astype(np.int64)])
Severity: Major
Found in research/object_detection/utils/learning_schedules_test.py and 2 other locations - About 50 mins to fix
research/object_detection/utils/learning_schedules_test.py on lines 88..89
research/object_detection/utils/learning_schedules_test.py on lines 107..108

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

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