tensorflow/models

View on GitHub
official/legacy/detection/utils/box_utils.py

Summary

Maintainability
F
5 days
Test Coverage

File box_utils.py has 552 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2024 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Major
Found in official/legacy/detection/utils/box_utils.py - About 1 day to fix

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

        if weights:
          dy /= weights[0]
          dx /= weights[1]
          dh /= weights[2]
          dw /= weights[3]
    Severity: Major
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 2 hrs to fix
    official/legacy/detection/utils/box_utils.py on lines 488..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 56.

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

        if weights:
          left *= weights[0]
          right *= weights[1]
          top *= weights[2]
          bottom *= weights[3]
    Severity: Major
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 2 hrs to fix
    official/legacy/detection/utils/box_utils.py on lines 298..302

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

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

        if weights:
          encoded_dy *= weights[0]
          encoded_dx *= weights[1]
          encoded_dh *= weights[2]
          encoded_dw *= weights[3]
    Severity: Major
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 2 hrs to fix
    official/legacy/detection/utils/box_utils.py on lines 447..451

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

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

        if weights:
          left /= weights[0]
          right /= weights[1]
          top /= weights[2]
          bottom /= weights[3]
    Severity: Major
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 2 hrs to fix
    official/legacy/detection/utils/box_utils.py on lines 333..337

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

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

      outer_boxes = tf.stack([
          centers_y - box_height / 2.0, centers_x - box_width / 2.0,
          centers_y + box_height / 2.0, centers_x + box_width / 2.0
    Severity: Major
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 2 hrs to fix
    research/object_detection/core/preprocessor_test.py on lines 4256..4258

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

    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

          batch_indices = (
              tf.expand_dims(tf.range(top_k_indices_shape[0]), axis=-1) *
              tf.ones([1, top_k_indices_shape[-1]], dtype=tf.int32))
    Severity: Major
    Found in official/legacy/detection/utils/box_utils.py and 5 other locations - About 2 hrs to fix
    official/legacy/detection/ops/target_ops.py on lines 78..80
    official/legacy/detection/ops/target_ops.py on lines 202..204
    official/legacy/detection/ops/target_ops.py on lines 263..265
    official/legacy/detection/ops/target_ops.py on lines 278..280
    official/legacy/detection/ops/target_ops.py on lines 505..507

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

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

        new_center_x = (xmin + xmax) / 2.0 + bbox_jitters[..., 0:1] * width
    Severity: Major
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 1 hr to fix
    official/legacy/detection/utils/box_utils.py on lines 101..101

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

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

        new_center_y = (ymin + ymax) / 2.0 + bbox_jitters[..., 1:2] * height
    Severity: Major
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 1 hr to fix
    official/legacy/detection/utils/box_utils.py on lines 100..100

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

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

      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

    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

      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

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

      centers_y = (boxes[..., 0] + boxes[..., 2]) / 2.0
    Severity: Minor
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 45 mins to fix
    official/legacy/detection/utils/box_utils.py on lines 241..241

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

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

      box_width = (boxes[..., 3] - boxes[..., 1]) * scale
    Severity: Minor
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 45 mins to fix
    official/legacy/detection/utils/box_utils.py on lines 242..242

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

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

      centers_x = (boxes[..., 1] + boxes[..., 3]) / 2.0
    Severity: Minor
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 45 mins to fix
    official/legacy/detection/utils/box_utils.py on lines 240..240

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

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

      box_height = (boxes[..., 2] - boxes[..., 0]) * scale
    Severity: Minor
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 45 mins to fix
    official/legacy/detection/utils/box_utils.py on lines 243..243

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

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

        u_area = bb_area + tf.transpose(gt_area, [0, 2, 1]) - i_area + 1e-8
    Severity: Minor
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 40 mins to fix
    research/object_detection/core/post_processing.py on lines 71..72

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 34.

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

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

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

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

    Refactorings

    Further Reading

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

        filtered_boxes = tf.cast(
            tf.expand_dims(filtered_mask, axis=-1), dtype=boxes.dtype) * boxes
    Severity: Minor
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 35 mins to fix
    official/legacy/detection/utils/box_utils.py on lines 573..574

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

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

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

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

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

    Refactorings

    Further Reading

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

        filtered_boxes = tf.cast(
            tf.expand_dims(filtered_mask, axis=-1), dtype=boxes.dtype) * boxes
    Severity: Minor
    Found in official/legacy/detection/utils/box_utils.py and 1 other location - About 35 mins to fix
    official/legacy/detection/utils/box_utils.py on lines 603..604

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

    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

    There are no issues that match your filters.

    Category
    Status