File maskrcnn_model.py
has 433 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
Function _call_box_outputs
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def _call_box_outputs(
self,
images: tf.Tensor,
image_shape: tf.Tensor,
anchor_boxes: Optional[Mapping[str, tf.Tensor]] = None,
- Read upRead up
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 20 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function _run_frcnn_head
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _run_frcnn_head(self,
features,
rois,
gt_boxes,
gt_classes,
- Read upRead up
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 _run_frcnn_head
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def _run_frcnn_head(self,
Function call
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def call( # pytype: disable=signature-mismatch # overriding-parameter-count-checks
Function _call_mask_outputs
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _call_mask_outputs(
Function __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self,
backbone: tf_keras.Model,
decoder: tf_keras.Model,
rpn_head: tf_keras.layers.Layer,
detection_head: Union[tf_keras.layers.Layer,
- Read upRead up
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_box_outputs
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _call_box_outputs(
Function _call_mask_outputs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _call_mask_outputs(
self,
model_box_outputs: Mapping[str, tf.Tensor],
features: tf.Tensor,
current_rois: tf.Tensor,
- Read upRead up
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"