tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

    if isinstance(outputs, list):
      sequence_output = outputs[0]
    else:
      sequence_output = outputs['sequence_output']
Severity: Major
Found in official/nlp/modeling/models/bert_span_labeler.py and 5 other locations - About 30 mins to fix
official/nlp/modeling/models/bert_classifier.py on lines 78..81
official/nlp/modeling/models/bert_classifier.py on lines 85..88
official/nlp/modeling/models/bert_token_classifier.py on lines 67..70
official/projects/fffner/fffner_classifier.py on lines 78..81
official/projects/qat/nlp/modeling/models/bert_span_labeler.py on lines 61..64

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

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

  x = layers.BatchNormalization(
      axis=bn_axis,
      momentum=batch_norm_decay,
      epsilon=batch_norm_epsilon,
      name=bn_name_base + '2b')(
Severity: Major
Found in official/legacy/image_classification/resnet/resnet_model.py and 6 other locations - About 30 mins to fix
official/legacy/image_classification/resnet/resnet_model.py on lines 79..83
official/legacy/image_classification/resnet/resnet_model.py on lines 96..100
official/legacy/image_classification/resnet/resnet_model.py on lines 111..115
official/legacy/image_classification/resnet/resnet_model.py on lines 167..171
official/legacy/image_classification/resnet/resnet_model.py on lines 200..204
official/legacy/image_classification/resnet/resnet_model.py on lines 215..219

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

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

  x = layers.BatchNormalization(
      axis=bn_axis,
      momentum=batch_norm_decay,
      epsilon=batch_norm_epsilon,
      name=bn_name_base + '2b')(
Severity: Major
Found in official/legacy/image_classification/resnet/resnet_model.py and 6 other locations - About 30 mins to fix
official/legacy/image_classification/resnet/resnet_model.py on lines 79..83
official/legacy/image_classification/resnet/resnet_model.py on lines 111..115
official/legacy/image_classification/resnet/resnet_model.py on lines 167..171
official/legacy/image_classification/resnet/resnet_model.py on lines 185..189
official/legacy/image_classification/resnet/resnet_model.py on lines 200..204
official/legacy/image_classification/resnet/resnet_model.py on lines 215..219

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

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

    for v in tf.get_collection(
        tf.GraphKeys.GLOBAL_VARIABLES, scope='on_cpu'):
      self.assertDeviceEqual(v.device, '/cpu:0')
Severity: Major
Found in research/slim/nets/nasnet/nasnet_test.py and 5 other locations - About 30 mins to fix
research/slim/nets/inception_resnet_v2_test.py on lines 211..213
research/slim/nets/inception_resnet_v2_test.py on lines 214..216
research/slim/nets/inception_v4_test.py on lines 162..164
research/slim/nets/inception_v4_test.py on lines 165..167
research/slim/nets/nasnet/nasnet_test.py on lines 299..301

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

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

    for v in tf.get_collection(
        tf.GraphKeys.GLOBAL_VARIABLES, scope='on_gpu'):
      self.assertDeviceEqual(v.device, '/gpu:0')
Severity: Major
Found in research/slim/nets/inception_v4_test.py and 5 other locations - About 30 mins to fix
research/slim/nets/inception_resnet_v2_test.py on lines 211..213
research/slim/nets/inception_resnet_v2_test.py on lines 214..216
research/slim/nets/inception_v4_test.py on lines 162..164
research/slim/nets/nasnet/nasnet_test.py on lines 296..298
research/slim/nets/nasnet/nasnet_test.py on lines 299..301

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

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

      tf.summary.histogram('rx%d' % i, self.egomotion[:, i, 3])
Severity: Major
Found in research/vid2depth/model.py and 5 other locations - About 30 mins to fix
research/vid2depth/model.py on lines 289..289
research/vid2depth/model.py on lines 290..290
research/vid2depth/model.py on lines 291..291
research/vid2depth/model.py on lines 293..293
research/vid2depth/model.py on lines 294..294

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

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 self.parameters.mode not in [base_layers.PREDICT, base_layers.TFLITE]:
      pooled_outputs = pooled_outputs * pooled_mask
Severity: Major
Found in research/seq_flow_lite/layers/transformer_layers.py and 6 other locations - About 30 mins to fix
research/seq_flow_lite/layers/qrnn_layers.py on lines 433..434
research/seq_flow_lite/layers/transformer_layers.py on lines 270..271
research/seq_flow_lite/layers/transformer_layers.py on lines 275..276
research/seq_flow_lite/layers/transformer_layers.py on lines 289..290
research/seq_flow_lite/layers/transformer_layers.py on lines 294..295
research/seq_flow_lite/layers/transformer_layers.py on lines 464..465

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

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 resnet_v1_50_fpn(channel_means, channel_stds, bgr_ordering, **kwargs):
  """The ResNet v1 50 FPN feature extractor."""
  del kwargs

  return CenterNetResnetV1FpnFeatureExtractor(
research/object_detection/models/center_net_resnet_feature_extractor.py on lines 133..137
research/object_detection/models/center_net_resnet_feature_extractor.py on lines 145..149
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 169..173
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 192..196
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 204..208

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

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

      for v in tf.get_collection(
          tf.GraphKeys.GLOBAL_VARIABLES, scope='on_gpu'):
        self.assertDeviceEqual(v.device, '/gpu:0')
Severity: Major
Found in research/slim/nets/inception_resnet_v2_test.py and 5 other locations - About 30 mins to fix
research/slim/nets/inception_resnet_v2_test.py on lines 211..213
research/slim/nets/inception_v4_test.py on lines 162..164
research/slim/nets/inception_v4_test.py on lines 165..167
research/slim/nets/nasnet/nasnet_test.py on lines 296..298
research/slim/nets/nasnet/nasnet_test.py on lines 299..301

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

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

  x = layers.BatchNormalization(
      axis=bn_axis,
      momentum=batch_norm_decay,
      epsilon=batch_norm_epsilon,
      name=bn_name_base + '2c')(
Severity: Major
Found in official/legacy/image_classification/resnet/resnet_model.py and 6 other locations - About 30 mins to fix
official/legacy/image_classification/resnet/resnet_model.py on lines 79..83
official/legacy/image_classification/resnet/resnet_model.py on lines 96..100
official/legacy/image_classification/resnet/resnet_model.py on lines 167..171
official/legacy/image_classification/resnet/resnet_model.py on lines 185..189
official/legacy/image_classification/resnet/resnet_model.py on lines 200..204
official/legacy/image_classification/resnet/resnet_model.py on lines 215..219

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

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

  x = layers.BatchNormalization(
      axis=bn_axis,
      momentum=batch_norm_decay,
      epsilon=batch_norm_epsilon,
      name=bn_name_base + '2c')(
Severity: Major
Found in official/legacy/image_classification/resnet/resnet_model.py and 6 other locations - About 30 mins to fix
official/legacy/image_classification/resnet/resnet_model.py on lines 79..83
official/legacy/image_classification/resnet/resnet_model.py on lines 96..100
official/legacy/image_classification/resnet/resnet_model.py on lines 111..115
official/legacy/image_classification/resnet/resnet_model.py on lines 167..171
official/legacy/image_classification/resnet/resnet_model.py on lines 185..189
official/legacy/image_classification/resnet/resnet_model.py on lines 215..219

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

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

    for v in tf.get_collection(
        tf.GraphKeys.GLOBAL_VARIABLES, scope='on_gpu'):
      self.assertDeviceEqual(v.device, '/gpu:0')
Severity: Major
Found in research/slim/nets/nasnet/nasnet_test.py and 5 other locations - About 30 mins to fix
research/slim/nets/inception_resnet_v2_test.py on lines 211..213
research/slim/nets/inception_resnet_v2_test.py on lines 214..216
research/slim/nets/inception_v4_test.py on lines 162..164
research/slim/nets/inception_v4_test.py on lines 165..167
research/slim/nets/nasnet/nasnet_test.py on lines 296..298

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

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 resnet_v2_101(channel_means, channel_stds, bgr_ordering, **kwargs):
  """The ResNet v2 101 feature extractor."""
  del kwargs

  return CenterNetResnetFeatureExtractor(
research/object_detection/models/center_net_resnet_feature_extractor.py on lines 145..149
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 169..173
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 181..185
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 192..196
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 204..208

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

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

      for v in tf.get_collection(
          tf.GraphKeys.GLOBAL_VARIABLES, scope='on_cpu'):
        self.assertDeviceEqual(v.device, '/cpu:0')
Severity: Major
Found in research/slim/nets/inception_resnet_v2_test.py and 5 other locations - About 30 mins to fix
research/slim/nets/inception_resnet_v2_test.py on lines 214..216
research/slim/nets/inception_v4_test.py on lines 162..164
research/slim/nets/inception_v4_test.py on lines 165..167
research/slim/nets/nasnet/nasnet_test.py on lines 296..298
research/slim/nets/nasnet/nasnet_test.py on lines 299..301

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

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 isinstance(outputs, list):
        cls_inputs = outputs[0]
      else:
        cls_inputs = outputs['sequence_output']
Severity: Major
Found in official/nlp/modeling/models/bert_classifier.py and 5 other locations - About 30 mins to fix
official/nlp/modeling/models/bert_classifier.py on lines 78..81
official/nlp/modeling/models/bert_span_labeler.py on lines 61..64
official/nlp/modeling/models/bert_token_classifier.py on lines 67..70
official/projects/fffner/fffner_classifier.py on lines 78..81
official/projects/qat/nlp/modeling/models/bert_span_labeler.py on lines 61..64

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

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

      tf.summary.histogram('ty%d' % i, self.egomotion[:, i, 1])
Severity: Major
Found in research/vid2depth/model.py and 5 other locations - About 30 mins to fix
research/vid2depth/model.py on lines 289..289
research/vid2depth/model.py on lines 291..291
research/vid2depth/model.py on lines 292..292
research/vid2depth/model.py on lines 293..293
research/vid2depth/model.py on lines 294..294

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

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

      tf.summary.histogram('rz%d' % i, self.egomotion[:, i, 5])
Severity: Major
Found in research/vid2depth/model.py and 5 other locations - About 30 mins to fix
research/vid2depth/model.py on lines 289..289
research/vid2depth/model.py on lines 290..290
research/vid2depth/model.py on lines 291..291
research/vid2depth/model.py on lines 292..292
research/vid2depth/model.py on lines 293..293

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

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 self.parameters.mode not in [base_layers.PREDICT, base_layers.TFLITE]:
      inputs = inputs * mask_rank3
Severity: Major
Found in research/seq_flow_lite/layers/transformer_layers.py and 6 other locations - About 30 mins to fix
research/seq_flow_lite/layers/qrnn_layers.py on lines 433..434
research/seq_flow_lite/layers/transformer_layers.py on lines 275..276
research/seq_flow_lite/layers/transformer_layers.py on lines 289..290
research/seq_flow_lite/layers/transformer_layers.py on lines 294..295
research/seq_flow_lite/layers/transformer_layers.py on lines 464..465
research/seq_flow_lite/layers/transformer_layers.py on lines 491..492

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

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 self.parameters.mode not in [base_layers.PREDICT, base_layers.TFLITE]:
      inputs = inputs * mask_rank3
Severity: Major
Found in research/seq_flow_lite/layers/transformer_layers.py and 6 other locations - About 30 mins to fix
research/seq_flow_lite/layers/qrnn_layers.py on lines 433..434
research/seq_flow_lite/layers/transformer_layers.py on lines 270..271
research/seq_flow_lite/layers/transformer_layers.py on lines 275..276
research/seq_flow_lite/layers/transformer_layers.py on lines 294..295
research/seq_flow_lite/layers/transformer_layers.py on lines 464..465
research/seq_flow_lite/layers/transformer_layers.py on lines 491..492

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

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 resnet_v2_50(channel_means, channel_stds, bgr_ordering, **kwargs):
  """The ResNet v2 50 feature extractor."""
  del kwargs

  return CenterNetResnetFeatureExtractor(
research/object_detection/models/center_net_resnet_feature_extractor.py on lines 133..137
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 169..173
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 181..185
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 192..196
research/object_detection/models/center_net_resnet_v1_fpn_feature_extractor.py on lines 204..208

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

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