tensorflow/models

View on GitHub
research/object_detection/builders/losses_builder_test.py

Summary

Maintainability
F
1 wk
Test Coverage

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

# Copyright 2017 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 research/object_detection/builders/losses_builder_test.py - About 1 day to fix

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

      def test_build_expected_sampling(self):
        losses_text_proto = """
          localization_loss {
            weighted_l2 {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 2 other locations - About 6 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 447..473
    research/object_detection/builders/losses_builder_test.py on lines 503..528

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

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

      def test_build_all_loss_parameters(self):
        losses_text_proto = """
          localization_loss {
            weighted_l2 {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 2 other locations - About 6 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 475..500
    research/object_detection/builders/losses_builder_test.py on lines 503..528

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

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

      def test_build_reweighting_unmatched_anchors(self):
        losses_text_proto = """
          localization_loss {
            weighted_l2 {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 2 other locations - About 6 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 447..473
    research/object_detection/builders/losses_builder_test.py on lines 475..500

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

    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

      def test_build_penalty_reduced_logistic_focal_loss(self):
        losses_text_proto = """
          classification_loss {
            penalty_reduced_logistic_focal_loss {
              alpha: 2.0
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 1 other location - About 4 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 191..210

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

    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

      def test_build_weighted_sigmoid_focal_loss_non_default(self):
        losses_text_proto = """
          classification_loss {
            weighted_sigmoid_focal {
              alpha: 0.25
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 1 other location - About 4 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 318..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 85.

    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

      def test_build_hard_example_miner_for_classification_loss(self):
        losses_text_proto = """
          localization_loss {
            weighted_l2 {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 1 other location - About 3 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 397..415

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

    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

      def test_build_hard_example_miner_for_localization_loss(self):
        losses_text_proto = """
          localization_loss {
            weighted_l2 {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 1 other location - About 3 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 377..395

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

    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

      def test_build_weighted_smooth_l1_localization_loss_default_delta(self):
        losses_text_proto = """
          localization_loss {
            weighted_smooth_l1 {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 1 other location - About 3 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 64..81

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

    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

      def test_build_weighted_smooth_l1_localization_loss_non_default_delta(self):
        losses_text_proto = """
          localization_loss {
            weighted_smooth_l1 {
              delta: 0.1
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 1 other location - About 3 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 46..62

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

    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

      def test_build_weighted_sigmoid_classification_loss(self):
        losses_text_proto = """
          classification_loss {
            weighted_sigmoid {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 7 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 29..44
    research/object_detection/builders/losses_builder_test.py on lines 83..98
    research/object_detection/builders/losses_builder_test.py on lines 100..115
    research/object_detection/builders/losses_builder_test.py on lines 212..227
    research/object_detection/builders/losses_builder_test.py on lines 229..245
    research/object_detection/builders/losses_builder_test.py on lines 247..263
    research/object_detection/builders/losses_builder_test.py on lines 265..281

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

    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

      def test_build_weighted_iou_localization_loss(self):
        losses_text_proto = """
          localization_loss {
            weighted_iou {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 7 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 29..44
    research/object_detection/builders/losses_builder_test.py on lines 100..115
    research/object_detection/builders/losses_builder_test.py on lines 155..170
    research/object_detection/builders/losses_builder_test.py on lines 212..227
    research/object_detection/builders/losses_builder_test.py on lines 229..245
    research/object_detection/builders/losses_builder_test.py on lines 247..263
    research/object_detection/builders/losses_builder_test.py on lines 265..281

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

    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

      def test_build_weighted_logits_softmax_classification_loss(self):
        losses_text_proto = """
          classification_loss {
            weighted_logits_softmax {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 7 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 29..44
    research/object_detection/builders/losses_builder_test.py on lines 83..98
    research/object_detection/builders/losses_builder_test.py on lines 100..115
    research/object_detection/builders/losses_builder_test.py on lines 155..170
    research/object_detection/builders/losses_builder_test.py on lines 212..227
    research/object_detection/builders/losses_builder_test.py on lines 247..263
    research/object_detection/builders/losses_builder_test.py on lines 265..281

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

    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

      def test_build_bootstrapped_sigmoid_classification_loss(self):
        losses_text_proto = """
          classification_loss {
            bootstrapped_sigmoid {
              alpha: 0.5
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 7 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 29..44
    research/object_detection/builders/losses_builder_test.py on lines 83..98
    research/object_detection/builders/losses_builder_test.py on lines 100..115
    research/object_detection/builders/losses_builder_test.py on lines 155..170
    research/object_detection/builders/losses_builder_test.py on lines 212..227
    research/object_detection/builders/losses_builder_test.py on lines 229..245
    research/object_detection/builders/losses_builder_test.py on lines 247..263

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

    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

      def test_build_weighted_giou_localization_loss(self):
        losses_text_proto = """
          localization_loss {
            weighted_giou {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 7 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 29..44
    research/object_detection/builders/losses_builder_test.py on lines 83..98
    research/object_detection/builders/losses_builder_test.py on lines 155..170
    research/object_detection/builders/losses_builder_test.py on lines 212..227
    research/object_detection/builders/losses_builder_test.py on lines 229..245
    research/object_detection/builders/losses_builder_test.py on lines 247..263
    research/object_detection/builders/losses_builder_test.py on lines 265..281

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

    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

      def test_build_weighted_softmax_classification_loss_with_logit_scale(self):
        losses_text_proto = """
          classification_loss {
            weighted_softmax {
              logit_scale: 2.0
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 7 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 29..44
    research/object_detection/builders/losses_builder_test.py on lines 83..98
    research/object_detection/builders/losses_builder_test.py on lines 100..115
    research/object_detection/builders/losses_builder_test.py on lines 155..170
    research/object_detection/builders/losses_builder_test.py on lines 212..227
    research/object_detection/builders/losses_builder_test.py on lines 229..245
    research/object_detection/builders/losses_builder_test.py on lines 265..281

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

    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

      def test_build_weighted_l2_localization_loss(self):
        losses_text_proto = """
          localization_loss {
            weighted_l2 {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 7 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 83..98
    research/object_detection/builders/losses_builder_test.py on lines 100..115
    research/object_detection/builders/losses_builder_test.py on lines 155..170
    research/object_detection/builders/losses_builder_test.py on lines 212..227
    research/object_detection/builders/losses_builder_test.py on lines 229..245
    research/object_detection/builders/losses_builder_test.py on lines 247..263
    research/object_detection/builders/losses_builder_test.py on lines 265..281

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

    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

      def test_build_weighted_softmax_classification_loss(self):
        losses_text_proto = """
          classification_loss {
            weighted_softmax {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 7 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 29..44
    research/object_detection/builders/losses_builder_test.py on lines 83..98
    research/object_detection/builders/losses_builder_test.py on lines 100..115
    research/object_detection/builders/losses_builder_test.py on lines 155..170
    research/object_detection/builders/losses_builder_test.py on lines 229..245
    research/object_detection/builders/losses_builder_test.py on lines 247..263
    research/object_detection/builders/losses_builder_test.py on lines 265..281

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

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

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

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

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

    Refactorings

    Further Reading

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

      def test_build_logits_softmax_loss(self):
        losses_text_proto = """
          weighted_logits_softmax {
          }
        """
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 4 other locations - About 2 hrs to fix
    research/object_detection/builders/box_coder_builder_test.py on lines 87..97
    research/object_detection/builders/region_similarity_calculator_builder_test.py on lines 28..38
    research/object_detection/builders/region_similarity_calculator_builder_test.py on lines 40..50
    research/object_detection/builders/region_similarity_calculator_builder_test.py on lines 52..62

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

    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

      def test_build_softmax_loss_by_default(self):
        losses_text_proto = """
        """
        losses_proto = losses_pb2.ClassificationLoss()
        text_format.Merge(losses_text_proto, losses_proto)
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 6 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 553..563
    research/object_detection/builders/losses_builder_test.py on lines 565..575
    research/object_detection/builders/losses_builder_test.py on lines 590..600
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 74..93
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 95..109
    research/object_detection/builders/target_assigner_builder_test.py on lines 27..46

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

    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

      def test_build_sigmoid_focal_loss(self):
        losses_text_proto = """
          weighted_sigmoid_focal {
          }
        """
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 6 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 553..563
    research/object_detection/builders/losses_builder_test.py on lines 565..575
    research/object_detection/builders/losses_builder_test.py on lines 602..610
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 74..93
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 95..109
    research/object_detection/builders/target_assigner_builder_test.py on lines 27..46

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

    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

      def test_build_sigmoid_loss(self):
        losses_text_proto = """
          weighted_sigmoid {
          }
        """
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 6 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 565..575
    research/object_detection/builders/losses_builder_test.py on lines 590..600
    research/object_detection/builders/losses_builder_test.py on lines 602..610
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 74..93
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 95..109
    research/object_detection/builders/target_assigner_builder_test.py on lines 27..46

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

    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

      def test_build_softmax_loss(self):
        losses_text_proto = """
          weighted_softmax {
          }
        """
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 6 other locations - About 2 hrs to fix
    research/object_detection/builders/losses_builder_test.py on lines 553..563
    research/object_detection/builders/losses_builder_test.py on lines 590..600
    research/object_detection/builders/losses_builder_test.py on lines 602..610
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 74..93
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 95..109
    research/object_detection/builders/target_assigner_builder_test.py on lines 27..46

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

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

      def test_raise_error_when_both_focal_loss_and_hard_example_miner(self):
        losses_text_proto = """
          localization_loss {
            weighted_l2 {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 8 other locations - About 1 hr to fix
    research/object_detection/builders/anchor_generator_builder_test.py on lines 238..244
    research/object_detection/builders/box_coder_builder_test.py on lines 126..132
    research/object_detection/builders/input_reader_builder_tf1_test.py on lines 294..303
    research/object_detection/builders/losses_builder_test.py on lines 139..149
    research/object_detection/builders/losses_builder_test.py on lines 306..316
    research/object_detection/builders/matcher_builder_test.py on lines 95..101
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 111..117
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 213..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 49.

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

      def test_raise_error_on_empty_localization_config(self):
        losses_text_proto = """
          classification_loss {
            weighted_softmax {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 8 other locations - About 1 hr to fix
    research/object_detection/builders/anchor_generator_builder_test.py on lines 238..244
    research/object_detection/builders/box_coder_builder_test.py on lines 126..132
    research/object_detection/builders/input_reader_builder_tf1_test.py on lines 294..303
    research/object_detection/builders/losses_builder_test.py on lines 306..316
    research/object_detection/builders/losses_builder_test.py on lines 530..548
    research/object_detection/builders/matcher_builder_test.py on lines 95..101
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 111..117
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 213..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 49.

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

      def test_raise_error_on_empty_config(self):
        losses_text_proto = """
          localization_loss {
            weighted_l2 {
            }
    Severity: Major
    Found in research/object_detection/builders/losses_builder_test.py and 8 other locations - About 1 hr to fix
    research/object_detection/builders/anchor_generator_builder_test.py on lines 238..244
    research/object_detection/builders/box_coder_builder_test.py on lines 126..132
    research/object_detection/builders/input_reader_builder_tf1_test.py on lines 294..303
    research/object_detection/builders/losses_builder_test.py on lines 139..149
    research/object_detection/builders/losses_builder_test.py on lines 530..548
    research/object_detection/builders/matcher_builder_test.py on lines 95..101
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 111..117
    research/object_detection/builders/optimizer_builder_tf1_test.py on lines 213..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 49.

    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