tensorflow/models

View on GitHub
official/legacy/detection/modeling/architecture/heads.py

Summary

Maintainability
F
2 wks
Test Coverage

File heads.py has 1069 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

    Function __init__ has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      def __init__(
          self,
          num_classes,
          num_convs=0,
          num_filters=256,
    Severity: Minor
    Found in official/legacy/detection/modeling/architecture/heads.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 __init__ has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

      def __init__(
          self,
          num_classes,
          num_convs=0,
          num_filters=256,
    Severity: Minor
    Found in official/legacy/detection/modeling/architecture/heads.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 __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def __init__(
    Severity: Major
    Found in official/legacy/detection/modeling/architecture/heads.py - About 1 hr to fix

      Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def __init__(
      Severity: Major
      Found in official/legacy/detection/modeling/architecture/heads.py - About 1 hr to fix

        Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def __init__(
        Severity: Major
        Found in official/legacy/detection/modeling/architecture/heads.py - About 1 hr to fix

          Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def __init__(
          Severity: Major
          Found in official/legacy/detection/modeling/architecture/heads.py - About 1 hr to fix

            Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def __init__(
            Severity: Major
            Found in official/legacy/detection/modeling/architecture/heads.py - About 1 hr to fix

              Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def __init__(
              Severity: Major
              Found in official/legacy/detection/modeling/architecture/heads.py - About 1 hr to fix

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

                  def __init__(
                      self,
                      min_level,
                      max_level,
                      anchors_per_location,
                Severity: Minor
                Found in official/legacy/detection/modeling/architecture/heads.py - About 55 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                  def __init__(
                      self,
                      num_classes,
                      mask_target_size,
                      num_convs=4,
                Severity: Minor
                Found in official/legacy/detection/modeling/architecture/heads.py - About 55 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                  def __init__(
                      self,
                      min_level,
                      max_level,
                      anchors_per_location,
                Severity: Minor
                Found in official/legacy/detection/modeling/architecture/heads.py - About 55 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def __init__(self,
                Severity: Major
                Found in official/legacy/detection/modeling/architecture/heads.py - About 50 mins to fix

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

                    def __init__(self,
                  Severity: Minor
                  Found in official/legacy/detection/modeling/architecture/heads.py - About 45 mins to fix

                    Function _build_class_net_layers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def _build_class_net_layers(self, norm_activation):
                        """Build re-usable layers for class prediction network."""
                        if self._use_separable_conv:
                          self._class_predict = tf_keras.layers.SeparableConv2D(
                              self._num_classes * self._anchors_per_location,
                    Severity: Minor
                    Found in official/legacy/detection/modeling/architecture/heads.py - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function _build_box_net_layers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def _build_box_net_layers(self, norm_activation):
                        """Build re-usable layers for box prediction network."""
                        if self._use_separable_conv:
                          self._box_predict = tf_keras.layers.SeparableConv2D(
                              4 * self._anchors_per_location,
                    Severity: Minor
                    Found in official/legacy/detection/modeling/architecture/heads.py - About 45 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def __init__(self, num_classes, num_downsample_channels, mask_crop_size,
                    Severity: Minor
                    Found in official/legacy/detection/modeling/architecture/heads.py - About 35 mins to fix

                      Function __call__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        def __call__(self, fpn_features, boxes, outer_boxes, classes, is_training):
                      Severity: Minor
                      Found in official/legacy/detection/modeling/architecture/heads.py - About 35 mins to fix

                        Function call has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def call(self, roi_features, is_training=None):
                            """Box and class branches for the Mask-RCNN model.
                        
                            Args:
                              roi_features: A ROI feature tensor of shape [batch_size, num_rois,
                        Severity: Minor
                        Found in official/legacy/detection/modeling/architecture/heads.py - About 35 mins to fix

                        Cognitive Complexity

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

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

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

                        Further reading

                        Function __call__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def __call__(self, roi_features, is_training=None):
                            """Box and class branches for the Mask-RCNN model.
                        
                            Args:
                              roi_features: A ROI feature tensor of shape [batch_size, num_rois,
                        Severity: Minor
                        Found in official/legacy/detection/modeling/architecture/heads.py - About 35 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

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

                            for i in range(self._num_convs):
                              self._conv_ops.append(
                                  self._conv2d_op(
                                      self._num_filters,
                                      kernel_size=(3, 3),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 5 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 468..480

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

                        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 i in range(self._num_convs):
                              self._conv_ops.append(
                                  self._conv2d_op(
                                      self._num_filters,
                                      kernel_size=(3, 3),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 5 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 329..341

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

                        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 class_net(self, features, level, is_training):
                            """Class prediction network for RetinaNet."""
                            with self._class_name_scope:
                              for i in range(self._num_convs):
                                features = self._class_conv[i](features)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 5 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 852..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 86.

                        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 box_net(self, features, level, is_training=None):
                            """Box regression network for RetinaNet."""
                            with self._box_name_scope:
                              for i in range(self._num_convs):
                                features = self._box_conv[i](features)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 5 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 837..850

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

                        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 i in range(self._num_fcs):
                              self._fc_ops.append(
                                  tf_keras.layers.Dense(
                                      units=self._fc_dims,
                                      activation=(None
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 4 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 345..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 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

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

                            for i in range(self._num_fcs):
                              self._fc_ops.append(
                                  tf_keras.layers.Dense(
                                      units=self._fc_dims,
                                      activation=(None
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 4 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 484..492

                        Duplicated Code

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

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

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

                        Tuning

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

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

                            if use_separable_conv:
                              self._conv2d_op = functools.partial(
                                  tf_keras.layers.SeparableConv2D,
                                  depth_multiplier=1,
                                  bias_initializer=tf.zeros_initializer())
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 2 other locations - About 4 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 443..453
                        official/legacy/detection/modeling/architecture/heads.py on lines 585..595

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                            if use_separable_conv:
                              self._conv2d_op = functools.partial(
                                  tf_keras.layers.SeparableConv2D,
                                  depth_multiplier=1,
                                  bias_initializer=tf.zeros_initializer())
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 2 other locations - About 4 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 304..314
                        official/legacy/detection/modeling/architecture/heads.py on lines 585..595

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                            if use_separable_conv:
                              self._conv2d_op = functools.partial(
                                  tf_keras.layers.SeparableConv2D,
                                  depth_multiplier=1,
                                  bias_initializer=tf.zeros_initializer())
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 2 other locations - About 4 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 304..314
                        official/legacy/detection/modeling/architecture/heads.py on lines 443..453

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

                        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

                              if self._use_category_for_mask:
                                mask_logits = tf.transpose(mask_logits, [0, 1, 4, 2, 3])
                                mask_logits = tf.gather(
                                    mask_logits, tf.expand_dims(classes, -1), batch_dims=2)
                                mask_logits = tf.squeeze(mask_logits, axis=2)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 4 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 1233..1239

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

                        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

                              if self._use_category_for_mask:
                                mask_logits = tf.transpose(mask_logits, [0, 1, 4, 2, 3])
                                mask_logits = tf.gather(
                                    mask_logits, tf.expand_dims(classes, -1), batch_dims=2)
                                mask_logits = tf.squeeze(mask_logits, axis=2)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 4 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 1093..1099

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

                        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._class_predict_conv = tf_keras.layers.Conv2D(
                                self._mask_num_classes,
                                kernel_size=(1, 1),
                                # Focal loss bias initialization to have foreground 0.01 probability.
                                bias_initializer=tf.constant_initializer(-np.log((1 - 0.01) / 0.01)),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 4 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 1055..1060

                        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

                            self._class_predict = tf_keras.layers.Conv2D(
                                self._mask_num_classes,
                                kernel_size=(1, 1),
                                # Focal loss bias initialization to have foreground 0.01 probability.
                                bias_initializer=tf.constant_initializer(-np.log((1 - 0.01) / 0.01)),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 4 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 1186..1191

                        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

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

                            if use_separable_conv:
                              self._conv2d_op = functools.partial(
                                  tf_keras.layers.SeparableConv2D,
                                  depth_multiplier=1,
                                  bias_initializer=tf.zeros_initializer())
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 3 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 184..193

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

                        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

                            if use_separable_conv:
                              self._conv2d_op = functools.partial(
                                  tf_keras.layers.SeparableConv2D,
                                  depth_multiplier=1,
                                  bias_initializer=tf.zeros_initializer())
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 3 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 75..84

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

                        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

                            if activation == 'relu':
                              self._activation_op = tf.nn.relu
                            elif activation == 'swish':
                              self._activation_op = tf.nn.swish
                            else:
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 8 other locations - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/fpn.py on lines 68..73
                        official/legacy/detection/modeling/architecture/heads.py on lines 67..72
                        official/legacy/detection/modeling/architecture/heads.py on lines 318..323
                        official/legacy/detection/modeling/architecture/heads.py on lines 457..462
                        official/legacy/detection/modeling/architecture/heads.py on lines 596..601
                        official/legacy/detection/modeling/architecture/nn_ops.py on lines 70..75
                        official/legacy/detection/modeling/architecture/resnet.py on lines 51..56
                        official/legacy/detection/modeling/architecture/spinenet.py on lines 150..155

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 57.

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

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

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

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

                        Refactorings

                        Further Reading

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

                            if activation == 'relu':
                              self._activation_op = tf.nn.relu
                            elif activation == 'swish':
                              self._activation_op = tf.nn.swish
                            else:
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 8 other locations - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/fpn.py on lines 68..73
                        official/legacy/detection/modeling/architecture/heads.py on lines 67..72
                        official/legacy/detection/modeling/architecture/heads.py on lines 176..181
                        official/legacy/detection/modeling/architecture/heads.py on lines 318..323
                        official/legacy/detection/modeling/architecture/heads.py on lines 596..601
                        official/legacy/detection/modeling/architecture/nn_ops.py on lines 70..75
                        official/legacy/detection/modeling/architecture/resnet.py on lines 51..56
                        official/legacy/detection/modeling/architecture/spinenet.py on lines 150..155

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 57.

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

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

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

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

                        Refactorings

                        Further Reading

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

                            if activation == 'relu':
                              self._activation_op = tf.nn.relu
                            elif activation == 'swish':
                              self._activation_op = tf.nn.swish
                            else:
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 8 other locations - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/fpn.py on lines 68..73
                        official/legacy/detection/modeling/architecture/heads.py on lines 67..72
                        official/legacy/detection/modeling/architecture/heads.py on lines 176..181
                        official/legacy/detection/modeling/architecture/heads.py on lines 457..462
                        official/legacy/detection/modeling/architecture/heads.py on lines 596..601
                        official/legacy/detection/modeling/architecture/nn_ops.py on lines 70..75
                        official/legacy/detection/modeling/architecture/resnet.py on lines 51..56
                        official/legacy/detection/modeling/architecture/spinenet.py on lines 150..155

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 57.

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

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

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

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

                        Refactorings

                        Further Reading

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

                            if activation == 'relu':
                              self._activation_op = tf.nn.relu
                            elif activation == 'swish':
                              self._activation_op = tf.nn.swish
                            else:
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 8 other locations - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/fpn.py on lines 68..73
                        official/legacy/detection/modeling/architecture/heads.py on lines 176..181
                        official/legacy/detection/modeling/architecture/heads.py on lines 318..323
                        official/legacy/detection/modeling/architecture/heads.py on lines 457..462
                        official/legacy/detection/modeling/architecture/heads.py on lines 596..601
                        official/legacy/detection/modeling/architecture/nn_ops.py on lines 70..75
                        official/legacy/detection/modeling/architecture/resnet.py on lines 51..56
                        official/legacy/detection/modeling/architecture/spinenet.py on lines 150..155

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 57.

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

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

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

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

                        Refactorings

                        Further Reading

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

                            if activation == 'relu':
                              self._activation_op = tf.nn.relu
                            elif activation == 'swish':
                              self._activation_op = tf.nn.swish
                            else:
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 8 other locations - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/fpn.py on lines 68..73
                        official/legacy/detection/modeling/architecture/heads.py on lines 67..72
                        official/legacy/detection/modeling/architecture/heads.py on lines 176..181
                        official/legacy/detection/modeling/architecture/heads.py on lines 318..323
                        official/legacy/detection/modeling/architecture/heads.py on lines 457..462
                        official/legacy/detection/modeling/architecture/nn_ops.py on lines 70..75
                        official/legacy/detection/modeling/architecture/resnet.py on lines 51..56
                        official/legacy/detection/modeling/architecture/spinenet.py on lines 150..155

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 57.

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

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

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

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

                        Refactorings

                        Further Reading

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

                              for i in range(self._num_convs):
                                net = self._conv_ops[i](net)
                                if self._use_batch_norm:
                                  net = self._conv_bn_ops[i](net, is_training=is_training)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 3 other locations - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 396..399
                        official/legacy/detection/modeling/architecture/heads.py on lines 531..534
                        official/legacy/detection/modeling/architecture/heads.py on lines 539..542

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 56.

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

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

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

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

                        Refactorings

                        Further Reading

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

                              for i in range(self._num_fcs):
                                net = self._fc_ops[i](net)
                                if self._use_batch_norm:
                                  net = self._fc_bn_ops[i](net, is_training=is_training)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 3 other locations - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 388..391
                        official/legacy/detection/modeling/architecture/heads.py on lines 531..534
                        official/legacy/detection/modeling/architecture/heads.py on lines 539..542

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 56.

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

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

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

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

                        Refactorings

                        Further Reading

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

                              for i in range(self._num_fcs):
                                net = self._fc_ops[i](net)
                                if self._use_batch_norm:
                                  net = self._fc_bn_ops[i](net, is_training=is_training)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 3 other locations - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 388..391
                        official/legacy/detection/modeling/architecture/heads.py on lines 396..399
                        official/legacy/detection/modeling/architecture/heads.py on lines 531..534

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 56.

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

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

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

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

                        Refactorings

                        Further Reading

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

                              for i in range(self._num_convs):
                                net = self._conv_ops[i](net)
                                if self._use_batch_norm:
                                  net = self._conv_bn_ops[i](net, is_training=is_training)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 3 other locations - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 388..391
                        official/legacy/detection/modeling/architecture/heads.py on lines 396..399
                        official/legacy/detection/modeling/architecture/heads.py on lines 539..542

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 56.

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

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

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

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

                        Refactorings

                        Further Reading

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

                            if self._use_batch_norm:
                              for level in range(self._min_level, self._max_level + 1):
                                self._norm_activations[level] = norm_activation(name='rpn-l%d-bn' %
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 107..109

                        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

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

                            if self._use_batch_norm:
                              for level in range(self._min_level, self._max_level + 1):
                                self._norm_activations[level] = norm_activation(name='rpn-l%d-bn' %
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 222..224

                        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

                              for level in range(self._min_level, self._max_level + 1):
                                name = self._box_net_batch_norm_name(i, level)
                                self._box_norm_activation[name] = norm_activation(name=name)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 775..777

                        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

                              for level in range(self._min_level, self._max_level + 1):
                                name = self._class_net_batch_norm_name(i, level)
                                self._class_norm_activation[name] = norm_activation(name=name)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 819..821

                        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

                            for i in range(self._num_convs):
                              features = self._class_conv[i](features)
                              features = self._class_norm_activation[i](
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 1259..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 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

                            for i in range(self._num_convs):
                              features = self._fine_class_conv[i](features)
                              features = self._fine_class_bn[i](features, is_training=is_training)
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 2 hrs to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 1118..1120

                        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

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

                            self._box_predict = tf_keras.layers.Dense(
                                self._num_classes * 4,
                                kernel_initializer=tf_keras.initializers.RandomNormal(stddev=0.001),
                                bias_initializer=tf.zeros_initializer(),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 1 hr to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 360..363

                        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

                            self._box_predict = tf_keras.layers.Dense(
                                self._num_classes * 4,
                                kernel_initializer=tf_keras.initializers.RandomNormal(stddev=0.001),
                                bias_initializer=tf.zeros_initializer(),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 1 hr to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 499..502

                        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

                            self._rpn_conv = self._conv2d_op(
                                num_filters,
                                kernel_size=(3, 3),
                                strides=(1, 1),
                                activation=(None if self._use_batch_norm else self._activation_op),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 1 hr to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 86..90

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

                        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

                            self._rpn_conv = self._conv2d_op(
                                num_filters,
                                kernel_size=(3, 3),
                                strides=(1, 1),
                                activation=(None if self._use_batch_norm else self._activation_op),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 1 hr to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 195..199

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

                        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

                            self._class_predict = tf_keras.layers.Dense(
                                self._num_classes,
                                kernel_initializer=tf_keras.initializers.RandomNormal(stddev=0.01),
                                bias_initializer=tf.zeros_initializer(),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 1 hr to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 494..497

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 41.

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

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

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

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

                        Refactorings

                        Further Reading

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

                            self._class_predict = tf_keras.layers.Dense(
                                self._num_classes,
                                kernel_initializer=tf_keras.initializers.RandomNormal(stddev=0.01),
                                bias_initializer=tf.zeros_initializer(),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 1 hr to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 355..358

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 41.

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

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

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

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

                        Refactorings

                        Further Reading

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

                            self._rpn_box_conv = self._conv2d_op(
                                4 * anchors_per_location,
                                kernel_size=(1, 1),
                                strides=(1, 1),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 1 hr to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 208..211

                        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._rpn_box_conv = self._conv2d_op(
                                4 * anchors_per_location,
                                kernel_size=(1, 1),
                                strides=(1, 1),
                        Severity: Major
                        Found in official/legacy/detection/modeling/architecture/heads.py and 1 other location - About 1 hr to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 99..102

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

                            self._rpn_class_conv = self._conv2d_op(
                                anchors_per_location,
                                kernel_size=(1, 1),
                                strides=(1, 1),
                        Severity: Minor
                        Found in official/legacy/detection/modeling/architecture/heads.py and 2 other locations - About 30 mins to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 93..96
                        official/legacy/detection/modeling/architecture/heads.py on lines 214..217

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

                        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

                            self._rpn_class_conv = self._conv2d_op(
                                anchors_per_location,
                                kernel_size=(1, 1),
                                strides=(1, 1),
                        Severity: Minor
                        Found in official/legacy/detection/modeling/architecture/heads.py and 2 other locations - About 30 mins to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 202..205
                        official/legacy/detection/modeling/architecture/heads.py on lines 214..217

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

                        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

                            self._rpn_center_conv = self._conv2d_op(
                                anchors_per_location,
                                kernel_size=(1, 1),
                                strides=(1, 1),
                        Severity: Minor
                        Found in official/legacy/detection/modeling/architecture/heads.py and 2 other locations - About 30 mins to fix
                        official/legacy/detection/modeling/architecture/heads.py on lines 93..96
                        official/legacy/detection/modeling/architecture/heads.py on lines 202..205

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

                        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