iteal/wormpose

View on GitHub

Showing 47 of 47 total issues

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

def _res_block(x, filters, num_blocks, strides, name, activation):
Severity: Minor
Found in wormpose/machine_learning/model.py - About 45 mins to fix

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

    def _align_unlabelled_segments_with_adjacents(segments, segments_alignment, partitioned_skeletons, frame_rate: float):
        """
        Resolve the unaligned segments by comparing with adjacent segments,
        starting with the segments that have the least frames gap between an adjacent trusted segment
        Don't align isolated segments which a big gap between trusted segments
    Severity: Minor
    Found in wormpose/pose/headtail_resolution.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 _update_coords has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _update_coords(
    Severity: Minor
    Found in wormpose/images/synthetic/_coord_transform.py - About 45 mins to fix

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

      def _parse_arguments(dataset_path: str, kwargs: dict):
          if kwargs.get("work_dir") is None:
              kwargs["work_dir"] = default_paths.WORK_DIR
          if kwargs.get("batch_size") is None:
              kwargs["batch_size"] = 128
      Severity: Minor
      Found in wormpose/commands/train_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 generate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def generate(self, file_pattern: str, num_samples: int):
              """
              Start the generation of files containing synthetic data
      
              :param file_pattern: Filepath of the files to generate with an "index" variable
      Severity: Minor
      Found in wormpose/machine_learning/synthetic_data_generator.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 _generate_synthetic_data has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _generate_synthetic_data(
      Severity: Minor
      Found in wormpose/commands/evaluate_model.py - About 45 mins to fix

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

        def _assemble_images_batch(
            frame_preprocessing: BaseFramePreprocessing,
            data_reading_queue,
            results_queue,
            temp_dir: str,
        Severity: Minor
        Found in wormpose/machine_learning/predict_data_generator.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 __call__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __call__(
        Severity: Minor
        Found in wormpose/images/scoring/centerline_accuracy_check.py - About 35 mins to fix

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

          def segment_foreground(
          Severity: Minor
          Found in wormpose/dataset/image_processing/image_utils.py - About 35 mins to fix

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

            def get_tfrecord_dataset(
            Severity: Minor
            Found in wormpose/machine_learning/tfrecord_file.py - About 35 mins to fix

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

                  def __call__(
              Severity: Minor
              Found in wormpose/commands/predict_dataset.py - About 35 mins to fix

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

                    def generate(
                Severity: Minor
                Found in wormpose/images/synthetic/synthetic_dataset.py - About 35 mins to fix

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

                      def __init__(
                  Severity: Minor
                  Found in wormpose/machine_learning/predict_data_generator.py - About 35 mins to fix

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

                    def _basic_block(x, filters, strides, name, activation):
                    Severity: Minor
                    Found in wormpose/machine_learning/model.py - About 35 mins to fix

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

                      def _complex_crop(empty_frame, center, out_shape: np.ndarray, processed_frame, worm_roi: Tuple[slice, slice]):
                      Severity: Minor
                      Found in wormpose/images/real_dataset.py - About 35 mins to fix

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

                        def _build_model(input_shape, out_dim, middle_stack, filters, activation):
                        Severity: Minor
                        Found in wormpose/machine_learning/model.py - About 35 mins to fix

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

                          def _compare_pred_real(
                          Severity: Minor
                          Found in wormpose/images/scoring/results_scoring.py - About 35 mins to fix

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

                                def __init__(
                            Severity: Minor
                            Found in wormpose/demo/synthetic_simple_visualizer.py - About 35 mins to fix

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

                                  def __init__(
                              Severity: Minor
                              Found in wormpose/commands/calibrate_dataset.py - About 35 mins to fix

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

                                def load_dataset(
                                Severity: Minor
                                Found in wormpose/dataset/loader.py - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language