tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

        if self.ssim_weight > 0:
          tf.summary.image('scale%d_ssim_error%s' % (s, key),
                           self.ssim_error[s][key])
Severity: Major
Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
research/vid2depth/model.py on lines 301..301
research/vid2depth/model.py on lines 302..302
research/vid2depth/model.py on lines 303..303
research/vid2depth/model.py on lines 306..307
research/vid2depth/model.py on lines 308..309
research/vid2depth/model.py on lines 310..311
research/vid2depth/model.py on lines 316..317

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

    if self._norm_first:
      attention_output = source_self_attention_output + attention_output
    else:
      attention_output = self.encdec_attention_layer_norm(
          self_attention_output + attention_output)
Severity: Major
Found in official/nlp/modeling/layers/transformer.py and 9 other locations - About 45 mins to fix
official/nlp/modeling/layers/reuse_transformer.py on lines 338..341
official/nlp/modeling/layers/tn_transformer_expand_condense.py on lines 235..238
official/nlp/modeling/layers/tn_transformer_expand_condense.py on lines 250..253
official/nlp/modeling/layers/transformer.py on lines 419..423
official/nlp/modeling/layers/transformer.py on lines 453..456
official/projects/detr/modeling/transformer.py on lines 402..405
official/projects/detr/modeling/transformer.py on lines 814..818
official/projects/detr/modeling/transformer.py on lines 830..834
official/projects/detr/modeling/transformer.py on lines 845..848

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

      inputs = tf.cast(tf.random_uniform(
          inputs_shape, minval=0, maxval=255, dtype=tf.int32), dtype=tf.float32)
research/object_detection/builders/image_resizer_builder_test.py on lines 32..34
research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 461..463
research/object_detection/meta_architectures/context_rcnn_meta_arch_test.py on lines 502..504
research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2115..2116
research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2136..2138
research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 2167..2169
research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 601..602
research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 622..624
research/object_detection/meta_architectures/ssd_meta_arch_test.py on lines 642..644

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

    bert_inputs = bpi(
        tf.ragged.constant([[11, 12, 13],
                            [21, 22, 23, 24, 25, 26, 27, 28, 29, 30]]))
Severity: Major
Found in official/nlp/modeling/layers/text_layers_test.py and 2 other locations - About 45 mins to fix
official/nlp/modeling/layers/text_layers_test.py on lines 372..374
official/nlp/modeling/layers/text_layers_test.py on lines 437..439

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

    bert_inputs = bpi(
        tf.ragged.constant([[11, 12, 13],
                            [21, 22, 23, 24, 25, 26, 27, 28, 29, 30]]))
Severity: Major
Found in official/nlp/modeling/layers/text_layers_test.py and 2 other locations - About 45 mins to fix
official/nlp/modeling/layers/text_layers_test.py on lines 314..316
official/nlp/modeling/layers/text_layers_test.py on lines 372..374

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

    labels = tf.random.uniform((batch_size,),
                               minval=0,
                               maxval=model.num_classes - 1,
                               dtype=tf.int64)
Severity: Major
Found in research/delf/delf/python/training/model/delf_model_test.py and 2 other locations - About 45 mins to fix
research/delf/delf/python/training/model/delg_model_test.py on lines 78..81
research/delf/delf/python/training/model/delg_model_test.py on lines 115..118

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

    labels = tf.random.uniform((batch_size,),
                               minval=0,
                               maxval=model.num_classes - 1,
                               dtype=tf.int64)
Severity: Major
Found in research/delf/delf/python/training/model/delg_model_test.py and 2 other locations - About 45 mins to fix
research/delf/delf/python/training/model/delf_model_test.py on lines 77..80
research/delf/delf/python/training/model/delg_model_test.py on lines 78..81

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

  new_output.attr['x_scale'].CopyFrom(
      attr_value_pb2.AttrValue(f=scale_values['x_scale'].pop()))
Severity: Major
Found in research/lstm_object_detection/export_tflite_lstd_graph_lib.py and 7 other locations - About 45 mins to fix
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 128..129
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 132..133
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 134..135
research/object_detection/export_tflite_ssd_graph_lib.py on lines 132..133
research/object_detection/export_tflite_ssd_graph_lib.py on lines 134..135
research/object_detection/export_tflite_ssd_graph_lib.py on lines 136..137
research/object_detection/export_tflite_ssd_graph_lib.py on lines 138..139

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

        tf.summary.image('scale%d_warped_image%s' % (s, key),
                         self.warped_image[s][key])
Severity: Major
Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
research/vid2depth/model.py on lines 301..301
research/vid2depth/model.py on lines 302..302
research/vid2depth/model.py on lines 303..303
research/vid2depth/model.py on lines 308..309
research/vid2depth/model.py on lines 310..311
research/vid2depth/model.py on lines 312..314
research/vid2depth/model.py on lines 316..317

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

    bert_inputs = bpi(
        tf.ragged.constant([[11, 12, 13],
                            [21, 22, 23, 24, 25, 26, 27, 28, 29, 30]]))
Severity: Major
Found in official/nlp/modeling/layers/text_layers_test.py and 2 other locations - About 45 mins to fix
official/nlp/modeling/layers/text_layers_test.py on lines 314..316
official/nlp/modeling/layers/text_layers_test.py on lines 437..439

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

    x = log_alpha + U.safe_log_prob(u) - U.safe_log_prob(1 - u)
Severity: Major
Found in research/rebar/rebar.py and 2 other locations - About 45 mins to fix
research/rebar/rebar.py on lines 464..464
research/rebar/rebar.py on lines 1057..1057

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

          tf.summary.histogram('scale%d_disp%d' % (s, i), self.disp[i][s])
Severity: Major
Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
research/vid2depth/model.py on lines 301..301
research/vid2depth/model.py on lines 303..303
research/vid2depth/model.py on lines 306..307
research/vid2depth/model.py on lines 308..309
research/vid2depth/model.py on lines 310..311
research/vid2depth/model.py on lines 312..314
research/vid2depth/model.py on lines 316..317

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

  if not tf.io.gfile.isdir(FLAGS.output_dir):
    tf.io.gfile.makedirs(FLAGS.output_dir)
Severity: Major
Found in research/deeplab/datasets/remove_gt_colormap.py and 6 other locations - About 45 mins to fix
official/legacy/xlnet/preprocess_squad_data.py on lines 101..102
research/attention_ocr/python/eval.py on lines 48..49
research/deep_speech/data/download.py on lines 189..190
research/delf/delf/python/delg/extract_features.py on lines 99..100
research/delf/delf/python/delg/perform_retrieval.py on lines 183..184
research/delf/delf/python/detect_to_retrieve/perform_retrieval.py on lines 186..187

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 3 locations. Consider refactoring.
Open

    for key in input_shape:
      inputs[key] = tf.ones(input_shape[key], dtype=tf.float32)
Severity: Major
Found in official/projects/yolo/modeling/heads/yolo_head_test.py and 2 other locations - About 45 mins to fix
official/projects/yolo/modeling/heads/yolo_head_test.py on lines 39..40
official/projects/yolo/modeling/layers/detection_generator_test.py on lines 57..58

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

  new_output.attr['h_scale'].CopyFrom(
      attr_value_pb2.AttrValue(f=scale_values['h_scale'].pop()))
Severity: Major
Found in research/lstm_object_detection/export_tflite_lstd_graph_lib.py and 7 other locations - About 45 mins to fix
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 128..129
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 130..131
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 134..135
research/object_detection/export_tflite_ssd_graph_lib.py on lines 132..133
research/object_detection/export_tflite_ssd_graph_lib.py on lines 134..135
research/object_detection/export_tflite_ssd_graph_lib.py on lines 136..137
research/object_detection/export_tflite_ssd_graph_lib.py on lines 138..139

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

  def _convert_to_numpy(self, groundtruths, predictions):
    """Converts tesnors to numpy arrays."""
    numpy_groundtruths = groundtruths.numpy()
    numpy_predictions = predictions.numpy()

Severity: Major
Found in official/projects/basnet/evaluation/metrics.py and 2 other locations - About 45 mins to fix
official/projects/basnet/evaluation/metrics.py on lines 77..82
official/projects/basnet/evaluation/metrics.py on lines 307..312

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

  new_output.attr['h_scale'].CopyFrom(
      attr_value_pb2.AttrValue(f=scale_values['h_scale'].pop()))
Severity: Major
Found in research/object_detection/export_tflite_ssd_graph_lib.py and 7 other locations - About 45 mins to fix
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 128..129
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 130..131
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 132..133
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 134..135
research/object_detection/export_tflite_ssd_graph_lib.py on lines 132..133
research/object_detection/export_tflite_ssd_graph_lib.py on lines 134..135
research/object_detection/export_tflite_ssd_graph_lib.py on lines 138..139

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

          tf.summary.image('scale%d_icp_residual%s' % (s, key),
                           self.icp_residual[s][key])
Severity: Major
Found in research/vid2depth/model.py and 7 other locations - About 45 mins to fix
research/vid2depth/model.py on lines 301..301
research/vid2depth/model.py on lines 302..302
research/vid2depth/model.py on lines 303..303
research/vid2depth/model.py on lines 306..307
research/vid2depth/model.py on lines 308..309
research/vid2depth/model.py on lines 310..311
research/vid2depth/model.py on lines 312..314

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

  if not tf.io.gfile.exists(FLAGS.output_dir):
    tf.io.gfile.mkdir(FLAGS.output_dir)
Severity: Major
Found in official/legacy/xlnet/preprocess_squad_data.py and 6 other locations - About 45 mins to fix
research/attention_ocr/python/eval.py on lines 48..49
research/deep_speech/data/download.py on lines 189..190
research/deeplab/datasets/remove_gt_colormap.py on lines 68..69
research/delf/delf/python/delg/extract_features.py on lines 99..100
research/delf/delf/python/delg/perform_retrieval.py on lines 183..184
research/delf/delf/python/detect_to_retrieve/perform_retrieval.py on lines 186..187

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 8 locations. Consider refactoring.
Open

  new_output.attr['y_scale'].CopyFrom(
      attr_value_pb2.AttrValue(f=scale_values['y_scale'].pop()))
Severity: Major
Found in research/object_detection/export_tflite_ssd_graph_lib.py and 7 other locations - About 45 mins to fix
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 128..129
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 130..131
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 132..133
research/lstm_object_detection/export_tflite_lstd_graph_lib.py on lines 134..135
research/object_detection/export_tflite_ssd_graph_lib.py on lines 134..135
research/object_detection/export_tflite_ssd_graph_lib.py on lines 136..137
research/object_detection/export_tflite_ssd_graph_lib.py on lines 138..139

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