tensorflow/models

View on GitHub
official/projects/yolo/modeling/layers/nn_blocks.py

Summary

Maintainability
F
2 wks
Test Coverage

File nn_blocks.py has 1668 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/projects/yolo/modeling/layers/nn_blocks.py - About 4 days to fix

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

      def __init__(self,
    Severity: Major
    Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 2 hrs to fix

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

        def __init__(self,
      Severity: Major
      Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 2 hrs to fix

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

          def __init__(self,
        Severity: Major
        Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 2 hrs to fix

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

            def __init__(self,
          Severity: Major
          Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 2 hrs to fix

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

              def __init__(self,
            Severity: Major
            Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 2 hrs to fix

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

                def __init__(self,
              Severity: Major
              Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 2 hrs to fix

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

                  def __init__(self,
                Severity: Major
                Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 2 hrs to fix

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

                    def __init__(self,
                  Severity: Major
                  Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 2 hrs to fix

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

                      def __init__(self,
                    Severity: Major
                    Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 2 hrs to fix

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

                        def __init__(self,
                      Severity: Major
                      Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 1 hr to fix

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

                          def __init__(
                        Severity: Major
                        Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 1 hr to fix

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

                            def __init__(self,
                          Severity: Major
                          Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 1 hr to fix

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

                              def __init__(
                            Severity: Major
                            Found in official/projects/yolo/modeling/layers/nn_blocks.py - About 1 hr to fix

                              Function build has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def build(self, input_shape):
                                  dark_conv_args = {
                                      'kernel_initializer': self._kernel_initializer,
                                      'bias_initializer': self._bias_initializer,
                                      'bias_regularizer': self._bias_regularizer,
                              Severity: Minor
                              Found in official/projects/yolo/modeling/layers/nn_blocks.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 9 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def __init__(self,
                                             filters=2,
                                             repetitions=2,
                                             insert_spp=False,
                                             insert_sam=False,
                              Severity: Minor
                              Found in official/projects/yolo/modeling/layers/nn_blocks.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 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def __init__(self,
                                             filters=1,
                                             kernel_size=(1, 1),
                                             strides=(1, 1),
                                             padding='same',
                              Severity: Minor
                              Found in official/projects/yolo/modeling/layers/nn_blocks.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 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def build(self, input_shape):
                                  dark_conv_args = {
                                      'activation': self._activation,
                                      'kernel_initializer': self._kernel_initializer,
                                      'bias_initializer': self._bias_initializer,
                              Severity: Minor
                              Found in official/projects/yolo/modeling/layers/nn_blocks.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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def build(self, input_shape):
                                  dark_conv_args = {
                                      'kernel_initializer': self._kernel_initializer,
                                      'bias_initializer': self._bias_initializer,
                                      'bias_regularizer': self._bias_regularizer,
                              Severity: Minor
                              Found in official/projects/yolo/modeling/layers/nn_blocks.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_csp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def _call_csp(self, inputs, training=None):
                                  # check efficiency
                                  x = inputs
                                  x_prev = x
                                  output_prev = True
                              Severity: Minor
                              Found in official/projects/yolo/modeling/layers/nn_blocks.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

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

                                  if self._sc_activation == 'leaky':
                                    self._activation_fn = tf_keras.layers.LeakyReLU(alpha=self._leaky_alpha)
                                  elif self._sc_activation == 'mish':
                                    self._activation_fn = lambda x: x * tf.math.tanh(tf.math.softplus(x))
                                  else:
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 3 other locations - About 5 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 170..175
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1226..1231
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1310..1315

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

                              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

                                  if self._output_activation == 'leaky':
                                    self._activation_fn = tf_keras.layers.LeakyReLU(alpha=self._leaky_alpha)
                                  elif self._output_activation == 'mish':
                                    self._activation_fn = lambda x: x * tf.math.tanh(tf.math.softplus(x))
                                  else:
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 3 other locations - About 5 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 170..175
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 368..373
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1310..1315

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

                              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

                                  if self._activation == 'leaky':
                                    self._activation_fn = tf_keras.layers.LeakyReLU(alpha=self._leaky_alpha)
                                  elif self._activation == 'mish':
                                    self._activation_fn = lambda x: x * tf.math.tanh(tf.math.softplus(x))
                                  else:
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 3 other locations - About 5 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 368..373
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1226..1231
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1310..1315

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

                              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

                                  if self._activation == 'leaky':
                                    self._activation_fn = tf_keras.layers.LeakyReLU(alpha=self._leaky_alpha)
                                  elif self._activation == 'mish':
                                    self._activation_fn = lambda x: x * tf.math.tanh(tf.math.softplus(x))
                                  else:
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 3 other locations - About 5 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 170..175
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 368..373
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1226..1231

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

                              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 get_config(self):
                                  # used to store/share parameters to reconstruct the model
                                  layer_config = {
                                      'filters': self._filters,
                                      'pool_sizes': self._pool_sizes,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 4 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 384..402

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

                              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 get_config(self):
                                  # used to store/share parameters to reconstruct the model
                                  layer_config = {
                                      'filters': self._filters,
                                      'kernel_initializer': self._kernel_initializer,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 4 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1821..1839

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if self._downsample:
                                    self._conv_prev = ConvBN(
                                        filters=self._filters,
                                        kernel_size=(3, 3),
                                        strides=(2, 2),
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 3 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1017..1028

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

                                  if self._downsample:
                                    self._conv = ConvBN(
                                        filters=self._filters,
                                        kernel_size=(3, 3),
                                        strides=(2, 2),
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 3 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1041..1052

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

                                def _conv2(self, filters, kwargs, csp=False):
                                  if csp:
                                    filters_ = self._csp_filters
                                  else:
                                    filters_ = self._conv2_filters
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 3 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1575..1588

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 67.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                def _conv1(self, filters, kwargs, csp=False):
                                  if csp:
                                    filters_ = self._csp_filters
                                  else:
                                    filters_ = self._conv1_filters
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 3 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1590..1603

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 67.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                    if self._dilation_rate > 1:
                                      dilation_rate = 1
                                      if self._dilation_rate // 2 > 0:
                                        dilation_rate = self._dilation_rate // 2
                                      down_stride = 1
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 3 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 335..342

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

                              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._dilation_rate > 1:
                                      dilation_rate = 1
                                      if self._dilation_rate // 2 > 0:
                                        dilation_rate = self._dilation_rate // 2
                                      down_stride = 1
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 3 hrs to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 657..664

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

                              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

                                  dark_conv_args = {
                                      'filters': self._filters,
                                      'filter_scale': self._filter_scale,
                                      'activation': self._activation,
                                      'kernel_initializer': self._kernel_initializer,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 2 other locations - About 2 hrs to fix
                              official/nlp/modeling/layers/transformer_xl.py on lines 187..211
                              official/nlp/modeling/models/seq2seq_transformer.py on lines 572..584

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 55.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  dark_conv_args = {
                                      'kernel_initializer': self._kernel_initializer,
                                      'bias_initializer': self._bias_initializer,
                                      'bias_regularizer': self._bias_regularizer,
                                      'use_bn': self._use_bn,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 6 other locations - About 2 hrs to fix
                              official/nlp/modeling/models/seq2seq_transformer.py on lines 96..107
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 494..505
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 643..654
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 777..788
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1072..1083
                              research/object_detection/legacy/evaluator.py on lines 33..57

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 51.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  dark_conv_args = {
                                      'kernel_initializer': self._kernel_initializer,
                                      'bias_initializer': self._bias_initializer,
                                      'bias_regularizer': self._bias_regularizer,
                                      'use_bn': self._use_bn,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 6 other locations - About 2 hrs to fix
                              official/nlp/modeling/models/seq2seq_transformer.py on lines 96..107
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 321..332
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 494..505
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 643..654
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1072..1083
                              research/object_detection/legacy/evaluator.py on lines 33..57

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 51.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  dark_conv_args = {
                                      'kernel_initializer': self._kernel_initializer,
                                      'bias_initializer': self._bias_initializer,
                                      'bias_regularizer': self._bias_regularizer,
                                      'use_bn': self._use_bn,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 6 other locations - About 2 hrs to fix
                              official/nlp/modeling/models/seq2seq_transformer.py on lines 96..107
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 321..332
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 494..505
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 643..654
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 777..788
                              research/object_detection/legacy/evaluator.py on lines 33..57

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 51.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  dark_conv_args = {
                                      'kernel_initializer': self._kernel_initializer,
                                      'bias_initializer': self._bias_initializer,
                                      'kernel_regularizer': self._kernel_regularizer,
                                      'bias_regularizer': self._bias_regularizer,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 6 other locations - About 2 hrs to fix
                              official/nlp/modeling/models/seq2seq_transformer.py on lines 96..107
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 321..332
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 643..654
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 777..788
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1072..1083
                              research/object_detection/legacy/evaluator.py on lines 33..57

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 51.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  dark_conv_args = {
                                      'kernel_initializer': self._kernel_initializer,
                                      'bias_initializer': self._bias_initializer,
                                      'bias_regularizer': self._bias_regularizer,
                                      'use_bn': self._use_bn,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 6 other locations - About 2 hrs to fix
                              official/nlp/modeling/models/seq2seq_transformer.py on lines 96..107
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 321..332
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 494..505
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 777..788
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1072..1083
                              research/object_detection/legacy/evaluator.py on lines 33..57

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 51.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if not self._drop_final:
                                    self._conv_concat = ConvBN(
                                        filters=self._filters,
                                        kernel_size=(1, 1),
                                        strides=(1, 1),
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 1 hr to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1063..1067

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 42.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if not self._drop_final:
                                    self._conv_sync = ConvBN(
                                        filters=self._filters,
                                        kernel_size=(1, 1),
                                        strides=(1, 1),
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 1 hr to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 1032..1036

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 42.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  self._convlayer3 = ConvBN(
                                      filters=self._filters // 2,
                                      kernel_size=(3, 3),
                                      strides=(1, 1),
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 1 hr to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 514..517

                              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._convlayer2 = ConvBN(
                                      filters=self._filters // 2,
                                      kernel_size=(3, 3),
                                      strides=(1, 1),
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 1 hr to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 521..524

                              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._conv2 = ConvBN(
                                      filters=self._filters // self._filter_scale,
                                      kernel_size=(1, 1),
                                      strides=(1, 1),
                              Severity: Minor
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 55 mins to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 679..682

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 37.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  self._conv3 = ConvBN(
                                      filters=self._filters // self._filter_scale,
                                      kernel_size=(1, 1),
                                      strides=(1, 1),
                              Severity: Minor
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 55 mins to fix
                              official/projects/yolo/modeling/layers/nn_blocks.py on lines 673..676

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 37.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  conv_op = functools.partial(
                                      tf_keras.layers.SeparableConv2D
                                      if self._use_separable_conv
                                      else tf_keras.layers.Conv2D,
                                      filters=self._filters,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 4 other locations - About 50 mins to fix
                              official/nlp/modeling/layers/relative_attention.py on lines 135..142
                              official/projects/yolo/ops/mosaic.py on lines 236..244
                              research/audioset/vggish/vggish_input.py on lines 61..69
                              research/pcl_rl/trainer.py on lines 309..316

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 36.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  self.dark_conv_args = {
                                      'kernel_size': kernel_size,
                                      'strides': strides,
                                      'padding': padding,
                                      'dilation_rate': dilation_rate,
                              Severity: Minor
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 1 other location - About 35 mins to fix
                              research/deeplab/core/feature_extractor.py on lines 494..509

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 33.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if self._use_bn:
                                    self.bn = self._bn_base(
                                        momentum=self._norm_momentum,
                                        epsilon=self._norm_epsilon,
                                        axis=self._bn_axis,
                              Severity: Major
                              Found in official/projects/yolo/modeling/layers/nn_blocks.py and 4 other locations - About 30 mins to fix
                              official/vision/modeling/layers/nn_blocks_3d.py on lines 158..162
                              official/vision/modeling/layers/nn_blocks_3d.py on lines 173..177
                              official/vision/modeling/layers/nn_blocks_3d.py on lines 188..192
                              official/vision/modeling/layers/nn_blocks_3d.py on lines 203..207

                              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