tensorflow/models

View on GitHub

Showing 11,634 of 11,634 total issues

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

def build_maskconver_model(
Severity: Minor
Found in official/projects/maskconver/modeling/factory.py - About 45 mins to fix

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

      def __init__(self,
    Severity: Minor
    Found in official/projects/panoptic/serving/panoptic_maskrcnn.py - About 45 mins to fix

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

        def __init__(self,
                     output_size,
                     min_level,
                     max_level,
                     fpn_low_range,
      Severity: Minor
      Found in official/projects/maskconver/dataloaders/multiscale_maskconver_input.py - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

        def __init__(self,
                     output_size,
                     min_level,
                     max_level,
                     num_scales,
      Severity: Minor
      Found in official/projects/maskconver/dataloaders/panoptic_maskrcnn_input.py - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

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

        def __init__(self,
      Severity: Minor
      Found in official/projects/panoptic/serving/panoptic_deeplab.py - About 45 mins to fix

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

        def _merge_semantic_and_instance_maps(
        Severity: Minor
        Found in official/projects/panoptic/modeling/layers/panoptic_deeplab_merge.py - About 45 mins to fix

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

            def build_metrics(self, training: bool = True) -> List[
                tf_keras.metrics.Metric]:
              """Build metrics."""
              eval_config = self.task_config.evaluation
              metrics = []
          Severity: Minor
          Found in official/projects/panoptic/tasks/panoptic_deeplab.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 flow_conv_stem has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def flow_conv_stem(inputs,
          Severity: Minor
          Found in official/projects/assemblenet/modeling/assemblenet.py - About 45 mins to fix

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

              def serve(self, images: tf.Tensor):
                """Casts image to float and run inference.
            
                Args:
                  images: uint8 Tensor of shape [batch_size, None, None, 3]
            Severity: Minor
            Found in official/projects/panoptic/serving/panoptic_maskrcnn.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 _construct_branch_3_layers has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def _construct_branch_3_layers(
            Severity: Minor
            Found in official/projects/s3d/modeling/inception_utils.py - About 45 mins to fix

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

                def __init__(
                    self,
                    output_size: List[int],
                    resize_eval_groundtruth: bool = True,
                    groundtruth_padded_size: Optional[List[int]] = None,
              Severity: Minor
              Found in official/projects/panoptic/dataloaders/panoptic_deeplab_input.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_multiscale_maskconver_model has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def build_multiscale_maskconver_model(
              Severity: Minor
              Found in official/projects/maskconver/modeling/factory.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            for i, per_class_value in enumerate(value):
                              metric_key = 'panoptic_quality/{}/class_{}'.format(k, i)
                              result[metric_key] = per_class_value
                          else:
                Severity: Major
                Found in official/projects/panoptic/tasks/panoptic_deeplab.py - About 45 mins to fix

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

                    def __init__(self,
                  Severity: Minor
                  Found in official/projects/s3d/modeling/s3d.py - About 45 mins to fix

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

                      def call(self, inputs: tf.Tensor,
                               image_info: Optional[tf.Tensor] = None,
                               box_indices: Optional[tf.Tensor] = None,
                               classes: Optional[tf.Tensor] = None,
                               training: bool = None
                    Severity: Minor
                    Found in official/projects/maskconver/modeling/maskconver_model.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 aggregate_logs has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def aggregate_logs(self, state=None, step_outputs=None):
                        is_first_step = not state
                        super().aggregate_logs(state, step_outputs)
                    
                        if is_first_step:
                    Severity: Minor
                    Found in official/projects/panoptic/tasks/panoptic_maskrcnn.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 gather has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def gather(boxlist, indices, fields=None, use_static_shapes=False):
                      """Gather boxes from BoxList according to indices and return new BoxList.
                    
                      By default, `gather` returns boxes corresponding to the input index list, as
                      well as all additional fields stored in the boxlist (indexing into the
                    Severity: Minor
                    Found in official/projects/centernet/ops/box_list_ops.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 _mosaic has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def _mosaic(self, *patch_samples):
                        """Builds a 2x2 or 3x3 mosaic."""
                        if self._mosaic_frequency >= 1.0:
                          mosaic_prob = 1.0
                        else:
                    Severity: Minor
                    Found in official/projects/yolo/ops/mosaic.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 _mosaic_crop_image has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def _mosaic_crop_image(
                    Severity: Minor
                    Found in official/projects/yolo/ops/mosaic.py - About 45 mins to fix

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

                        def testImageRandHSV(self,
                      Severity: Minor
                      Found in official/projects/yolo/ops/preprocessing_ops_test.py - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language