tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

    if attention_initializer:
      self._attention_initializer = tf_keras.initializers.get(
          attention_initializer)
    else:
      self._attention_initializer = tf_utils.clone_initializer(
Severity: Major
Found in official/nlp/modeling/layers/transformer.py and 4 other locations - About 45 mins to fix
official/nlp/modeling/layers/reuse_transformer.py on lines 132..137
official/nlp/modeling/layers/tn_transformer_expand_condense.py on lines 100..105
official/projects/detr/modeling/transformer.py on lines 235..240
official/projects/detr/modeling/transformer.py on lines 656..661

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0., 1.],
        seq_feature_dict['region/bbox/ymax'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

  anno['2d_bbox_right'] = np.array([float(x[6]) for x in content])
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 281..281
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 282..282
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 283..283
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 285..285
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 286..286
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 288..288
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 290..290
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 291..291
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 292..292
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 293..293
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 294..294
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 295..295
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 296..296

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

      (cls_targets, box_targets, num_positives) = anchor_labeler.label_anchors(
          boxes, tf.cast(tf.expand_dims(classes, axis=1), tf.float32))
Severity: Major
Found in official/legacy/detection/dataloader/retinanet_parser.py and 4 other locations - About 45 mins to fix
official/legacy/detection/dataloader/retinanet_parser.py on lines 257..258
official/legacy/detection/dataloader/retinanet_parser.py on lines 316..317
official/legacy/detection/dataloader/shapemask_parser.py on lines 313..317
official/legacy/detection/dataloader/shapemask_parser.py on lines 503..507

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0., 0.],
        seq_feature_dict['region/bbox/xmin'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0., 1.],
        seq_feature_dict['region/bbox/ymax'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    (cls_targets,
     box_targets,
     num_positives) = anchor_labeler.label_anchors(
         boxes,
         tf.cast(tf.expand_dims(classes, axis=1), tf.float32))
Severity: Major
Found in official/legacy/detection/dataloader/shapemask_parser.py and 4 other locations - About 45 mins to fix
official/legacy/detection/dataloader/retinanet_parser.py on lines 257..258
official/legacy/detection/dataloader/retinanet_parser.py on lines 316..317
official/legacy/detection/dataloader/retinanet_parser.py on lines 420..421
official/legacy/detection/dataloader/shapemask_parser.py on lines 503..507

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

  anno['3d_bbox_width'] = np.array([float(x[9]) for x in content])
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 281..281
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 282..282
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 283..283
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 285..285
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 286..286
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 287..287
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 288..288
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 290..290
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 292..292
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 293..293
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 294..294
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 295..295
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 296..296

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    (cls_targets, box_targets, num_positives) = anchor_labeler.label_anchors(
        boxes, tf.cast(tf.expand_dims(classes, axis=1), tf.float32))
Severity: Major
Found in official/legacy/detection/dataloader/retinanet_parser.py and 4 other locations - About 45 mins to fix
official/legacy/detection/dataloader/retinanet_parser.py on lines 257..258
official/legacy/detection/dataloader/retinanet_parser.py on lines 420..421
official/legacy/detection/dataloader/shapemask_parser.py on lines 313..317
official/legacy/detection/dataloader/shapemask_parser.py on lines 503..507

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    if attention_initializer:
      self._attention_initializer = tf_keras.initializers.get(
          attention_initializer)
    else:
      self._attention_initializer = tf_utils.clone_initializer(
Severity: Major
Found in official/projects/detr/modeling/transformer.py and 4 other locations - About 45 mins to fix
official/nlp/modeling/layers/reuse_transformer.py on lines 132..137
official/nlp/modeling/layers/tn_transformer_expand_condense.py on lines 100..105
official/nlp/modeling/layers/transformer.py on lines 234..239
official/projects/detr/modeling/transformer.py on lines 656..661

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    if attention_initializer:
      self._attention_initializer = tf_keras.initializers.get(
          attention_initializer)
    else:
      self._attention_initializer = tf_utils.clone_initializer(
Severity: Major
Found in official/projects/detr/modeling/transformer.py and 4 other locations - About 45 mins to fix
official/nlp/modeling/layers/reuse_transformer.py on lines 132..137
official/nlp/modeling/layers/tn_transformer_expand_condense.py on lines 100..105
official/nlp/modeling/layers/transformer.py on lines 234..239
official/projects/detr/modeling/transformer.py on lines 235..240

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0.0, 0.1],
        seq_feature_dict['region/bbox/xmin'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0., 0.],
        seq_feature_dict['region/bbox/xmin'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0., 1.],
        seq_feature_dict['region/bbox/xmax'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0.2, 0.3],
        seq_feature_dict['region/bbox/xmax'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0., 0.],
        seq_feature_dict['region/bbox/ymin'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

  anno['2d_bbox_top'] = np.array([float(x[5]) for x in content])
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 281..281
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 282..282
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 283..283
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 285..285
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 287..287
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 288..288
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 290..290
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 291..291
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 292..292
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 293..293
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 294..294
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 295..295
research/object_detection/dataset_tools/create_kitti_tf_record.py on lines 296..296

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0., 1.],
        seq_feature_dict['region/bbox/xmax'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0.75, 1.],
        seq_feature_dict['region/bbox/xmax'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 176..178
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

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

    self.assertAllClose(
        [0.4, 0.5],
        seq_feature_dict['region/bbox/ymin'].feature[0].float_list.value[:])
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 179..181
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 182..184
research/object_detection/dataset_tools/context_rcnn/add_context_to_examples_tf2_test.py on lines 185..187
research/object_detection/dataset_tools/seq_example_util_test.py on lines 170..172
research/object_detection/dataset_tools/seq_example_util_test.py on lines 173..175
research/object_detection/dataset_tools/seq_example_util_test.py on lines 176..178
research/object_detection/dataset_tools/seq_example_util_test.py on lines 179..181
research/object_detection/dataset_tools/seq_example_util_test.py on lines 287..289
research/object_detection/dataset_tools/seq_example_util_test.py on lines 290..292
research/object_detection/dataset_tools/seq_example_util_test.py on lines 293..295
research/object_detection/dataset_tools/seq_example_util_test.py on lines 296..298
research/object_detection/dataset_tools/seq_example_util_test.py on lines 396..398
research/object_detection/dataset_tools/seq_example_util_test.py on lines 399..401
research/object_detection/dataset_tools/seq_example_util_test.py on lines 402..404
research/object_detection/dataset_tools/seq_example_util_test.py on lines 405..407

Duplicated Code

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

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

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

Tuning

This issue has a mass of 35.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language