tensorflow/models

View on GitHub
research/object_detection/core/preprocessor_test.py

Summary

Maintainability
F
4 mos
Test Coverage

File preprocessor_test.py has 3923 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/core/preprocessor_test.py - About 1 wk to fix

    PreprocessorTest has 198 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class PreprocessorTest(test_case.TestCase, parameterized.TestCase):
    
      def createColorfulTestImage(self):
        ch255 = tf.fill([1, 100, 200, 1], tf.constant(255, dtype=tf.uint8))
        ch128 = tf.fill([1, 100, 200, 1], tf.constant(128, dtype=tf.uint8))
    Severity: Major
    Found in research/object_detection/core/preprocessor_test.py - About 3 days to fix

      Function test_random_scale_crop_and_pad_to_square has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

        def test_random_scale_crop_and_pad_to_square(self, scale):
      
          def graph_fn():
            image = np.random.randn(512, 256, 1)
            box_centers = [0.25, 0.5, 0.75]
      Severity: Minor
      Found in research/object_detection/core/preprocessor_test.py - About 2 hrs 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 _testPreprocessorCache has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

        def _testPreprocessorCache(self,
                                   preprocess_options,
                                   test_boxes=False,
                                   test_masks=False,
                                   test_keypoints=False):
      Severity: Minor
      Found in research/object_detection/core/preprocessor_test.py - About 1 hr 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 _testSSDRandomCropFixedAspectRatio has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        def _testSSDRandomCropFixedAspectRatio(self,
                                               include_multiclass_scores,
                                               include_instance_masks,
                                               include_keypoints):
          def graph_fn():
      Severity: Minor
      Found in research/object_detection/core/preprocessor_test.py - About 25 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

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

        def testRandomSelfConcatImageVertically(self):
      
          def graph_fn():
            images = self.createTestImages()
            boxes = self.createTestBoxes()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 3 days to fix
      research/object_detection/core/preprocessor_test.py on lines 3897..3945

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

      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 testRandomSelfConcatImageHorizontally(self):
          def graph_fn():
            images = self.createTestImages()
            boxes = self.createTestBoxes()
            labels = self.createTestLabels()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 3 days to fix
      research/object_detection/core/preprocessor_test.py on lines 3846..3895

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

      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 testRandomVerticalFlip(self):
      
          def graph_fn():
            preprocess_options = [(preprocessor.random_vertical_flip, {})]
            images = self.expectedImagesAfterNormalization()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 677..706
      research/object_detection/core/preprocessor_test.py on lines 899..933

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

      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 testRandomRotation90(self):
      
          def graph_fn():
            preprocess_options = [(preprocessor.random_rotation90, {})]
            images = self.expectedImagesAfterNormalization()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 677..706
      research/object_detection/core/preprocessor_test.py on lines 796..830

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

      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 testRandomHorizontalFlip(self):
          def graph_fn():
            preprocess_options = [(preprocessor.random_horizontal_flip, {})]
            images = self.expectedImagesAfterNormalization()
            boxes = self.createTestBoxes()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 796..830
      research/object_detection/core/preprocessor_test.py on lines 899..933

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

      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 testRandomCropImageWithBoxOutOfImage(self):
      
          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.normalize_image, {
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 1464..1501

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

      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 testRandomCropImage(self):
      
          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.normalize_image, {
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 1556..1593

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

      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 testResizeImageWithNoInstanceMask(self):
          """Tests image resizing, checking output sizes."""
          in_image_shape_list = [[60, 40, 3], [15, 30, 3]]
          in_masks_shape_list = [[0, 60, 40], [0, 15, 30]]
          height = 50
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 3348..3375

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

      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 testResizeImageWithMasks(self):
          """Tests image resizing, checking output sizes."""
          in_image_shape_list = [[60, 40, 3], [15, 30, 3]]
          in_masks_shape_list = [[15, 60, 40], [10, 15, 30]]
          height = 50
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 3406..3433

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

      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 testResizeToMaxDimensionWithInstanceMasksTensorOfSizeZero(self):
          """Tests both cases where image should and shouldn't be resized."""
          in_image_shape_list = [[100, 50, 3], [15, 30, 3]]
          in_masks_shape_list = [[0, 100, 50], [0, 15, 30]]
          max_dim = 50
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 3625..3651
      research/object_detection/core/preprocessor_test.py on lines 3715..3741

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

      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 testResizeToMaxDimensionTensorShapes(self):
          """Tests both cases where image should and shouldn't be resized."""
          in_image_shape_list = [[100, 50, 3], [15, 30, 3]]
          in_masks_shape_list = [[15, 100, 50], [10, 15, 30]]
          max_dim = 50
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 3653..3681
      research/object_detection/core/preprocessor_test.py on lines 3715..3741

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

      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 testResizeToMinDimensionWithInstanceMasksTensorOfSizeZero(self):
          """Tests image resizing, checking output sizes."""
          in_image_shape_list = [[60, 40, 3], [15, 30, 3]]
          in_masks_shape_list = [[0, 60, 40], [0, 15, 30]]
          min_dim = 50
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 3625..3651
      research/object_detection/core/preprocessor_test.py on lines 3653..3681

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

      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 testResizeToRangeWithInstanceMasksTensorOfSizeZero(self):
          """Tests image resizing, checking output sizes."""
          in_image_shape_list = [[60, 40, 3], [15, 30, 3]]
          in_masks_shape_list = [[0, 60, 40], [0, 15, 30]]
          min_dim = 50
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 3549..3574

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

      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 testResizeToRangeWithMasksAndDynamicSpatialShape(self):
          """Tests image resizing, checking output sizes."""
          in_image_shape_list = [[60, 40, 3], [15, 30, 3]]
          in_masks_shape_list = [[15, 60, 40], [10, 15, 30]]
          min_dim = 50
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 days to fix
      research/object_detection/core/preprocessor_test.py on lines 3576..3601

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

      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 testRandomRotation90WithEmptyBoxes(self):
      
          def graph_fn():
            preprocess_options = [(preprocessor.random_rotation90, {})]
            images = self.expectedImagesAfterNormalization()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 708..730
      research/object_detection/core/preprocessor_test.py on lines 832..858

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

      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 testRandomVerticalFlipWithEmptyBoxes(self):
      
          def graph_fn():
            preprocess_options = [(preprocessor.random_vertical_flip, {})]
            images = self.expectedImagesAfterNormalization()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 708..730
      research/object_detection/core/preprocessor_test.py on lines 935..961

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

      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 testRandomHorizontalFlipWithEmptyBoxes(self):
          def graph_fn():
            preprocess_options = [(preprocessor.random_horizontal_flip, {})]
            images = self.expectedImagesAfterNormalization()
            boxes = self.createEmptyTestBoxes()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 832..858
      research/object_detection/core/preprocessor_test.py on lines 935..961

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

      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 expectedImagesAfterLeftRightFlip(self):
          images_r = tf.constant([[[0, 0, 0, 0], [0, 0, -1, -1],
                                   [0, 0, 0, -1], [0, 0, 0.5, 0.5]]],
                                 dtype=tf.float32)
          images_r = tf.expand_dims(images_r, 3)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 6 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 57..71
      research/object_detection/core/preprocessor_test.py on lines 189..203
      research/object_detection/core/preprocessor_test.py on lines 205..219
      research/object_detection/core/preprocessor_test.py on lines 221..235
      research/object_detection/core/preprocessor_test.py on lines 253..267
      research/object_detection/core/preprocessor_test.py on lines 269..283

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

      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 createTestImages(self):
          images_r = tf.constant([[[128, 128, 128, 128], [0, 0, 128, 128],
                                   [0, 128, 128, 128], [192, 192, 128, 128]]],
                                 dtype=tf.uint8)
          images_r = tf.expand_dims(images_r, 3)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 6 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 189..203
      research/object_detection/core/preprocessor_test.py on lines 205..219
      research/object_detection/core/preprocessor_test.py on lines 221..235
      research/object_detection/core/preprocessor_test.py on lines 237..251
      research/object_detection/core/preprocessor_test.py on lines 253..267
      research/object_detection/core/preprocessor_test.py on lines 269..283

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

      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 expectedImagesAfterNormalization(self):
          images_r = tf.constant([[[0, 0, 0, 0], [-1, -1, 0, 0],
                                   [-1, 0, 0, 0], [0.5, 0.5, 0, 0]]],
                                 dtype=tf.float32)
          images_r = tf.expand_dims(images_r, 3)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 6 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 57..71
      research/object_detection/core/preprocessor_test.py on lines 205..219
      research/object_detection/core/preprocessor_test.py on lines 221..235
      research/object_detection/core/preprocessor_test.py on lines 237..251
      research/object_detection/core/preprocessor_test.py on lines 253..267
      research/object_detection/core/preprocessor_test.py on lines 269..283

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

      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 expectedMaxImageAfterColorScale(self):
          images_r = tf.constant([[[0.1, 0.1, 0.1, 0.1], [-0.9, -0.9, 0.1, 0.1],
                                   [-0.9, 0.1, 0.1, 0.1], [0.6, 0.6, 0.1, 0.1]]],
                                 dtype=tf.float32)
          images_r = tf.expand_dims(images_r, 3)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 6 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 57..71
      research/object_detection/core/preprocessor_test.py on lines 189..203
      research/object_detection/core/preprocessor_test.py on lines 221..235
      research/object_detection/core/preprocessor_test.py on lines 237..251
      research/object_detection/core/preprocessor_test.py on lines 253..267
      research/object_detection/core/preprocessor_test.py on lines 269..283

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

      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 expectedImagesAfterUpDownFlip(self):
          images_r = tf.constant([[[0.5, 0.5, 0, 0], [-1, 0, 0, 0],
                                   [-1, -1, 0, 0], [0, 0, 0, 0]]],
                                 dtype=tf.float32)
          images_r = tf.expand_dims(images_r, 3)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 6 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 57..71
      research/object_detection/core/preprocessor_test.py on lines 189..203
      research/object_detection/core/preprocessor_test.py on lines 205..219
      research/object_detection/core/preprocessor_test.py on lines 221..235
      research/object_detection/core/preprocessor_test.py on lines 237..251
      research/object_detection/core/preprocessor_test.py on lines 269..283

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

      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 expectedMinImageAfterColorScale(self):
          images_r = tf.constant([[[-0.1, -0.1, -0.1, -0.1], [-1, -1, -0.1, -0.1],
                                   [-1, -0.1, -0.1, -0.1], [0.4, 0.4, -0.1, -0.1]]],
                                 dtype=tf.float32)
          images_r = tf.expand_dims(images_r, 3)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 6 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 57..71
      research/object_detection/core/preprocessor_test.py on lines 189..203
      research/object_detection/core/preprocessor_test.py on lines 205..219
      research/object_detection/core/preprocessor_test.py on lines 237..251
      research/object_detection/core/preprocessor_test.py on lines 253..267
      research/object_detection/core/preprocessor_test.py on lines 269..283

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

      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 expectedImagesAfterRot90(self):
          images_r = tf.constant([[[0, 0, 0, 0], [0, 0, 0, 0],
                                   [0, -1, 0, 0.5], [0, -1, -1, 0.5]]],
                                 dtype=tf.float32)
          images_r = tf.expand_dims(images_r, 3)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 6 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 57..71
      research/object_detection/core/preprocessor_test.py on lines 189..203
      research/object_detection/core/preprocessor_test.py on lines 205..219
      research/object_detection/core/preprocessor_test.py on lines 221..235
      research/object_detection/core/preprocessor_test.py on lines 237..251
      research/object_detection/core/preprocessor_test.py on lines 253..267

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

      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

            with mock.patch.object(
                tf.image,
                'sample_distorted_bounding_box'
            ) as mock_sample_distorted_bounding_box:
              mock_sample_distorted_bounding_box.return_value = (
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 2118..2138
      research/object_detection/core/preprocessor_test.py on lines 2185..2205

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

      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

            with mock.patch.object(
                tf.image,
                'sample_distorted_bounding_box'
            ) as mock_sample_distorted_bounding_box:
              mock_sample_distorted_bounding_box.return_value = (
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 2055..2075
      research/object_detection/core/preprocessor_test.py on lines 2185..2205

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

      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

            with mock.patch.object(
                tf.image,
                'sample_distorted_bounding_box'
            ) as mock_sample_distorted_bounding_box:
              mock_sample_distorted_bounding_box.return_value = (
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 2055..2075
      research/object_detection/core/preprocessor_test.py on lines 2118..2138

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

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

        def testRandomAdjustBrightness(self):
      
          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.normalize_image, {
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 1156..1177
      research/object_detection/core/preprocessor_test.py on lines 1193..1213
      research/object_detection/core/preprocessor_test.py on lines 4352..4372

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

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

        def testRandomAdjustHue(self):
      
          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.normalize_image, {
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 1119..1140
      research/object_detection/core/preprocessor_test.py on lines 1156..1177
      research/object_detection/core/preprocessor_test.py on lines 4352..4372

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

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

        def testRandomAdjustContrast(self):
      
          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.normalize_image, {
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 1119..1140
      research/object_detection/core/preprocessor_test.py on lines 1193..1213
      research/object_detection/core/preprocessor_test.py on lines 4352..4372

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

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

        def testAdjustGamma(self):
      
          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.normalize_image, {
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 1119..1140
      research/object_detection/core/preprocessor_test.py on lines 1156..1177
      research/object_detection/core/preprocessor_test.py on lines 1193..1213

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

      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 testRandomPatchGaussianWithRandomCoefOne(self):
          def graph_fn():
            preprocessing_options = [(preprocessor.random_patch_gaussian, {
                'random_coef': 1.0
            })]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 3084..3101

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

      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 testRandomJpegQualityWithRandomCoefOne(self):
          def graph_fn():
            preprocessing_options = [(preprocessor.random_jpeg_quality, {
                'random_coef': 1.0
            })]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 day to fix
      research/object_detection/core/preprocessor_test.py on lines 3262..3278

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

      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 mock.patch.object(preprocessor,
                                   '_random_integer') as mock_random_integer:
              mock_random_integer.return_value = tf.constant(0, dtype=tf.int32)
              distorted_tensor_dict = preprocessor.preprocess(
                  tensor_dict,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 7 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2440..2455

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

      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 mock.patch.object(preprocessor,
                                   '_random_integer') as mock_random_integer:
              mock_random_integer.return_value = tf.constant(0, dtype=tf.int32)
              distorted_tensor_dict = preprocessor.preprocess(
                  tensor_dict,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 7 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2344..2359

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

      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 testDropLabelProbabilisticallyWithMasks(self):
          def graph_fn():
            boxes = self.createTestBoxes()
            labels = self.createTestLabels()
            weights = self.createTestGroundtruthWeights()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 6 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 518..537

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

      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 testDropLabelProbabilisticallyWithMultiClassScores(self):
          def graph_fn():
            boxes = self.createTestBoxes()
            labels = self.createTestLabels()
            weights = self.createTestGroundtruthWeights()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 6 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 539..554

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

      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

            any_keypoint_pair_has_correct_dist |= (
                (round(ymin, 7) != 0.0) and (round(xmin, 7) != 0.0) and
                (round(ymax, 7) != 1.0) and (round(xmax, 7) != 1.0) and
                (round((ymax - ymin) - expected_size_y, 7) == 0.0) and
                (round((xmax - xmin) - expected_size_x, 7) == 0.0))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 6 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 4299..4303

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

      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

            any_box_has_correct_size |= (
                (round(ymin, 7) != 0.0) and (round(xmin, 7) != 0.0) and
                (round(ymax, 7) != 1.0) and (round(xmax, 7) != 1.0) and
                (round((ymax - ymin) - expected_size_y, 7) == 0.0) and
                (round((xmax - xmin) - expected_size_x, 7) == 0.0))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 6 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 4313..4317

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

      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

          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.random_jitter_boxes,
                                          {'jitter_mode': 'expand'}))
            boxes = self.createRandomTextBoxes()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1326..1334
      research/object_detection/core/preprocessor_test.py on lines 1352..1360
      research/object_detection/core/preprocessor_test.py on lines 1385..1393
      research/object_detection/core/preprocessor_test.py on lines 1408..1416
      research/object_detection/core/preprocessor_test.py on lines 1434..1442

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

      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

          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.random_jitter_boxes,
                                          {'jitter_mode': 'expand_symmetric'}))
            boxes = self.createRandomTextBoxes()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1303..1311
      research/object_detection/core/preprocessor_test.py on lines 1352..1360
      research/object_detection/core/preprocessor_test.py on lines 1385..1393
      research/object_detection/core/preprocessor_test.py on lines 1408..1416
      research/object_detection/core/preprocessor_test.py on lines 1434..1442

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

      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

          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.random_jitter_boxes,
                                          {'jitter_mode': 'expand_symmetric_xy'}))
            boxes = self.createRandomTextBoxes()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1303..1311
      research/object_detection/core/preprocessor_test.py on lines 1326..1334
      research/object_detection/core/preprocessor_test.py on lines 1385..1393
      research/object_detection/core/preprocessor_test.py on lines 1408..1416
      research/object_detection/core/preprocessor_test.py on lines 1434..1442

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

      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

          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.random_jitter_boxes,
                                          {'jitter_mode': 'shrink_symmetric'}))
            boxes = self.createTestBoxes()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1303..1311
      research/object_detection/core/preprocessor_test.py on lines 1326..1334
      research/object_detection/core/preprocessor_test.py on lines 1352..1360
      research/object_detection/core/preprocessor_test.py on lines 1385..1393
      research/object_detection/core/preprocessor_test.py on lines 1434..1442

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

      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

          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.random_jitter_boxes,
                                          {'jitter_mode': 'shrink_symmetric_xy'}))
            boxes = self.createTestBoxes()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1303..1311
      research/object_detection/core/preprocessor_test.py on lines 1326..1334
      research/object_detection/core/preprocessor_test.py on lines 1352..1360
      research/object_detection/core/preprocessor_test.py on lines 1385..1393
      research/object_detection/core/preprocessor_test.py on lines 1408..1416

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

      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

          def graph_fn():
            preprocessing_options = []
            preprocessing_options.append((preprocessor.random_jitter_boxes,
                                          {'jitter_mode': 'shrink'}))
            boxes = self.createTestBoxes()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1303..1311
      research/object_detection/core/preprocessor_test.py on lines 1326..1334
      research/object_detection/core/preprocessor_test.py on lines 1352..1360
      research/object_detection/core/preprocessor_test.py on lines 1408..1416
      research/object_detection/core/preprocessor_test.py on lines 1434..1442

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

      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

          self.assertTrue(np.all((keypoints_[1, :, 1] - keypoints_[0, :, 1]) >= (
              padded_keypoints_[1, :, 1] - padded_keypoints_[0, :, 1])))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2791..2792

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

      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

          self.assertTrue(np.all((keypoints_[1, :, 0] - keypoints_[0, :, 0]) >= (
              padded_keypoints_[1, :, 0] - padded_keypoints_[0, :, 0])))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2793..2794

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

      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

        def testFlipMasksUpDown(self):
          def graph_fn():
            test_mask = self.createTestMasks()
            flipped_mask = preprocessor._flip_masks_up_down(test_mask)
            expected_mask = self.expectedMasksAfterUpDownFlip()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 585..592
      research/object_detection/core/preprocessor_test.py on lines 594..601
      research/object_detection/core/preprocessor_test.py on lines 603..610
      research/object_detection/core/preprocessor_test.py on lines 612..619
      research/object_detection/core/preprocessor_test.py on lines 630..637

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

      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

        def testRot90Boxes(self):
          def graph_fn():
            boxes = self.createTestBoxes()
            rotated_boxes = preprocessor._rot90_boxes(boxes)
            expected_boxes = self.expectedBoxesAfterRot90()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 585..592
      research/object_detection/core/preprocessor_test.py on lines 594..601
      research/object_detection/core/preprocessor_test.py on lines 612..619
      research/object_detection/core/preprocessor_test.py on lines 621..628
      research/object_detection/core/preprocessor_test.py on lines 630..637

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

      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

        def testRot90Masks(self):
          def graph_fn():
            test_mask = self.createTestMasks()
            rotated_mask = preprocessor._rot90_masks(test_mask)
            expected_mask = self.expectedMasksAfterRot90()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 585..592
      research/object_detection/core/preprocessor_test.py on lines 594..601
      research/object_detection/core/preprocessor_test.py on lines 603..610
      research/object_detection/core/preprocessor_test.py on lines 612..619
      research/object_detection/core/preprocessor_test.py on lines 621..628

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

      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

        def testFlipMasksLeftRight(self):
          def graph_fn():
            test_mask = self.createTestMasks()
            flipped_mask = preprocessor._flip_masks_left_right(test_mask)
            expected_mask = self.expectedMasksAfterLeftRightFlip()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 585..592
      research/object_detection/core/preprocessor_test.py on lines 594..601
      research/object_detection/core/preprocessor_test.py on lines 603..610
      research/object_detection/core/preprocessor_test.py on lines 621..628
      research/object_detection/core/preprocessor_test.py on lines 630..637

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

      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

        def testFlipBoxesLeftRight(self):
          def graph_fn():
            boxes = self.createTestBoxes()
            flipped_boxes = preprocessor._flip_boxes_left_right(boxes)
            expected_boxes = self.expectedBoxesAfterLeftRightFlip()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 594..601
      research/object_detection/core/preprocessor_test.py on lines 603..610
      research/object_detection/core/preprocessor_test.py on lines 612..619
      research/object_detection/core/preprocessor_test.py on lines 621..628
      research/object_detection/core/preprocessor_test.py on lines 630..637

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

      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

        def testFlipBoxesUpDown(self):
          def graph_fn():
            boxes = self.createTestBoxes()
            flipped_boxes = preprocessor._flip_boxes_up_down(boxes)
            expected_boxes = self.expectedBoxesAfterUpDownFlip()
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 585..592
      research/object_detection/core/preprocessor_test.py on lines 603..610
      research/object_detection/core/preprocessor_test.py on lines 612..619
      research/object_detection/core/preprocessor_test.py on lines 621..628
      research/object_detection/core/preprocessor_test.py on lines 630..637

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

      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 graph_fn():
            image = tf.ones((200, 100, 3), dtype=tf.float32)
            masks = tf.ones((10, 200, 100), dtype=tf.float32)
      
            _, out_masks, out_shape = preprocessor.resize_pad_to_multiple(
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 3778..3783

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

      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 graph_fn():
            image = tf.ones((200, 100, 3), dtype=tf.float32)
            masks = tf.ones((0, 200, 100), dtype=tf.float32)
            _, out_masks, out_shape = preprocessor.resize_pad_to_multiple(
                image, multiple=32, masks=masks)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 4 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 3763..3769

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

      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

          self.assertTrue(np.all((boxes_[:, 3] - boxes_[:, 1]) >= (
              padded_boxes_[:, 3] - padded_boxes_[:, 1])))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2653..2654
      research/object_detection/core/preprocessor_test.py on lines 2655..2656
      research/object_detection/core/preprocessor_test.py on lines 2787..2788
      research/object_detection/core/preprocessor_test.py on lines 2923..2924
      research/object_detection/core/preprocessor_test.py on lines 2925..2926

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

      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

          self.assertTrue(np.all((boxes_[:, 2] - boxes_[:, 0]) >= (
              padded_boxes_[:, 2] - padded_boxes_[:, 0])))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2653..2654
      research/object_detection/core/preprocessor_test.py on lines 2655..2656
      research/object_detection/core/preprocessor_test.py on lines 2787..2788
      research/object_detection/core/preprocessor_test.py on lines 2789..2790
      research/object_detection/core/preprocessor_test.py on lines 2925..2926

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

      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

          self.assertTrue(np.all((boxes_[:, 2] - boxes_[:, 0]) >= (
              padded_boxes_[:, 2] - padded_boxes_[:, 0])))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2653..2654
      research/object_detection/core/preprocessor_test.py on lines 2655..2656
      research/object_detection/core/preprocessor_test.py on lines 2789..2790
      research/object_detection/core/preprocessor_test.py on lines 2923..2924
      research/object_detection/core/preprocessor_test.py on lines 2925..2926

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

      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

          self.assertTrue(np.all((boxes_[:, 3] - boxes_[:, 1]) >= (
              padded_boxes_[:, 3] - padded_boxes_[:, 1])))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2653..2654
      research/object_detection/core/preprocessor_test.py on lines 2787..2788
      research/object_detection/core/preprocessor_test.py on lines 2789..2790
      research/object_detection/core/preprocessor_test.py on lines 2923..2924
      research/object_detection/core/preprocessor_test.py on lines 2925..2926

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

      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

          self.assertTrue(np.all((boxes_[:, 3] - boxes_[:, 1]) >= (
              padded_boxes_[:, 3] - padded_boxes_[:, 1])))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2653..2654
      research/object_detection/core/preprocessor_test.py on lines 2655..2656
      research/object_detection/core/preprocessor_test.py on lines 2787..2788
      research/object_detection/core/preprocessor_test.py on lines 2789..2790
      research/object_detection/core/preprocessor_test.py on lines 2923..2924

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

      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

          self.assertTrue(np.all((boxes_[:, 2] - boxes_[:, 0]) >= (
              padded_boxes_[:, 2] - padded_boxes_[:, 0])))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2655..2656
      research/object_detection/core/preprocessor_test.py on lines 2787..2788
      research/object_detection/core/preprocessor_test.py on lines 2789..2790
      research/object_detection/core/preprocessor_test.py on lines 2923..2924
      research/object_detection/core/preprocessor_test.py on lines 2925..2926

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

      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 testRandomPixelValueScaleWithCache(self):
          preprocess_options = []
          preprocess_options.append((preprocessor.normalize_image, {
              'original_minval': 0,
              'original_maxval': 255,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1142..1151
      research/object_detection/core/preprocessor_test.py on lines 1179..1188
      research/object_detection/core/preprocessor_test.py on lines 1215..1224
      research/object_detection/core/preprocessor_test.py on lines 1252..1261

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

      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 testRandomAdjustHueWithCache(self):
          preprocess_options = []
          preprocess_options.append((preprocessor.normalize_image, {
              'original_minval': 0,
              'original_maxval': 255,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1025..1034
      research/object_detection/core/preprocessor_test.py on lines 1142..1151
      research/object_detection/core/preprocessor_test.py on lines 1179..1188
      research/object_detection/core/preprocessor_test.py on lines 1252..1261

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

      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 testRandomAdjustContrastWithCache(self):
          preprocess_options = []
          preprocess_options.append((preprocessor.normalize_image, {
              'original_minval': 0,
              'original_maxval': 255,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1025..1034
      research/object_detection/core/preprocessor_test.py on lines 1142..1151
      research/object_detection/core/preprocessor_test.py on lines 1215..1224
      research/object_detection/core/preprocessor_test.py on lines 1252..1261

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

      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 testRandomAdjustBrightnessWithCache(self):
          preprocess_options = []
          preprocess_options.append((preprocessor.normalize_image, {
              'original_minval': 0,
              'original_maxval': 255,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1025..1034
      research/object_detection/core/preprocessor_test.py on lines 1179..1188
      research/object_detection/core/preprocessor_test.py on lines 1215..1224
      research/object_detection/core/preprocessor_test.py on lines 1252..1261

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

      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 testRandomDistortColorWithCache(self):
          preprocess_options = []
          preprocess_options.append((preprocessor.normalize_image, {
              'original_minval': 0,
              'original_maxval': 255,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1025..1034
      research/object_detection/core/preprocessor_test.py on lines 1142..1151
      research/object_detection/core/preprocessor_test.py on lines 1179..1188
      research/object_detection/core/preprocessor_test.py on lines 1215..1224

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

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

        def createTestMasks(self):
          mask = np.array([
              [[255.0, 0.0, 0.0],
               [255.0, 0.0, 0.0],
               [255.0, 0.0, 0.0]],
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 300..308
      research/object_detection/core/preprocessor_test.py on lines 310..318
      research/object_detection/core/preprocessor_test.py on lines 320..328

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

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

        def expectedMasksAfterLeftRightFlip(self):
          mask = np.array([
              [[0.0, 0.0, 255.0],
               [0.0, 0.0, 255.0],
               [0.0, 0.0, 255.0]],
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 100..108
      research/object_detection/core/preprocessor_test.py on lines 310..318
      research/object_detection/core/preprocessor_test.py on lines 320..328

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

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

        def expectedMasksAfterUpDownFlip(self):
          mask = np.array([
              [[255.0, 0.0, 0.0],
               [255.0, 0.0, 0.0],
               [255.0, 0.0, 0.0]],
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 100..108
      research/object_detection/core/preprocessor_test.py on lines 300..308
      research/object_detection/core/preprocessor_test.py on lines 320..328

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

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

        def expectedMasksAfterRot90(self):
          mask = np.array([
              [[0.0, 0.0, 0.0],
               [0.0, 0.0, 0.0],
               [255.0, 255.0, 255.0]],
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 3 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 100..108
      research/object_detection/core/preprocessor_test.py on lines 300..308
      research/object_detection/core/preprocessor_test.py on lines 310..318

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

      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 createTestKeypointsOutsideCrop(self):
          keypoints = np.array([
              [[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]],
              [[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]],
          ])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 134..139

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

        def createTestKeypointsInsideCrop(self):
          keypoints = np.array([
              [[0.4, 0.4], [0.5, 0.5], [0.6, 0.6]],
              [[0.4, 0.4], [0.5, 0.5], [0.6, 0.6]],
          ])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 141..146

      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

          dp_surface_coords = tf.constant(
              [
                  # Instance 0.
                  [[0.1, 0.2, 0.6, 0.7],
                   [0.0, 0.0, 0.0, 0.0],
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 2 hrs to fix
      official/vision/modeling/maskrcnn_model_test.py on lines 119..122
      official/vision/modeling/maskrcnn_model_test.py on lines 124..128
      official/vision/modeling/maskrcnn_model_test.py on lines 249..252
      official/vision/modeling/maskrcnn_model_test.py on lines 253..256

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

      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_corners.append(
                    [center_y - box_size / 2.0, center_x - box_size / 2.0,
                     center_y + box_size / 2.0, center_x + box_size / 2.0])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 hrs to fix
      official/legacy/detection/utils/box_utils.py on lines 244..246

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

        def testSSDRandomCropWithCache(self):
          preprocess_options = [
              (preprocessor.normalize_image, {
                  'original_minval': 0,
                  'original_maxval': 255,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2601..2607
      research/object_detection/core/preprocessor_test.py on lines 2867..2873
      research/object_detection/core/preprocessor_test.py on lines 4090..4099

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

        def testRandomPadImageWithCache(self):
          preprocess_options = [(preprocessor.normalize_image, {
              'original_minval': 0,
              'original_maxval': 255,
              'target_minval': 0,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2867..2873
      research/object_detection/core/preprocessor_test.py on lines 3947..3956
      research/object_detection/core/preprocessor_test.py on lines 4090..4099

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

        def testRandomCropPadImageWithCache(self):
          preprocess_options = [(preprocessor.normalize_image, {
              'original_minval': 0,
              'original_maxval': 255,
              'target_minval': 0,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2601..2607
      research/object_detection/core/preprocessor_test.py on lines 3947..3956
      research/object_detection/core/preprocessor_test.py on lines 4090..4099

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

        def testSSDRandomCropFixedAspectRatioWithCache(self):
          preprocess_options = [
              (preprocessor.normalize_image, {
                  'original_minval': 0,
                  'original_maxval': 255,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 2601..2607
      research/object_detection/core/preprocessor_test.py on lines 2867..2873
      research/object_detection/core/preprocessor_test.py on lines 3947..3956

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

          def graph_fn(in_shape):
            in_image = tf.random_uniform(in_shape)
            out_image, _ = preprocessor.resize_to_range(
                in_image, min_dimension=min_dim, max_dimension=max_dim)
            out_image_shape = tf.shape(out_image)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 3454..3459

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

      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 graph_fn(in_image_shape):
            in_image = tf.random_uniform(in_image_shape)
            out_image, _ = preprocessor.resize_to_range(
                in_image, min_dimension=min_dim, max_dimension=max_dim)
            out_image_shape = tf.shape(out_image)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 3614..3619

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

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

          distorted_ymin, distorted_xmin, distorted_ymax, distorted_xmax = (
              distorted_boxes[:, 0], distorted_boxes[:, 1], distorted_boxes[:, 2],
              distorted_boxes[:, 3])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          distorted_ymin, distorted_xmin, distorted_ymax, distorted_xmax = (
              distorted_boxes[:, 0], distorted_boxes[:, 1], distorted_boxes[:, 2],
              distorted_boxes[:, 3])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          distorted_ymin, distorted_xmin, distorted_ymax, distorted_xmax = (
              distorted_boxes[:, 0], distorted_boxes[:, 1], distorted_boxes[:, 2],
              distorted_boxes[:, 3])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          ymin, xmin, ymax, xmax = boxes[:, 0], boxes[:, 1], boxes[:, 2], boxes[:, 3]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          distorted_ymin, distorted_xmin, distorted_ymax, distorted_xmax = (
              distorted_boxes[:, 0], distorted_boxes[:, 1], distorted_boxes[:, 2],
              distorted_boxes[:, 3])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          ymin, xmin, ymax, xmax = boxes[:, 0], boxes[:, 1], boxes[:, 2], boxes[:, 3]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          ymin, xmin, ymax, xmax = boxes[:, 0], boxes[:, 1], boxes[:, 2], boxes[:, 3]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          ymin, xmin, ymax, xmax = boxes[:, 0], boxes[:, 1], boxes[:, 2], boxes[:, 3]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          distorted_ymin, distorted_xmin, distorted_ymax, distorted_xmax = (
              distorted_boxes[:, 0], distorted_boxes[:, 1], distorted_boxes[:, 2],
              distorted_boxes[:, 3])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          ymin, xmin, ymax, xmax = boxes[:, 0], boxes[:, 1], boxes[:, 2], boxes[:, 3]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          ymin, xmin, ymax, xmax = boxes[:, 0], boxes[:, 1], boxes[:, 2], boxes[:, 3]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/core/preprocessor_test.py on lines 1446..1448
      research/object_detection/utils/ops.py on lines 814..814

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

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

          distorted_ymin, distorted_xmin, distorted_ymax, distorted_xmax = (
              distorted_boxes[:, 0], distorted_boxes[:, 1], distorted_boxes[:, 2],
              distorted_boxes[:, 3])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 12 other locations - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 1314..1314
      research/object_detection/core/preprocessor_test.py on lines 1315..1317
      research/object_detection/core/preprocessor_test.py on lines 1337..1337
      research/object_detection/core/preprocessor_test.py on lines 1338..1340
      research/object_detection/core/preprocessor_test.py on lines 1363..1363
      research/object_detection/core/preprocessor_test.py on lines 1364..1366
      research/object_detection/core/preprocessor_test.py on lines 1396..1396
      research/object_detection/core/preprocessor_test.py on lines 1397..1399
      research/object_detection/core/preprocessor_test.py on lines 1419..1419
      research/object_detection/core/preprocessor_test.py on lines 1420..1422
      research/object_detection/core/preprocessor_test.py on lines 1445..1445
      research/object_detection/utils/ops.py on lines 814..814

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

      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 expectedMasksAfterDropping(self):
          masks = np.array([[[255.0, 255.0, 0.0], [255.0, 255.0, 0.0],
                             [255.0, 255.0, 0.0]]])
          return tf.constant(masks, dtype=tf.float32)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 342..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 50.

      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 testRandomHorizontalFlipWithCache(self):
          keypoint_flip_permutation = self.createKeypointFlipPermutation()
          preprocess_options = [
              (preprocessor.random_horizontal_flip,
               {'keypoint_flip_permutation': keypoint_flip_permutation})]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 860..865

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

      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 testRandomVerticalFlipWithCache(self):
          keypoint_flip_permutation = self.createKeypointFlipPermutation()
          preprocess_options = [
              (preprocessor.random_vertical_flip,
               {'keypoint_flip_permutation': keypoint_flip_permutation})]
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 732..737

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

      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 expectedMasksAfterThresholding(self):
          mask = np.array([
              [[255.0, 0.0, 0.0],
               [255.0, 0.0, 0.0],
               [255.0, 0.0, 0.0]]])
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 2 hrs to fix
      research/object_detection/core/preprocessor_test.py on lines 376..379

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

      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

            tensor_dict = {
                fields.InputDataFields.image:
                    images,
                fields.InputDataFields.groundtruth_boxes:
                    boxes,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 2169..2177

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

            tensor_dict = {
                fields.InputDataFields.image: image,
                fields.InputDataFields.groundtruth_boxes: boxes,
                fields.InputDataFields.groundtruth_classes: labels,
                fields.InputDataFields.groundtruth_weights: weights,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 755..769

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

            keypoints = tf.constant([
                [[0.1, 0.1], [0.8, 0.3]],
                [[0.2, 0.4], [0.75, 0.75]],
                [[0.3, 0.1], [0.4, 0.7]],
            ], dtype=tf.float32)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 1 hr to fix
      research/object_detection/metrics/coco_tools_test.py on lines 217..220
      research/object_detection/metrics/coco_tools_test.py on lines 240..243
      research/object_detection/metrics/lvis_tools_test.py on lines 102..105
      research/object_detection/metrics/lvis_tools_test.py on lines 125..128
      research/object_detection/utils/shape_utils_test.py on lines 389..394

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

      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

          for in_shape, expected_shape in zip(in_shape_list, expected_shape_list):
            out_image_shape = self.execute_cpu(graph_fn, [np.array(in_shape,
                                                                   np.int32)])
            self.assertAllEqual(out_image_shape, expected_shape)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 3620..3623

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

      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

          for in_shape, expected_shape in zip(in_shape_list, expected_shape_list):
            out_image_shape = self.execute_cpu(graph_fn, [np.array(in_shape,
                                                                   np.int32)])
            self.assertAllEqual(out_image_shape, expected_shape)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 3460..3463

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

      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 expectedKeypointsAfterThresholding(self):
          keypoints = np.array([
              [[0.1, 0.1], [0.2, 0.2], [0.3, 0.3]]
          ])
          return tf.constant(keypoints, dtype=tf.float32)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 381..383

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

      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 expectedKeypointsAfterDropping(self):
          keypoints = np.array([[[0.4, 0.4], [0.5, 0.5], [0.6, 0.6]]])
          return tf.constant(keypoints, dtype=tf.float32)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 349..353

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

      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

          expected_keypoints = np.array([
              [[0.05, 0.1], [0.1, 0.2], [0.15, 0.3]],
              [[0.2, 0.4], [0.25, 0.5], [0.3, 0.6]],
          ], dtype=np.float32)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 2 other locations - About 1 hr to fix
      research/object_detection/core/keypoint_ops_test.py on lines 96..108
      research/object_detection/core/keypoint_ops_test.py on lines 121..133

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

      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 testResizeToMaxDimensionRaisesErrorOn4DImage(self):
          image = tf.random_uniform([1, 200, 300, 3])
          with self.assertRaises(ValueError):
            preprocessor.resize_to_max_dimension(image, 500)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 3743..3746

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

      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 testResizeToMinDimensionRaisesErrorOn4DImage(self):
          image = tf.random_uniform([1, 200, 300, 3])
          with self.assertRaises(ValueError):
            preprocessor.resize_to_min_dimension(image, 500)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 3683..3686

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

      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 expectedBoxesAfterLeftRightFlip(self):
          boxes = tf.constant([[0.0, 0.0, 0.75, 0.75], [0.25, 0.0, 0.75, 0.5]],
                              dtype=tf.float32)
          return boxes
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 77..80
      research/object_detection/core/preprocessor_test.py on lines 180..183
      research/object_detection/core/preprocessor_test.py on lines 290..293
      research/object_detection/core/preprocessor_test.py on lines 295..298

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

        def createTestBoxesOutOfImage(self):
          boxes = tf.constant(
              [[-0.1, 0.25, 0.75, 1], [0.25, 0.5, 0.75, 1.1]], dtype=tf.float32)
          return boxes
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 77..80
      research/object_detection/core/preprocessor_test.py on lines 285..288
      research/object_detection/core/preprocessor_test.py on lines 290..293
      research/object_detection/core/preprocessor_test.py on lines 295..298

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

        def expectedBoxesAfterRot90(self):
          boxes = tf.constant(
              [[0.0, 0.0, 0.75, 0.75], [0.0, 0.25, 0.5, 0.75]], dtype=tf.float32)
          return boxes
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 77..80
      research/object_detection/core/preprocessor_test.py on lines 180..183
      research/object_detection/core/preprocessor_test.py on lines 285..288
      research/object_detection/core/preprocessor_test.py on lines 290..293

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

        def createTestBoxes(self):
          boxes = tf.constant(
              [[0.0, 0.25, 0.75, 1.0], [0.25, 0.5, 0.75, 1.0]], dtype=tf.float32)
          return boxes
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 180..183
      research/object_detection/core/preprocessor_test.py on lines 285..288
      research/object_detection/core/preprocessor_test.py on lines 290..293
      research/object_detection/core/preprocessor_test.py on lines 295..298

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

        def expectedBoxesAfterUpDownFlip(self):
          boxes = tf.constant([[0.25, 0.25, 1.0, 1.0], [0.25, 0.5, 0.75, 1.0]],
                              dtype=tf.float32)
          return boxes
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 4 other locations - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 77..80
      research/object_detection/core/preprocessor_test.py on lines 180..183
      research/object_detection/core/preprocessor_test.py on lines 285..288
      research/object_detection/core/preprocessor_test.py on lines 295..298

      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

          self.assertAllClose((distorted_ymax - ymax) / height,
                              (distorted_xmax - xmax) / width, rtol=1e-5)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 1459..1460

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

      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

          self.assertAllClose((ymax - distorted_ymax) / height,
                              (xmax - distorted_xmax) / width, rtol=1e-5)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 1 hr to fix
      research/object_detection/core/preprocessor_test.py on lines 1378..1379

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

      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

            tensor_dict = {
                fields.InputDataFields.image: image,
                fields.InputDataFields.groundtruth_boxes: boxes,
                fields.InputDataFields.groundtruth_classes: labels,
                fields.InputDataFields.groundtruth_keypoints: keypoints,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 8 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1734..1739
      research/object_detection/core/preprocessor_test.py on lines 1803..1808
      research/object_detection/core/preprocessor_test.py on lines 2105..2110
      research/object_detection/core/preprocessor_test.py on lines 2331..2336
      research/object_detection/core/preprocessor_test.py on lines 2379..2384
      research/object_detection/core/preprocessor_test.py on lines 2427..2432
      research/object_detection/core/preprocessor_test.py on lines 4012..4017
      research/object_detection/model_lib_tf1_test.py on lines 463..473

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

      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

            tensor_dict = {
                fields.InputDataFields.image: image,
                fields.InputDataFields.groundtruth_boxes: boxes,
                fields.InputDataFields.groundtruth_classes: labels,
                fields.InputDataFields.groundtruth_weights: weights,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 8 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1734..1739
      research/object_detection/core/preprocessor_test.py on lines 1803..1808
      research/object_detection/core/preprocessor_test.py on lines 2042..2047
      research/object_detection/core/preprocessor_test.py on lines 2331..2336
      research/object_detection/core/preprocessor_test.py on lines 2379..2384
      research/object_detection/core/preprocessor_test.py on lines 2427..2432
      research/object_detection/core/preprocessor_test.py on lines 4012..4017
      research/object_detection/model_lib_tf1_test.py on lines 463..473

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

      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

            tensor_dict = {
                fields.InputDataFields.image: image,
                fields.InputDataFields.groundtruth_boxes: boxes,
                fields.InputDataFields.groundtruth_classes: labels,
                fields.InputDataFields.groundtruth_weights: weights,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 8 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1734..1739
      research/object_detection/core/preprocessor_test.py on lines 1803..1808
      research/object_detection/core/preprocessor_test.py on lines 2042..2047
      research/object_detection/core/preprocessor_test.py on lines 2105..2110
      research/object_detection/core/preprocessor_test.py on lines 2331..2336
      research/object_detection/core/preprocessor_test.py on lines 2379..2384
      research/object_detection/core/preprocessor_test.py on lines 4012..4017
      research/object_detection/model_lib_tf1_test.py on lines 463..473

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

      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

            tensor_dict = {
                fields.InputDataFields.image: images,
                fields.InputDataFields.groundtruth_boxes: boxes,
                fields.InputDataFields.groundtruth_keypoints: keypoints,
                fields.InputDataFields.groundtruth_classes: labels,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 8 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1803..1808
      research/object_detection/core/preprocessor_test.py on lines 2042..2047
      research/object_detection/core/preprocessor_test.py on lines 2105..2110
      research/object_detection/core/preprocessor_test.py on lines 2331..2336
      research/object_detection/core/preprocessor_test.py on lines 2379..2384
      research/object_detection/core/preprocessor_test.py on lines 2427..2432
      research/object_detection/core/preprocessor_test.py on lines 4012..4017
      research/object_detection/model_lib_tf1_test.py on lines 463..473

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

      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

            tensor_dict = {
                fields.InputDataFields.image: images,
                fields.InputDataFields.groundtruth_boxes: boxes,
                fields.InputDataFields.groundtruth_classes: labels,
                fields.InputDataFields.groundtruth_weights: weights,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 8 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1734..1739
      research/object_detection/core/preprocessor_test.py on lines 2042..2047
      research/object_detection/core/preprocessor_test.py on lines 2105..2110
      research/object_detection/core/preprocessor_test.py on lines 2331..2336
      research/object_detection/core/preprocessor_test.py on lines 2379..2384
      research/object_detection/core/preprocessor_test.py on lines 2427..2432
      research/object_detection/core/preprocessor_test.py on lines 4012..4017
      research/object_detection/model_lib_tf1_test.py on lines 463..473

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

      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

            tensor_dict = {
                fields.InputDataFields.image: image,
                fields.InputDataFields.groundtruth_boxes: boxes,
                fields.InputDataFields.groundtruth_classes: labels,
                fields.InputDataFields.groundtruth_weights: weights,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 8 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1734..1739
      research/object_detection/core/preprocessor_test.py on lines 1803..1808
      research/object_detection/core/preprocessor_test.py on lines 2042..2047
      research/object_detection/core/preprocessor_test.py on lines 2105..2110
      research/object_detection/core/preprocessor_test.py on lines 2379..2384
      research/object_detection/core/preprocessor_test.py on lines 2427..2432
      research/object_detection/core/preprocessor_test.py on lines 4012..4017
      research/object_detection/model_lib_tf1_test.py on lines 463..473

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

      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

            tensor_dict = {
                fields.InputDataFields.image: images,
                fields.InputDataFields.groundtruth_boxes: boxes,
                fields.InputDataFields.groundtruth_classes: labels,
                fields.InputDataFields.multiclass_scores: multiclass_scores,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 8 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1734..1739
      research/object_detection/core/preprocessor_test.py on lines 1803..1808
      research/object_detection/core/preprocessor_test.py on lines 2042..2047
      research/object_detection/core/preprocessor_test.py on lines 2105..2110
      research/object_detection/core/preprocessor_test.py on lines 2331..2336
      research/object_detection/core/preprocessor_test.py on lines 2379..2384
      research/object_detection/core/preprocessor_test.py on lines 2427..2432
      research/object_detection/model_lib_tf1_test.py on lines 463..473

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

      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

            tensor_dict = {
                fields.InputDataFields.image: image,
                fields.InputDataFields.groundtruth_boxes: boxes,
                fields.InputDataFields.groundtruth_classes: labels,
                fields.InputDataFields.groundtruth_weights: weights,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 8 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1734..1739
      research/object_detection/core/preprocessor_test.py on lines 1803..1808
      research/object_detection/core/preprocessor_test.py on lines 2042..2047
      research/object_detection/core/preprocessor_test.py on lines 2105..2110
      research/object_detection/core/preprocessor_test.py on lines 2331..2336
      research/object_detection/core/preprocessor_test.py on lines 2427..2432
      research/object_detection/core/preprocessor_test.py on lines 4012..4017
      research/object_detection/model_lib_tf1_test.py on lines 463..473

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

      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

          height, width = tf.maximum(1e-6, ymax - ymin), tf.maximum(1e-6, xmax - xmin)
      Severity: Minor
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1376..1376

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

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

        def testRandomRotation90WithCache(self):
          preprocess_options = [(preprocessor.random_rotation90, {})]
          self._testPreprocessorCache(preprocess_options,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1062..1064
      research/object_detection/core/preprocessor_test.py on lines 2316..2318
      research/object_detection/core/preprocessor_test.py on lines 2468..2470

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

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

        def testRandomImageScaleWithCache(self):
          preprocess_options = [(preprocessor.random_image_scale, {})]
          self._testPreprocessorCache(preprocess_options,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 963..965
      research/object_detection/core/preprocessor_test.py on lines 2316..2318
      research/object_detection/core/preprocessor_test.py on lines 2468..2470

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

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

        def testRandomPadToAspectRatioWithCache(self):
          preprocess_options = [(preprocessor.random_pad_to_aspect_ratio, {})]
          self._testPreprocessorCache(preprocess_options,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 963..965
      research/object_detection/core/preprocessor_test.py on lines 1062..1064
      research/object_detection/core/preprocessor_test.py on lines 2316..2318

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

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

        def testRandomCropToAspectRatioWithCache(self):
          preprocess_options = [(preprocessor.random_crop_to_aspect_ratio, {})]
          self._testPreprocessorCache(preprocess_options,
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 3 other locations - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 963..965
      research/object_detection/core/preprocessor_test.py on lines 1062..1064
      research/object_detection/core/preprocessor_test.py on lines 2468..2470

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

      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

          height, width = tf.maximum(1e-6, ymax - ymin), tf.maximum(1e-6, xmax - xmin)
      Severity: Minor
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 55 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1458..1458

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

      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

            images_r_diff1 = tf.squared_difference(
                tf.cast(images_r, dtype=tf.float32),
                tf.cast(images_gray_r, dtype=tf.float32))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 50 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1084..1086
      research/object_detection/core/preprocessor_test.py on lines 1088..1090
      research/object_detection/core/preprocessor_test.py on lines 1091..1093
      research/object_detection/core/preprocessor_test.py on lines 1095..1097
      research/object_detection/core/preprocessor_test.py on lines 1098..1100

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

            images_r_diff2 = tf.squared_difference(
                tf.cast(images_gray_r, dtype=tf.float32),
                tf.cast(images_gray_g, dtype=tf.float32))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 50 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1081..1083
      research/object_detection/core/preprocessor_test.py on lines 1088..1090
      research/object_detection/core/preprocessor_test.py on lines 1091..1093
      research/object_detection/core/preprocessor_test.py on lines 1095..1097
      research/object_detection/core/preprocessor_test.py on lines 1098..1100

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

            images_g_diff1 = tf.squared_difference(
                tf.cast(images_g, dtype=tf.float32),
                tf.cast(images_gray_g, dtype=tf.float32))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 50 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1081..1083
      research/object_detection/core/preprocessor_test.py on lines 1084..1086
      research/object_detection/core/preprocessor_test.py on lines 1091..1093
      research/object_detection/core/preprocessor_test.py on lines 1095..1097
      research/object_detection/core/preprocessor_test.py on lines 1098..1100

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

            images_b_diff1 = tf.squared_difference(
                tf.cast(images_b, dtype=tf.float32),
                tf.cast(images_gray_b, dtype=tf.float32))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 50 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1081..1083
      research/object_detection/core/preprocessor_test.py on lines 1084..1086
      research/object_detection/core/preprocessor_test.py on lines 1088..1090
      research/object_detection/core/preprocessor_test.py on lines 1091..1093
      research/object_detection/core/preprocessor_test.py on lines 1098..1100

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

            images_b_diff2 = tf.squared_difference(
                tf.cast(images_gray_b, dtype=tf.float32),
                tf.cast(images_gray_r, dtype=tf.float32))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 50 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1081..1083
      research/object_detection/core/preprocessor_test.py on lines 1084..1086
      research/object_detection/core/preprocessor_test.py on lines 1088..1090
      research/object_detection/core/preprocessor_test.py on lines 1091..1093
      research/object_detection/core/preprocessor_test.py on lines 1095..1097

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

            images_g_diff2 = tf.squared_difference(
                tf.cast(images_gray_g, dtype=tf.float32),
                tf.cast(images_gray_b, dtype=tf.float32))
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 50 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 1081..1083
      research/object_detection/core/preprocessor_test.py on lines 1084..1086
      research/object_detection/core/preprocessor_test.py on lines 1088..1090
      research/object_detection/core/preprocessor_test.py on lines 1095..1097
      research/object_detection/core/preprocessor_test.py on lines 1098..1100

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

          self.assertTrue((images_shape_[2] >= padded_images_shape_[2] * 0.5).all)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 45 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 2649..2649
      research/object_detection/core/preprocessor_test.py on lines 2650..2650
      research/object_detection/core/preprocessor_test.py on lines 2782..2782
      research/object_detection/core/preprocessor_test.py on lines 2783..2783
      research/object_detection/core/preprocessor_test.py on lines 2919..2919

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

          self.assertTrue((images_shape_[1] >= padded_images_shape_[1] * 0.5).all)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 45 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 2650..2650
      research/object_detection/core/preprocessor_test.py on lines 2782..2782
      research/object_detection/core/preprocessor_test.py on lines 2783..2783
      research/object_detection/core/preprocessor_test.py on lines 2919..2919
      research/object_detection/core/preprocessor_test.py on lines 2920..2920

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

          self.assertTrue((images_shape_[2] >= padded_images_shape_[2] * 0.5).all)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 45 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 2649..2649
      research/object_detection/core/preprocessor_test.py on lines 2782..2782
      research/object_detection/core/preprocessor_test.py on lines 2783..2783
      research/object_detection/core/preprocessor_test.py on lines 2919..2919
      research/object_detection/core/preprocessor_test.py on lines 2920..2920

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

          self.assertTrue((images_shape_[1] >= padded_images_shape_[1] * 0.5).all)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 45 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 2649..2649
      research/object_detection/core/preprocessor_test.py on lines 2650..2650
      research/object_detection/core/preprocessor_test.py on lines 2782..2782
      research/object_detection/core/preprocessor_test.py on lines 2783..2783
      research/object_detection/core/preprocessor_test.py on lines 2920..2920

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

          self.assertTrue((images_shape_[2] >= padded_images_shape_[2] * 0.5).all)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 45 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 2649..2649
      research/object_detection/core/preprocessor_test.py on lines 2650..2650
      research/object_detection/core/preprocessor_test.py on lines 2782..2782
      research/object_detection/core/preprocessor_test.py on lines 2919..2919
      research/object_detection/core/preprocessor_test.py on lines 2920..2920

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

          self.assertTrue((images_shape_[1] >= padded_images_shape_[1] * 0.5).all)
      Severity: Major
      Found in research/object_detection/core/preprocessor_test.py and 5 other locations - About 45 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 2649..2649
      research/object_detection/core/preprocessor_test.py on lines 2650..2650
      research/object_detection/core/preprocessor_test.py on lines 2783..2783
      research/object_detection/core/preprocessor_test.py on lines 2919..2919
      research/object_detection/core/preprocessor_test.py on lines 2920..2920

      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

          self.assertAlmostEqual(k2[0] - k1[0], 0.5 / scale)
      Severity: Minor
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 40 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 4233..4233

      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

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

          self.assertAlmostEqual(k2[1] - k1[1], 0.5 / scale)
      Severity: Minor
      Found in research/object_detection/core/preprocessor_test.py and 1 other location - About 40 mins to fix
      research/object_detection/core/preprocessor_test.py on lines 4232..4232

      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

      There are no issues that match your filters.

      Category
      Status