lucasmiranda42/deepof

View on GitHub

Showing 195 of 195 total issues

Function output_cluster_video has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def output_cluster_video(
    cap: Any,
    out: Any,
    frame_mask: list,
    v_width: int,
Severity: Minor
Found in deepof/visuals.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 automatically_recognize_arena has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def automatically_recognize_arena(
    coordinates: coordinates,
    tables: table_dict,
    videos: list,
    vid_index: int,
Severity: Minor
Found in deepof/utils.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 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in deepof/data.py - About 1 hr to fix

    Function supervised_tagging has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def supervised_tagging(
    Severity: Major
    Found in deepof/annotation_utils.py - About 1 hr to fix

      Function plot_distance_between_conditions has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def plot_distance_between_conditions(
      Severity: Major
      Found in deepof/visuals.py - About 1 hr to fix

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

            def __init__(
        Severity: Major
        Found in deepof/models.py - About 1 hr to fix

          Function output_videos_per_cluster has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def output_videos_per_cluster(
          Severity: Major
          Found in deepof/visuals.py - About 1 hr to fix

            Function compute_transition_matrix_per_condition has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def compute_transition_matrix_per_condition(
            Severity: Major
            Found in deepof/post_hoc.py - About 1 hr to fix

              Function plot_arena has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              def plot_arena(
                  coordinates: coordinates, center: str, color: str, ax: Any, i: Union[int, str]
              ):
                  """Plot the arena in the given canvas.
              
              
              Severity: Minor
              Found in deepof/visuals.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 enrichment_across_conditions has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def enrichment_across_conditions(
              Severity: Major
              Found in deepof/post_hoc.py - About 1 hr to fix

                Function get_arenas has 10 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def get_arenas(
                Severity: Major
                Found in deepof/utils.py - About 1 hr to fix

                  Function heatmap has 10 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def heatmap(
                  Severity: Major
                  Found in deepof/visuals.py - About 1 hr to fix

                    Function _process_animation_data has 10 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def _process_animation_data(
                    Severity: Major
                    Found in deepof/visuals.py - About 1 hr to fix

                      Function output_unsupervised_annotated_video has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def output_unsupervised_annotated_video(
                          video_path: str,
                          breaks: list,
                          soft_counts: np.ndarray,
                          frame_rate: float = 25,
                      Severity: Minor
                      Found in deepof/visuals.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 create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def create(
                              self,
                              verbose: bool = True,
                              force: bool = False,
                              debug: bool = True,
                      Severity: Minor
                      Found in deepof/data.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 _is_point_inside_numba has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def _is_point_inside_numba(
                          x: float, y: float, polygon: np.array
                      ) -> bool:  # pragma: no cover
                          """
                          This function was generated by Perplexity.ai
                      Severity: Minor
                      Found in deepof/annotation_utils.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 get_transformer_encoder has 10 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def get_transformer_encoder(
                      Severity: Major
                      Found in deepof/models.py - About 1 hr to fix

                        Function filter_columns has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def filter_columns(columns: list, selected_id: str) -> list:
                            """Given a set of TableDict columns, returns those that correspond to a given animal, specified in selected_id.
                        
                            Args:
                                columns (list): List of columns to filter.
                        Severity: Minor
                        Found in deepof/utils.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 get_TCN_decoder has 10 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def get_TCN_decoder(
                        Severity: Major
                        Found in deepof/models.py - About 1 hr to fix

                          Function get_vqvae has 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def get_vqvae(
                          Severity: Major
                          Found in deepof/models.py - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language