tensorflow/models

View on GitHub
official/vision/modeling/layers/detection_generator_test.py

Summary

Maintainability
F
6 days
Test Coverage

File detection_generator_test.py has 415 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: Minor
Found in official/vision/modeling/layers/detection_generator_test.py - About 5 hrs to fix

    Function testDetectionsOutputShape has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def testDetectionsOutputShape(
          self,
          nms_version,
          has_att_heads,
          use_cpu_nms,
    Severity: Minor
    Found in official/vision/modeling/layers/detection_generator_test.py - About 1 hr to fix

      Function testDetectionsOutputShape has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        def testDetectionsOutputShape(
            self,
            nms_version,
            has_att_heads,
            use_cpu_nms,
      Severity: Minor
      Found in official/vision/modeling/layers/detection_generator_test.py - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function testDetectionsOutputShape has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def testDetectionsOutputShape(
      Severity: Minor
      Found in official/vision/modeling/layers/detection_generator_test.py - About 45 mins to fix

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

                    tf.stack([
                        anchor_boxes['1'][0, 0, 0:4], anchor_boxes['1'][0, 0, 8:12],
                        anchor_boxes['1'][0, 1, 0:4], anchor_boxes['1'][1, 0, 8:12],
                        anchor_boxes['2'][0, 0, 4:8]
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 1 other location - About 1 day to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 326..329

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

        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

                    tf.stack([
                        anchor_boxes['1'][0, 1, 8:12], anchor_boxes['1'][1, 0, 0:4],
                        anchor_boxes['1'][1, 1, 0:4], anchor_boxes['1'][1, 1, 8:12],
                        anchor_boxes['2'][0, 0, 4:8]
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 1 other location - About 1 day to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 320..323

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

        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

              att_outputs = {
                  'depth': {
                      '4':
                          tf.reshape(
                              tf.convert_to_tensor(
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 1 other location - About 6 hrs to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 206..212

        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

            box_outputs = {
                '4': tf.reshape(tf.convert_to_tensor(
                    box_outputs_all[0:64], dtype=tf.float32), [1, 8, 8, 4]),
                '5': tf.reshape(tf.convert_to_tensor(
                    box_outputs_all[64:80], dtype=tf.float32), [1, 4, 4, 4]),
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 1 other location - About 6 hrs to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 216..232

        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

            anchor_boxes = {
                '4': tf.zeros(shape=[1, 8, 8, 4 * 2], dtype=tf.float32),
                '5': tf.zeros(shape=[1, 4, 4, 4 * 2], dtype=tf.float32),
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 2 other locations - About 2 hrs to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 341..343
        official/vision/modeling/layers/detection_generator_test.py on lines 345..347

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

        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

            raw_scores = {
                '4': tf.zeros(shape=[1, 8, 8, 3 * 2], dtype=tf.float32),
                '5': tf.zeros(shape=[1, 4, 4, 3 * 2], dtype=tf.float32),
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 2 other locations - About 2 hrs to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 345..347
        official/vision/modeling/layers/detection_generator_test.py on lines 349..351

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

        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

            raw_boxes = {
                '4': tf.zeros(shape=[1, 8, 8, 4 * 2], dtype=tf.float32),
                '5': tf.zeros(shape=[1, 4, 4, 4 * 2], dtype=tf.float32),
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 2 other locations - About 2 hrs to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 341..343
        official/vision/modeling/layers/detection_generator_test.py on lines 349..351

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

        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

            with self.assertRaisesRegex(
                ValueError,
                'The last dimension of predicted boxes should be divisible by 4.',
            ):
              generator(
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 1 other location - About 1 hr to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 423..431

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

        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

            with self.assertRaisesRegex(
                ValueError,
                'The last dimension of predicted scores should be divisible by',
            ):
              generator(
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 1 other location - About 1 hr to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 402..410

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

        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

            image_info = tf.constant([[[1000, 1000], [100, 100], [0.1, 0.1], [0, 0]]],
                                     dtype=tf.float32)
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 4 other locations - About 50 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 87..89
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1539..1543
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1637..1641
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1879..1883

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

        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

            image_info = tf.constant(
                [[[1000, 1000], [100, 100], [0.1, 0.1], [0, 0]]],
                dtype=tf.float32)
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 4 other locations - About 50 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 237..238
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1539..1543
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1637..1641
        research/object_detection/meta_architectures/faster_rcnn_meta_arch_test_lib.py on lines 1879..1883

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

        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

            raw_scores = {'4': tf.zeros(shape=[1, 4, 4, 7 * 3], dtype=tf.float32)}
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 4 other locations - About 35 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 399..399
        official/vision/modeling/layers/detection_generator_test.py on lines 401..401
        official/vision/modeling/layers/detection_generator_test.py on lines 421..421
        official/vision/modeling/layers/detection_generator_test.py on lines 422..422

        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

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

            raw_boxes = {'4': tf.zeros(shape=[1, 4, 4, 4 * 5], dtype=tf.float32)}
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 4 other locations - About 35 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 399..399
        official/vision/modeling/layers/detection_generator_test.py on lines 401..401
        official/vision/modeling/layers/detection_generator_test.py on lines 420..420
        official/vision/modeling/layers/detection_generator_test.py on lines 422..422

        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

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

            anchor_boxes = {'4': tf.zeros(shape=[1, 4, 4, 4 * 2], dtype=tf.float32)}
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 4 other locations - About 35 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 399..399
        official/vision/modeling/layers/detection_generator_test.py on lines 420..420
        official/vision/modeling/layers/detection_generator_test.py on lines 421..421
        official/vision/modeling/layers/detection_generator_test.py on lines 422..422

        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

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

            anchor_boxes = {'4': tf.zeros(shape=[1, 4, 4, 4 * 5], dtype=tf.float32)}
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 4 other locations - About 35 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 399..399
        official/vision/modeling/layers/detection_generator_test.py on lines 401..401
        official/vision/modeling/layers/detection_generator_test.py on lines 420..420
        official/vision/modeling/layers/detection_generator_test.py on lines 421..421

        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

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

            raw_scores = {'4': tf.zeros(shape=[1, 4, 4, 3 * 2], dtype=tf.float32)}
        Severity: Major
        Found in official/vision/modeling/layers/detection_generator_test.py and 4 other locations - About 35 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 401..401
        official/vision/modeling/layers/detection_generator_test.py on lines 420..420
        official/vision/modeling/layers/detection_generator_test.py on lines 421..421
        official/vision/modeling/layers/detection_generator_test.py on lines 422..422

        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

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

                    tf.reshape(
                        tf.convert_to_tensor(cls_outputs_all[80:84], dtype=tf.float32),
                        [1, 2, 2, num_classes]),
        Severity: Minor
        Found in official/vision/modeling/layers/detection_generator_test.py and 2 other locations - About 35 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 194..196
        official/vision/modeling/layers/detection_generator_test.py on lines 198..200

        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

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

                    tf.reshape(
                        tf.convert_to_tensor(cls_outputs_all[64:80], dtype=tf.float32),
                        [1, 4, 4, num_classes]),
        Severity: Minor
        Found in official/vision/modeling/layers/detection_generator_test.py and 2 other locations - About 35 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 194..196
        official/vision/modeling/layers/detection_generator_test.py on lines 202..204

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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

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

                    tf.reshape(
                        tf.convert_to_tensor(cls_outputs_all[0:64], dtype=tf.float32),
                        [1, 8, 8, num_classes]),
        Severity: Minor
        Found in official/vision/modeling/layers/detection_generator_test.py and 2 other locations - About 35 mins to fix
        official/vision/modeling/layers/detection_generator_test.py on lines 198..200
        official/vision/modeling/layers/detection_generator_test.py on lines 202..204

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 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