tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

    self._depth_fn = lambda d: max(
        int(d * self._depth_multiplier), self._min_depth)
research/object_detection/models/ssd_mobilenet_v1_fpn_keras_feature_extractor.py on lines 155..156
research/object_detection/models/ssd_mobilenet_v2_fpn_keras_feature_extractor.py on lines 154..155

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

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

    self._depth_fn = lambda d: max(
        int(d * self._depth_multiplier), self._min_depth)
research/object_detection/models/ssd_mobilenet_v2_fpn_keras_feature_extractor.py on lines 154..155
research/object_detection/models/ssd_resnet_v1_fpn_keras_feature_extractor.py on lines 152..153

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

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

    data_augmentation_options = [
        (preprocessor.resize_image, {
            'new_height': 20,
            'new_width': 20,
            'method': tf.image.ResizeMethod.NEAREST_NEIGHBOR
Severity: Minor
Found in research/object_detection/inputs_test.py and 2 other locations - About 30 mins to fix
research/object_detection/inputs_test.py on lines 721..727
research/object_detection/inputs_test.py on lines 748..754

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

    self._assertProtoEqual(
        example.features.feature['image/filename'].bytes_list.value,
        [six.b(image_file_name)])
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 100..102
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 167..169
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 276..278
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 77..79
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 80..82
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 82..84
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 85..87

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

    self._assertProtoEqual(
        example.features.feature['image/source_id'].bytes_list.value,
        [six.b(save_path)])
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 100..102
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 167..169
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 276..278
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 393..395
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 77..79
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 82..84
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 85..87

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

    if groundtruth_area is not None and not groundtruth_area.shape[0]:
      groundtruth_area = None
Severity: Major
Found in research/object_detection/metrics/lvis_evaluation.py and 7 other locations - About 30 mins to fix
research/object_detection/metrics/coco_evaluation.py on lines 126..127
research/object_detection/metrics/coco_evaluation.py on lines 128..129
research/object_detection/metrics/coco_evaluation.py on lines 130..131
research/object_detection/metrics/coco_evaluation.py on lines 132..134
research/object_detection/metrics/coco_evaluation.py on lines 203..204
research/object_detection/metrics/coco_evaluation.py on lines 1038..1039
research/object_detection/metrics/coco_evaluation.py on lines 1040..1041

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

    if detection_keypoints is not None and not detection_keypoints.shape[0]:
      detection_keypoints = None
Severity: Major
Found in research/object_detection/metrics/coco_evaluation.py and 7 other locations - About 30 mins to fix
research/object_detection/metrics/coco_evaluation.py on lines 126..127
research/object_detection/metrics/coco_evaluation.py on lines 128..129
research/object_detection/metrics/coco_evaluation.py on lines 130..131
research/object_detection/metrics/coco_evaluation.py on lines 132..134
research/object_detection/metrics/coco_evaluation.py on lines 1038..1039
research/object_detection/metrics/coco_evaluation.py on lines 1040..1041
research/object_detection/metrics/lvis_evaluation.py on lines 148..149

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

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

  for flag_name in required_flags:
    if not getattr(FLAGS, flag_name):
      raise ValueError('Flag --{} is required'.format(flag_name))
research/object_detection/inference/infer_detections.py on lines 61..63
research/object_detection/metrics/offline_eval_map_corloc.py on lines 153..155

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

    self._assertProtoEqual(
        example.features.feature['image/source_id'].bytes_list.value,
        [six.b(image_file_name)])
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 100..102
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 167..169
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 276..278
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 393..395
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 77..79
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 80..82
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 82..84

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

    self._assertProtoEqual(
        example.features.feature['image/filename'].bytes_list.value,
        [six.b(save_path)])
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 100..102
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 167..169
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 276..278
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 393..395
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 80..82
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 82..84
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 85..87

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

    self._assertProtoEqual(
        example.features.feature['image/filename'].bytes_list.value,
        [six.b(image_file_name)])
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 167..169
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 276..278
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 393..395
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 77..79
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 80..82
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 82..84
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 85..87

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

    self._assertProtoEqual(
        example.features.feature['image/filename'].bytes_list.value,
        [six.b(image_file_name)])
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 100..102
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 276..278
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 393..395
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 77..79
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 80..82
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 82..84
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 85..87

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 * mask3
Severity: Major
Found in research/seq_flow_lite/layers/qrnn_layers.py and 6 other locations - About 30 mins to fix
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
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 8 locations. Consider refactoring.
Open

    self._assertProtoEqual(
        example.features.feature['image/filename'].bytes_list.value,
        [six.b(image_file_name)])
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 100..102
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 167..169
research/object_detection/dataset_tools/create_coco_tf_record_test.py on lines 393..395
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 77..79
research/object_detection/dataset_tools/create_kitti_tf_record_test.py on lines 80..82
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 82..84
research/object_detection/dataset_tools/create_pascal_tf_record_test.py on lines 85..87

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

    if groundtruth_keypoints is not None and not groundtruth_keypoints.shape[0]:
      groundtruth_keypoints = None
Severity: Major
Found in research/object_detection/metrics/coco_evaluation.py and 7 other locations - About 30 mins to fix
research/object_detection/metrics/coco_evaluation.py on lines 126..127
research/object_detection/metrics/coco_evaluation.py on lines 128..129
research/object_detection/metrics/coco_evaluation.py on lines 132..134
research/object_detection/metrics/coco_evaluation.py on lines 203..204
research/object_detection/metrics/coco_evaluation.py on lines 1038..1039
research/object_detection/metrics/coco_evaluation.py on lines 1040..1041
research/object_detection/metrics/lvis_evaluation.py on lines 148..149

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

  shortcut = layers.BatchNormalization(
      axis=bn_axis,
      momentum=batch_norm_decay,
      epsilon=batch_norm_epsilon,
      name=bn_name_base + '1')(
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 200..204

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]:
      outputs = outputs * 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 289..290
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

  x = layers.BatchNormalization(
      axis=bn_axis,
      momentum=batch_norm_decay,
      epsilon=batch_norm_epsilon,
      name=bn_name_base + '2a')(
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 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 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 + '2a')(
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 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

    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 289..290
research/seq_flow_lite/layers/transformer_layers.py on lines 294..295
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

Severity
Category
Status
Source
Language