tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

    tensor_dict[fields.InputDataFields.groundtruth_classes] = tf.cast(
        tensor_dict[fields.InputDataFields.groundtruth_classes], dtype=tf.int32)
research/object_detection/data_decoders/tf_example_decoder.py on lines 709..711
research/object_detection/data_decoders/tf_example_decoder.py on lines 712..714
research/object_detection/data_decoders/tf_example_decoder.py on lines 716..719
research/object_detection/data_decoders/tf_sequence_example_decoder.py on lines 268..270
research/object_detection/data_decoders/tf_sequence_example_decoder.py on lines 302..305
research/object_detection/data_decoders/tf_sequence_example_decoder.py on lines 302..308

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

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

    if self._use_dropout:
      self._class_predictor_layers.append(
          tf.keras.layers.Dropout(rate=1.0 - self._dropout_keep_prob))
Severity: Major
Found in research/object_detection/predictors/heads/keras_class_head.py and 5 other locations - About 55 mins to fix
research/object_detection/predictors/heads/keras_box_head.py on lines 196..198
research/object_detection/predictors/heads/keras_class_head.py on lines 91..96
research/object_detection/predictors/heads/keras_class_head.py on lines 203..205
research/object_detection/predictors/heads/keras_mask_head.py on lines 108..113
research/object_detection/predictors/heads/keras_mask_head.py on lines 414..416

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

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 test_float_array_param_nested_csv_str_to_json_str(self):
    csv_str = 'a.b[1]=3.45,a.b[2]=1.32,a.b[0]=2.232'
    json_str = '{a : {b : [2.232, 3.45, 1.32]}}'
    converted_csv_str = params_dict.nested_csv_str_to_json_str(csv_str)
    self.assertEqual(converted_csv_str, json_str)
Severity: Major
Found in official/modeling/hyperparams/params_dict_test.py and 5 other locations - About 55 mins to fix
official/modeling/hyperparams/params_dict_test.py on lines 362..366
official/modeling/hyperparams/params_dict_test.py on lines 375..379
official/modeling/hyperparams/params_dict_test.py on lines 388..392
official/modeling/hyperparams/params_dict_test.py on lines 401..405
official/modeling/hyperparams/params_dict_test.py on lines 443..447

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

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

    if self._use_dropout:
      self._box_encoder_layers.append(
          tf.keras.layers.Dropout(rate=1.0 - self._dropout_keep_prob))
Severity: Major
Found in research/object_detection/predictors/heads/keras_box_head.py and 5 other locations - About 55 mins to fix
research/object_detection/predictors/heads/keras_class_head.py on lines 91..96
research/object_detection/predictors/heads/keras_class_head.py on lines 203..205
research/object_detection/predictors/heads/keras_class_head.py on lines 308..310
research/object_detection/predictors/heads/keras_mask_head.py on lines 108..113
research/object_detection/predictors/heads/keras_mask_head.py on lines 414..416

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

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

    if self._use_dropout:
      self._class_predictor_layers.append(
          # The Dropout layer's `training` parameter for the call method must
          # be set implicitly by the Keras set_learning_phase. The object
          # detection training code takes care of this.
Severity: Major
Found in research/object_detection/predictors/heads/keras_class_head.py and 5 other locations - About 55 mins to fix
research/object_detection/predictors/heads/keras_box_head.py on lines 196..198
research/object_detection/predictors/heads/keras_class_head.py on lines 203..205
research/object_detection/predictors/heads/keras_class_head.py on lines 308..310
research/object_detection/predictors/heads/keras_mask_head.py on lines 108..113
research/object_detection/predictors/heads/keras_mask_head.py on lines 414..416

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

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

    if self._use_dropout:
      self._mask_predictor_layers.append(
          # The Dropout layer's `training` parameter for the call method must
          # be set implicitly by the Keras set_learning_phase. The object
          # detection training code takes care of this.
Severity: Major
Found in research/object_detection/predictors/heads/keras_mask_head.py and 5 other locations - About 55 mins to fix
research/object_detection/predictors/heads/keras_box_head.py on lines 196..198
research/object_detection/predictors/heads/keras_class_head.py on lines 91..96
research/object_detection/predictors/heads/keras_class_head.py on lines 203..205
research/object_detection/predictors/heads/keras_class_head.py on lines 308..310
research/object_detection/predictors/heads/keras_mask_head.py on lines 414..416

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

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 test_complex_nested_csv_str_to_json_str(self):
    csv_str = 'a.aa.aaa.aaaaa.a=1'
    json_str = '{a : {aa : {aaa : {aaaaa : {a : 1}}}}}'
    converted_csv_str = params_dict.nested_csv_str_to_json_str(csv_str)
    self.assertEqual(converted_csv_str, json_str)
Severity: Major
Found in official/modeling/hyperparams/params_dict_test.py and 5 other locations - About 55 mins to fix
official/modeling/hyperparams/params_dict_test.py on lines 362..366
official/modeling/hyperparams/params_dict_test.py on lines 375..379
official/modeling/hyperparams/params_dict_test.py on lines 401..405
official/modeling/hyperparams/params_dict_test.py on lines 407..411
official/modeling/hyperparams/params_dict_test.py on lines 443..447

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

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 test_int_array_param_nested_csv_str_to_json_str(self):
    csv_str = 'a.b[2]=3,a.b[0]=1,a.b[1]=2'
    json_str = '{a : {b : [1, 2, 3]}}'
    converted_csv_str = params_dict.nested_csv_str_to_json_str(csv_str)
    self.assertEqual(converted_csv_str, json_str)
Severity: Major
Found in official/modeling/hyperparams/params_dict_test.py and 5 other locations - About 55 mins to fix
official/modeling/hyperparams/params_dict_test.py on lines 362..366
official/modeling/hyperparams/params_dict_test.py on lines 375..379
official/modeling/hyperparams/params_dict_test.py on lines 388..392
official/modeling/hyperparams/params_dict_test.py on lines 407..411
official/modeling/hyperparams/params_dict_test.py on lines 443..447

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

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 test_gcs_added_quotes(self):
    csv_str = 'a=gs://abc, b=gs://def'
    expected_output = '{a : \'gs://abc\', b : \'gs://def\'}'
    converted_csv_str = params_dict.nested_csv_str_to_json_str(csv_str)
    self.assertEqual(converted_csv_str, expected_output)
Severity: Major
Found in official/modeling/hyperparams/params_dict_test.py and 5 other locations - About 55 mins to fix
official/modeling/hyperparams/params_dict_test.py on lines 362..366
official/modeling/hyperparams/params_dict_test.py on lines 375..379
official/modeling/hyperparams/params_dict_test.py on lines 388..392
official/modeling/hyperparams/params_dict_test.py on lines 401..405
official/modeling/hyperparams/params_dict_test.py on lines 407..411

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

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 test_basic_csv_str_to_json_str(self):
    csv_str = 'a=1,b=2,c=3'
    json_str = '{a : 1, b : 2, c : 3}'
    converted_csv_str = params_dict.nested_csv_str_to_json_str(csv_str)
    self.assertEqual(converted_csv_str, json_str)
Severity: Major
Found in official/modeling/hyperparams/params_dict_test.py and 5 other locations - About 55 mins to fix
official/modeling/hyperparams/params_dict_test.py on lines 375..379
official/modeling/hyperparams/params_dict_test.py on lines 388..392
official/modeling/hyperparams/params_dict_test.py on lines 401..405
official/modeling/hyperparams/params_dict_test.py on lines 407..411
official/modeling/hyperparams/params_dict_test.py on lines 443..447

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

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

    if self._use_dropout:
      self._mask_predictor_layers.append(
          tf.keras.layers.Dropout(rate=1.0 - self._dropout_keep_prob))
Severity: Major
Found in research/object_detection/predictors/heads/keras_mask_head.py and 5 other locations - About 55 mins to fix
research/object_detection/predictors/heads/keras_box_head.py on lines 196..198
research/object_detection/predictors/heads/keras_class_head.py on lines 91..96
research/object_detection/predictors/heads/keras_class_head.py on lines 203..205
research/object_detection/predictors/heads/keras_class_head.py on lines 308..310
research/object_detection/predictors/heads/keras_mask_head.py on lines 108..113

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

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

  return slim.dataset.Dataset(
      data_sources=file_pattern,
      reader=reader,
      decoder=decoder,
      num_samples=_SPLITS_TO_SIZES[split_name],
Severity: Major
Found in research/slim/datasets/imagenet.py and 4 other locations - About 55 mins to fix
research/slim/datasets/cifar10.py on lines 90..94
research/slim/datasets/flowers.py on lines 90..94
research/slim/datasets/mnist.py on lines 90..94
research/slim/datasets/visualwakewords.py on lines 120..124

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

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

  return slim.dataset.Dataset(
      data_sources=file_pattern,
      reader=reader,
      decoder=decoder,
      num_samples=SPLITS_TO_SIZES[split_name],
Severity: Major
Found in research/slim/datasets/cifar10.py and 4 other locations - About 55 mins to fix
research/slim/datasets/flowers.py on lines 90..94
research/slim/datasets/imagenet.py on lines 190..194
research/slim/datasets/mnist.py on lines 90..94
research/slim/datasets/visualwakewords.py on lines 120..124

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

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

      c2 = self.block_group(
          inputs=inputs,
          filters=64,
          block_fn=block_fn,
          blocks=layers[0],
Severity: Major
Found in official/legacy/detection/modeling/architecture/resnet.py and 3 other locations - About 55 mins to fix
official/legacy/detection/modeling/architecture/resnet.py on lines 326..330
official/legacy/detection/modeling/architecture/resnet.py on lines 334..338
official/legacy/detection/modeling/architecture/resnet.py on lines 342..346

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

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

      c3 = self.block_group(
          inputs=c2,
          filters=128,
          block_fn=block_fn,
          blocks=layers[1],
Severity: Major
Found in official/legacy/detection/modeling/architecture/resnet.py and 3 other locations - About 55 mins to fix
official/legacy/detection/modeling/architecture/resnet.py on lines 318..322
official/legacy/detection/modeling/architecture/resnet.py on lines 334..338
official/legacy/detection/modeling/architecture/resnet.py on lines 342..346

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

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

    image_info = tf.stack([
        image_size,
        tf.cast(desired_size, dtype=tf.float32), image_scale,
        tf.cast(offset, tf.float32)
Severity: Minor
Found in official/legacy/detection/utils/input_utils.py and 1 other location - About 55 mins to fix
official/legacy/detection/utils/input_utils.py on lines 192..195

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

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

  return slim.dataset.Dataset(
      data_sources=file_pattern,
      reader=reader,
      decoder=decoder,
      num_samples=_SPLITS_TO_SIZES[split_name],
Severity: Major
Found in research/slim/datasets/mnist.py and 4 other locations - About 55 mins to fix
research/slim/datasets/cifar10.py on lines 90..94
research/slim/datasets/flowers.py on lines 90..94
research/slim/datasets/imagenet.py on lines 190..194
research/slim/datasets/visualwakewords.py on lines 120..124

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

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

    SentencePieceTrainer.Train(
        " ".join(["--{}={}".format(k, v) for k, v in flags.items()]))
Severity: Minor
Found in official/nlp/modeling/layers/text_layers_test.py and 1 other location - About 55 mins to fix
official/nlp/data/sentence_prediction_dataloader_test.py on lines 107..108

Duplicated Code

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

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

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

Tuning

This issue has a mass of 37.

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

  return slim.dataset.Dataset(
      data_sources=file_pattern,
      reader=reader,
      decoder=decoder,
      num_samples=_SPLITS_TO_SIZES[split_name],
Severity: Major
Found in research/slim/datasets/visualwakewords.py and 4 other locations - About 55 mins to fix
research/slim/datasets/cifar10.py on lines 90..94
research/slim/datasets/flowers.py on lines 90..94
research/slim/datasets/imagenet.py on lines 190..194
research/slim/datasets/mnist.py on lines 90..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 37.

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

    np.testing.assert_array_almost_equal(offsets[:, 1, :],
                                         np.array([[2.1, -2.8], [-2.9, 1.5]]))
Severity: Major
Found in research/object_detection/utils/target_assigner_utils_test.py and 3 other locations - About 55 mins to fix
research/object_detection/utils/target_assigner_utils_test.py on lines 112..113
research/object_detection/utils/target_assigner_utils_test.py on lines 118..119
research/object_detection/utils/target_assigner_utils_test.py on lines 121..122

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

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