tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

  def _build_feature_map_generator(
Severity: Minor
Found in research/object_detection/models/feature_map_generators_test.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                with tf.variable_scope('Branch_0'):
                  branch_0 = slim.conv2d(net, depth(352), [1, 1],
                                         scope='Conv2d_0a_1x1')
                with tf.variable_scope('Branch_1'):

      Avoid deeply nested control flow statements.
      Open

                  with tf.variable_scope('Branch_1'):
                    branch_1 = slim.conv2d(
                        net, depth(192), [1, 1],
                        weights_initializer=trunc_normal(0.09),
                        scope='Conv2d_0a_1x1')

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

          def _create_feature_extractor(self,

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

            def _create_feature_extractor(self,

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

            def cosine_decay_with_warmup(global_step,
                                         learning_rate_base,
                                         total_steps,
                                         warmup_learning_rate=0.0,
                                         warmup_steps=0,
            Severity: Minor
            Found in research/object_detection/utils/learning_schedules.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

            Avoid deeply nested control flow statements.
            Open

                        if self._use_explicit_padding:
                          last_feature_map = ops.fixed_padding(
                              last_feature_map, kernel_size)
                        last_feature_map = conv_op(

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

              def create_conv_block(name, num_filters, kernel_size, strides, padding,
                                    use_separable, apply_batchnorm, apply_activation,
                                    conv_hyperparams, is_training, freeze_batchnorm,
                                    conv_bn_act_pattern=True):
                """Create Keras layers for regular or separable convolutions.
              Severity: Minor
              Found in research/object_detection/utils/bifpn_utils.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

              Avoid deeply nested control flow statements.
              Open

                          with tf.variable_scope('Branch_1'):
                            branch_1 = slim.conv2d(
                                net, depth(192), [1, 1],
                                weights_initializer=trunc_normal(0.09),
                                scope='Conv2d_0a_1x1')

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

                def cosine_decay_with_warmup(global_step,
                Severity: Minor
                Found in research/object_detection/utils/learning_schedules.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              with tf.variable_scope('Branch_0'):
                                branch_0 = slim.conv2d(
                                    net, depth(128), [1, 1],
                                    weights_initializer=trunc_normal(0.09),
                                    scope='Conv2d_0a_1x1')

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

                    def blackout_pixel_weights_by_box_regions(height, width, boxes, blackout,
                    Severity: Minor
                    Found in research/object_detection/utils/target_assigner_utils.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  if self._use_depthwise:
                                    conv_op = functools.partial(
                                        slim.separable_conv2d, depth_multiplier=1)
                                  else:
                                    conv_op = slim.conv2d

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

                        def _apply_multi_bbox_augmentation_wrapper(image, bboxes, prob, aug_func,
                        Severity: Minor
                        Found in research/object_detection/utils/autoaugment_utils.py - About 45 mins to fix

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

                          def check_and_parse_input_config_key(configs, key):
                            """Checks key and returns specific fields if key is valid input config update.
                          
                            Args:
                              configs: Dictionary of configuration objects. See outputs from
                          Severity: Minor
                          Found in research/object_detection/utils/config_util.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 graph_fn has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def graph_fn(input_boxes, input_classes, input_is_crowd, input_area,
                          Severity: Minor
                          Found in research/object_detection/utils/ops_test.py - About 45 mins to fix

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

                              def add_single_ground_truth_image_info(self,
                            Severity: Minor
                            Found in research/object_detection/utils/object_detection_evaluation.py - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if not agnostic_mode:
                                          if classes[i] in six.viewkeys(category_index):
                                            class_name = category_index[classes[i]]['name']
                                          else:
                                            class_name = 'N/A'
                              Severity: Major
                              Found in research/object_detection/utils/visualization_utils.py - About 45 mins to fix

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

                                    def graph_fn(input_boxes, input_classes, input_is_crowd, input_area,
                                Severity: Minor
                                Found in research/object_detection/utils/ops_test.py - About 45 mins to fix

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

                                  def update_input_reader_config(configs,
                                  Severity: Minor
                                  Found in research/object_detection/utils/config_util.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language