tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

    sampled_idx = tf.multiply(
        tf.cast(tf.greater_equal(sampled_idx, tf.constant(0)), tf.int32),
        sampled_idx)
Severity: Major
Found in official/vision/ops/sampling_ops.py and 2 other locations - About 40 mins to fix
official/vision/utils/object_detection/balanced_positive_negative_sampler.py on lines 197..199
research/object_detection/core/balanced_positive_negative_sampler.py on lines 189..191

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

def _int64_feature(value):
  """Returns an int64_list from a bool / enum / int / uint."""
  return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
Severity: Major
Found in official/projects/pix2seq/dataloaders/pix2seq_input_test.py and 5 other locations - About 40 mins to fix
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 40..42
research/delf/delf/python/training/build_image_dataset.py on lines 211..213
research/delf/delf/python/training/build_image_dataset.py on lines 216..218
research/slim/datasets/build_imagenet_data.py on lines 173..175
research/slim/datasets/dataset_utils.py on lines 69..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

    head = dense_prediction_heads.RetinaNetHead(
Severity: Major
Found in official/vision/modeling/retinanet_model_test.py and 5 other locations - About 40 mins to fix
official/projects/assemblenet/modeling/assemblenet_plus_test.py on lines 66..66
research/object_detection/builders/box_predictor_builder.py on lines 507..507
research/object_detection/models/keras_models/inception_resnet_v2_tf2_test.py on lines 146..146
research/object_detection/models/keras_models/mobilenet_v1_tf2_test.py on lines 103..103
research/object_detection/models/keras_models/mobilenet_v2_tf2_test.py on lines 94..94

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

    model = self._create_application_with_layer_outputs(
official/projects/assemblenet/modeling/assemblenet_plus_test.py on lines 66..66
official/vision/modeling/retinanet_model_test.py on lines 117..117
research/object_detection/builders/box_predictor_builder.py on lines 507..507
research/object_detection/models/keras_models/mobilenet_v1_tf2_test.py on lines 103..103
research/object_detection/models/keras_models/mobilenet_v2_tf2_test.py on lines 94..94

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

def _float_feature(value):
  """Returns a float_list from a float / double."""
  return tf.train.Feature(float_list=tf.train.FloatList(value=[value]))
Severity: Major
Found in official/projects/pix2seq/dataloaders/pix2seq_input_test.py and 5 other locations - About 40 mins to fix
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 45..47
research/delf/delf/python/training/build_image_dataset.py on lines 211..213
research/delf/delf/python/training/build_image_dataset.py on lines 216..218
research/slim/datasets/build_imagenet_data.py on lines 173..175
research/slim/datasets/dataset_utils.py on lines 69..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

def bytes_feature(values):
  """Returns a TF-Feature of bytes.

  Args:
    values: A string.
Severity: Major
Found in research/slim/datasets/dataset_utils.py and 5 other locations - About 40 mins to fix
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 40..42
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 45..47
research/delf/delf/python/training/build_image_dataset.py on lines 211..213
research/delf/delf/python/training/build_image_dataset.py on lines 216..218
research/slim/datasets/build_imagenet_data.py on lines 173..175

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

    model = asnp.assemblenet_plus(
official/vision/modeling/retinanet_model_test.py on lines 117..117
research/object_detection/builders/box_predictor_builder.py on lines 507..507
research/object_detection/models/keras_models/inception_resnet_v2_tf2_test.py on lines 146..146
research/object_detection/models/keras_models/mobilenet_v1_tf2_test.py on lines 103..103
research/object_detection/models/keras_models/mobilenet_v2_tf2_test.py on lines 94..94

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

def _int64_feature(value):
  """Returns an int64_list from a bool / enum / int / uint."""
  return tf.train.Feature(int64_list=tf.train.Int64List(value=[value]))
Severity: Major
Found in research/delf/delf/python/training/build_image_dataset.py and 5 other locations - About 40 mins to fix
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 40..42
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 45..47
research/delf/delf/python/training/build_image_dataset.py on lines 216..218
research/slim/datasets/build_imagenet_data.py on lines 173..175
research/slim/datasets/dataset_utils.py on lines 69..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

def _bytes_feature(value):
  """Returns a bytes_list from a string / byte."""
  return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
Severity: Major
Found in research/delf/delf/python/training/build_image_dataset.py and 5 other locations - About 40 mins to fix
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 40..42
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 45..47
research/delf/delf/python/training/build_image_dataset.py on lines 211..213
research/slim/datasets/build_imagenet_data.py on lines 173..175
research/slim/datasets/dataset_utils.py on lines 69..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

    full_model = mobilenet_v1.mobilenet_v1(
official/projects/assemblenet/modeling/assemblenet_plus_test.py on lines 66..66
official/vision/modeling/retinanet_model_test.py on lines 117..117
research/object_detection/builders/box_predictor_builder.py on lines 507..507
research/object_detection/models/keras_models/inception_resnet_v2_tf2_test.py on lines 146..146
research/object_detection/models/keras_models/mobilenet_v2_tf2_test.py on lines 94..94

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

def _bytes_feature(value):
  """Wrapper for inserting bytes features into Example proto."""
  return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
Severity: Major
Found in research/slim/datasets/build_imagenet_data.py and 5 other locations - About 40 mins to fix
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 40..42
official/projects/pix2seq/dataloaders/pix2seq_input_test.py on lines 45..47
research/delf/delf/python/training/build_image_dataset.py on lines 211..213
research/delf/delf/python/training/build_image_dataset.py on lines 216..218
research/slim/datasets/dataset_utils.py on lines 69..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

    full_model = mobilenet_v2.mobilenet_v2(
official/projects/assemblenet/modeling/assemblenet_plus_test.py on lines 66..66
official/vision/modeling/retinanet_model_test.py on lines 117..117
research/object_detection/builders/box_predictor_builder.py on lines 507..507
research/object_detection/models/keras_models/inception_resnet_v2_tf2_test.py on lines 146..146
research/object_detection/models/keras_models/mobilenet_v1_tf2_test.py on lines 103..103

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language