tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

    additional_false_sample = tf.less_equal(
        tf.cumsum(tf.cast(tf.logical_not(indicator), tf.float32)),
        batch_size - num_true_sampled)
official/vision/ops/sampling_ops.py on lines 266..268
research/object_detection/core/balanced_positive_negative_sampler.py on lines 152..154

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

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

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

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

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

Refactorings

Further Reading

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

  if boxes.shape[-1] != 4:
    raise ValueError('boxes.shape[1] is {:d}, but must be 4.'.format(
        boxes.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 57..59
official/legacy/detection/utils/box_utils.py on lines 88..90
official/legacy/detection/utils/box_utils.py on lines 130..132
official/legacy/detection/utils/box_utils.py on lines 202..204
official/legacy/detection/utils/box_utils.py on lines 270..272
official/legacy/detection/utils/box_utils.py on lines 323..325
official/legacy/detection/utils/box_utils.py on lines 391..393
official/legacy/detection/utils/box_utils.py on lines 477..480
official/legacy/detection/utils/box_utils.py on lines 539..541

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

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

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

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

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

Refactorings

Further Reading

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

    if self.use_target_values:
      last_values = shift_values(
          target_values, self.gamma, self.rollout,
          final_target_values)
    else:
Severity: Major
Found in research/pcl_rl/objective.py and 2 other locations - About 1 hr to fix
research/pcl_rl/objective.py on lines 138..144
research/pcl_rl/objective.py on lines 241..247

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

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

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

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

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

Refactorings

Further Reading

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

    similarity = np.array([[1, 1, 1, 3, 1],
                           [2, -1, 2, 0, 4],
                           [3, 0, -1, 0, 0]], dtype=np.float32)
Severity: Major
Found in research/object_detection/matchers/argmax_matcher_test.py and 9 other locations - About 1 hr to fix
research/object_detection/matchers/argmax_matcher_test.py on lines 37..39
research/object_detection/matchers/argmax_matcher_test.py on lines 69..71
research/object_detection/matchers/argmax_matcher_test.py on lines 94..96
research/object_detection/matchers/argmax_matcher_test.py on lines 146..148
research/object_detection/matchers/argmax_matcher_test.py on lines 171..173
research/object_detection/utils/np_box_list_ops_test.py on lines 394..397
research/object_detection/utils/np_box_mask_list_ops_test.py on lines 170..173
research/object_detection/utils/target_assigner_utils_test.py on lines 127..130
research/object_detection/utils/target_assigner_utils_test.py on lines 158..161

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

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

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

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

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

Refactorings

Further Reading

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

      class_onehot = tf.constant(
          [[0, 0, 1, 0, 0],
           [0, 1, 0, 0, 0],
           [0, 0, 1, 0, 1]], dtype=tf.float32)
research/object_detection/matchers/argmax_matcher_test.py on lines 37..39
research/object_detection/matchers/argmax_matcher_test.py on lines 69..71
research/object_detection/matchers/argmax_matcher_test.py on lines 94..96
research/object_detection/matchers/argmax_matcher_test.py on lines 121..123
research/object_detection/matchers/argmax_matcher_test.py on lines 146..148
research/object_detection/matchers/argmax_matcher_test.py on lines 171..173
research/object_detection/utils/np_box_list_ops_test.py on lines 394..397
research/object_detection/utils/np_box_mask_list_ops_test.py on lines 170..173
research/object_detection/utils/target_assigner_utils_test.py on lines 127..130

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

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

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

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

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

Refactorings

Further Reading

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

    scores = np.array([[-0.2, 0.1, 0.5, -0.4, 0.3],
                       [0.7, -0.7, 0.6, 0.2, -0.9],
                       [0.4, 0.34, -0.9, 0.2, 0.31]],
                      dtype=np.float32)
research/object_detection/matchers/argmax_matcher_test.py on lines 37..39
research/object_detection/matchers/argmax_matcher_test.py on lines 69..71
research/object_detection/matchers/argmax_matcher_test.py on lines 94..96
research/object_detection/matchers/argmax_matcher_test.py on lines 121..123
research/object_detection/matchers/argmax_matcher_test.py on lines 146..148
research/object_detection/matchers/argmax_matcher_test.py on lines 171..173
research/object_detection/utils/np_box_list_ops_test.py on lines 394..397
research/object_detection/utils/target_assigner_utils_test.py on lines 127..130
research/object_detection/utils/target_assigner_utils_test.py on lines 158..161

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

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

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

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

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

Refactorings

Further Reading

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

def _get_labelmap_path():
  """Returns an absolute path to label map file."""
  parent_path = os.path.dirname(tf.resource_loader.get_data_files_path())
  return os.path.join(parent_path, 'data',
                      'pet_label_map.pbtxt')
Severity: Major
Found in research/object_detection/builders/dataset_builder_test.py and 2 other locations - About 1 hr to fix
research/object_detection/builders/decoder_builder_test.py on lines 34..38
research/object_detection/builders/input_reader_builder_tf1_test.py on lines 33..37

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

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

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

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

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

Refactorings

Further Reading

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

  if encoded_boxes.shape[-1] != 4:
    raise ValueError('encoded_boxes.shape[-1] is {:d}, but must be 4.'.format(
        encoded_boxes.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 57..59
official/legacy/detection/utils/box_utils.py on lines 88..90
official/legacy/detection/utils/box_utils.py on lines 130..132
official/legacy/detection/utils/box_utils.py on lines 202..204
official/legacy/detection/utils/box_utils.py on lines 270..272
official/legacy/detection/utils/box_utils.py on lines 391..393
official/legacy/detection/utils/box_utils.py on lines 477..480
official/legacy/detection/utils/box_utils.py on lines 539..541
official/legacy/detection/utils/box_utils.py on lines 596..598

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

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

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

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

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

Refactorings

Further Reading

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

  if boxes.shape[-1] != 4:
    raise ValueError('boxes.shape[-1] is {:d}, but must be 4.'.format(
        boxes.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 57..59
official/legacy/detection/utils/box_utils.py on lines 88..90
official/legacy/detection/utils/box_utils.py on lines 130..132
official/legacy/detection/utils/box_utils.py on lines 270..272
official/legacy/detection/utils/box_utils.py on lines 323..325
official/legacy/detection/utils/box_utils.py on lines 391..393
official/legacy/detection/utils/box_utils.py on lines 477..480
official/legacy/detection/utils/box_utils.py on lines 539..541
official/legacy/detection/utils/box_utils.py on lines 596..598

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

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

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

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

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

Refactorings

Further Reading

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

    similarity = np.array([[1., 1, 1, 3, 1],
                           [2, -1, 2, 0, 4],
                           [3, 0, -1, 0, 0]], dtype=np.float32)
Severity: Major
Found in research/object_detection/matchers/argmax_matcher_test.py and 9 other locations - About 1 hr to fix
research/object_detection/matchers/argmax_matcher_test.py on lines 69..71
research/object_detection/matchers/argmax_matcher_test.py on lines 94..96
research/object_detection/matchers/argmax_matcher_test.py on lines 121..123
research/object_detection/matchers/argmax_matcher_test.py on lines 146..148
research/object_detection/matchers/argmax_matcher_test.py on lines 171..173
research/object_detection/utils/np_box_list_ops_test.py on lines 394..397
research/object_detection/utils/np_box_mask_list_ops_test.py on lines 170..173
research/object_detection/utils/target_assigner_utils_test.py on lines 127..130
research/object_detection/utils/target_assigner_utils_test.py on lines 158..161

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

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

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

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

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

Refactorings

Further Reading

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

  if boxes.shape[-1] != 4:
    raise ValueError('boxes.shape[-1] is {:d}, but must be 4.'.format(
        boxes.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 88..90
official/legacy/detection/utils/box_utils.py on lines 130..132
official/legacy/detection/utils/box_utils.py on lines 202..204
official/legacy/detection/utils/box_utils.py on lines 270..272
official/legacy/detection/utils/box_utils.py on lines 323..325
official/legacy/detection/utils/box_utils.py on lines 391..393
official/legacy/detection/utils/box_utils.py on lines 477..480
official/legacy/detection/utils/box_utils.py on lines 539..541
official/legacy/detection/utils/box_utils.py on lines 596..598

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

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

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

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

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

Refactorings

Further Reading

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

  if encoded_boxes_lrtb.shape[-1] != 4:
    raise ValueError(
        'encoded_boxes_lrtb.shape[-1] is {:d}, but must be 4.'
        .format(encoded_boxes_lrtb.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 57..59
official/legacy/detection/utils/box_utils.py on lines 88..90
official/legacy/detection/utils/box_utils.py on lines 130..132
official/legacy/detection/utils/box_utils.py on lines 202..204
official/legacy/detection/utils/box_utils.py on lines 270..272
official/legacy/detection/utils/box_utils.py on lines 323..325
official/legacy/detection/utils/box_utils.py on lines 391..393
official/legacy/detection/utils/box_utils.py on lines 539..541
official/legacy/detection/utils/box_utils.py on lines 596..598

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

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

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

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

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

Refactorings

Further Reading

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

    if self.use_target_values:
      last_values = shift_values(
          target_values, self.gamma, self.rollout,
          final_target_values)
    else:
Severity: Major
Found in research/pcl_rl/objective.py and 2 other locations - About 1 hr to fix
research/pcl_rl/objective.py on lines 138..144
research/pcl_rl/objective.py on lines 316..322

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

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

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

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

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

Refactorings

Further Reading

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

def _get_labelmap_path():
  """Returns an absolute path to label map file."""
  parent_path = os.path.dirname(tf.resource_loader.get_data_files_path())
  return os.path.join(parent_path, 'data',
                      'pet_label_map.pbtxt')
research/object_detection/builders/dataset_builder_test.py on lines 51..55
research/object_detection/builders/decoder_builder_test.py on lines 34..38

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

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

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

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

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

Refactorings

Further Reading

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

    if self.use_target_values:
      last_values = shift_values(
          target_values, self.gamma, self.rollout,
          final_target_values)
    else:
Severity: Major
Found in research/pcl_rl/objective.py and 2 other locations - About 1 hr to fix
research/pcl_rl/objective.py on lines 241..247
research/pcl_rl/objective.py on lines 316..322

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

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

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

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

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

Refactorings

Further Reading

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

    similarity = np.array([[1, 1, 1, 3, 1],
                           [-1, 0, -2, -2, -1],
                           [3, 0, -1, 2, 0]], dtype=np.float32)
Severity: Major
Found in research/object_detection/matchers/argmax_matcher_test.py and 9 other locations - About 1 hr to fix
research/object_detection/matchers/argmax_matcher_test.py on lines 37..39
research/object_detection/matchers/argmax_matcher_test.py on lines 69..71
research/object_detection/matchers/argmax_matcher_test.py on lines 94..96
research/object_detection/matchers/argmax_matcher_test.py on lines 121..123
research/object_detection/matchers/argmax_matcher_test.py on lines 171..173
research/object_detection/utils/np_box_list_ops_test.py on lines 394..397
research/object_detection/utils/np_box_mask_list_ops_test.py on lines 170..173
research/object_detection/utils/target_assigner_utils_test.py on lines 127..130
research/object_detection/utils/target_assigner_utils_test.py on lines 158..161

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

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

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

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

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

Refactorings

Further Reading

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

  if boxes.shape[-1] != 4:
    raise ValueError('boxes.shape[-1] is {:d}, but must be 4.'.format(
        boxes.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 57..59
official/legacy/detection/utils/box_utils.py on lines 130..132
official/legacy/detection/utils/box_utils.py on lines 202..204
official/legacy/detection/utils/box_utils.py on lines 270..272
official/legacy/detection/utils/box_utils.py on lines 323..325
official/legacy/detection/utils/box_utils.py on lines 391..393
official/legacy/detection/utils/box_utils.py on lines 477..480
official/legacy/detection/utils/box_utils.py on lines 539..541
official/legacy/detection/utils/box_utils.py on lines 596..598

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

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

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

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

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

Refactorings

Further Reading

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

  if boxes.shape[-1] != 4:
    raise ValueError(
        'boxes.shape[-1] is {:d}, but must be 4.'.format(boxes.shape[-1]))
Severity: Major
Found in official/legacy/detection/utils/box_utils.py and 9 other locations - About 1 hr to fix
official/legacy/detection/utils/box_utils.py on lines 57..59
official/legacy/detection/utils/box_utils.py on lines 88..90
official/legacy/detection/utils/box_utils.py on lines 130..132
official/legacy/detection/utils/box_utils.py on lines 202..204
official/legacy/detection/utils/box_utils.py on lines 270..272
official/legacy/detection/utils/box_utils.py on lines 323..325
official/legacy/detection/utils/box_utils.py on lines 477..480
official/legacy/detection/utils/box_utils.py on lines 539..541
official/legacy/detection/utils/box_utils.py on lines 596..598

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

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

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

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

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

Refactorings

Further Reading

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

    scores = np.array([[-0.2, 0.1, 0.5, -0.4, 0.3],
                       [0.7, -0.7, 0.6, 0.2, -0.9],
                       [0.4, 0.34, -0.9, 0.2, 0.31]],
                      dtype=np.float32)
Severity: Major
Found in research/object_detection/utils/np_box_list_ops_test.py and 9 other locations - About 1 hr to fix
research/object_detection/matchers/argmax_matcher_test.py on lines 37..39
research/object_detection/matchers/argmax_matcher_test.py on lines 69..71
research/object_detection/matchers/argmax_matcher_test.py on lines 94..96
research/object_detection/matchers/argmax_matcher_test.py on lines 121..123
research/object_detection/matchers/argmax_matcher_test.py on lines 146..148
research/object_detection/matchers/argmax_matcher_test.py on lines 171..173
research/object_detection/utils/np_box_mask_list_ops_test.py on lines 170..173
research/object_detection/utils/target_assigner_utils_test.py on lines 127..130
research/object_detection/utils/target_assigner_utils_test.py on lines 158..161

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

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

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

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

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

Refactorings

Further Reading

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

    if bbox is None:
      bbox = tf.constant([0.0, 0.0, 1.0, 1.0],
                         dtype=tf.float32,
                         shape=[1, 1, 4])
Severity: Major
Found in research/slim/preprocessing/inception_preprocessing.py and 2 other locations - About 1 hr to fix
research/attention_ocr/python/inception_preprocessing.py on lines 192..194
research/cognitive_planning/preprocessing/inception_preprocessing.py on lines 187..190

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

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