lucasmiranda42/deepof

View on GitHub
deepof/visuals.py

Summary

Maintainability
F
2 wks
Test Coverage

File visuals.py has 2311 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""General plotting functions for the deepof package."""
# @author lucasmiranda42
# encoding: utf-8
# module deepof

Severity: Major
Found in deepof/visuals.py - About 6 days to fix

    Function tag_annotated_frames has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
    Open

    def tag_annotated_frames(
        frame,
        font,
        frame_speeds,
        animal_ids,
    Severity: Minor
    Found in deepof/visuals.py - About 1 day 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 plot_gantt has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

    def plot_gantt(
        coordinates: project,
        experiment_id: str,
        soft_counts: table_dict = None,
        supervised_annotations: table_dict = None,
    Severity: Minor
    Found in deepof/visuals.py - About 7 hrs 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 plot_embeddings has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

    def plot_embeddings(
        coordinates: coordinates,
        embeddings: table_dict = None,
        soft_counts: table_dict = None,
        breaks: table_dict = None,
    Severity: Minor
    Found in deepof/visuals.py - About 6 hrs 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 animate_skeleton has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

    def animate_skeleton(
        coordinates: coordinates,
        experiment_id: str,
        animal_id: list = None,
        center: str = "arena",
    Severity: Minor
    Found in deepof/visuals.py - About 5 hrs 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 plot_transitions has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    def plot_transitions(
        coordinates: coordinates,
        embeddings: table_dict,
        soft_counts: table_dict,
        breaks: table_dict = None,
    Severity: Minor
    Found in deepof/visuals.py - About 5 hrs 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 plot_embeddings has 24 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def plot_embeddings(
    Severity: Major
    Found in deepof/visuals.py - About 3 hrs to fix

      Function heatmap has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      def heatmap(
          dframe: pd.DataFrame,
          bodyparts: List,
          xlim: tuple = None,
          ylim: tuple = None,
      Severity: Minor
      Found in deepof/visuals.py - About 2 hrs 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 annotate_video has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      def annotate_video(
          coordinates: coordinates,
          tag_dict: pd.DataFrame,
          vid_index: int,
          frame_limit: int = np.inf,
      Severity: Minor
      Found in deepof/visuals.py - About 2 hrs 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 plot_enrichment has 20 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def plot_enrichment(
      Severity: Major
      Found in deepof/visuals.py - About 2 hrs to fix

        Function _process_animation_data has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        def _process_animation_data(
            coordinates,
            experiment_id,
            animal_id,
            center,
        Severity: Minor
        Found in deepof/visuals.py - About 2 hrs 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 plot_enrichment has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        def plot_enrichment(
            coordinates: coordinates,
            embeddings: table_dict = None,
            soft_counts: table_dict = None,
            breaks: table_dict = None,
        Severity: Minor
        Found in deepof/visuals.py - About 2 hrs 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 plot_heatmaps has 17 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def plot_heatmaps(
        Severity: Major
        Found in deepof/visuals.py - About 2 hrs to fix

          Function plot_cluster_detection_performance has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          def plot_cluster_detection_performance(
              coordinates: coordinates,
              chunk_stats: pd.DataFrame,
              cluster_gbm_performance: dict,
              hard_counts: np.ndarray,
          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 animate_skeleton has 15 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            Function plot_transitions has 15 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              Function plot_heatmaps has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              def plot_heatmaps(
                  coordinates: coordinates,
                  bodyparts: list,
                  center: str = "arena",
                  align: str = None,
              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 _filter_embeddings has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

              def _filter_embeddings(
                  coordinates,
                  embeddings,
                  soft_counts,
                  breaks,
              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 tag_annotated_frames has 13 arguments (exceeds 4 allowed). Consider refactoring.
              Open

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

                Function plot_stationary_entropy has 13 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def plot_stationary_entropy(
                Severity: Major
                Found in deepof/visuals.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 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 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 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 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: int = 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 _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_cluster_video has a Cognitive Complexity of 11 (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 _filter_embeddings has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

                            Function export_annotated_video has 9 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

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

                              Function plot_gantt has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

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

                                Function output_unsupervised_annotated_video has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

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

                                  Function plot_cluster_detection_performance has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

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

                                    Function export_annotated_video has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    def export_annotated_video(
                                        coordinates: coordinates,
                                        soft_counts: dict = None,
                                        breaks: dict = None,
                                        experiment_id: str = None,
                                    Severity: Minor
                                    Found in deepof/visuals.py - About 55 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 plot_shap_swarm_per_cluster has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    def plot_shap_swarm_per_cluster(
                                    Severity: Major
                                    Found in deepof/visuals.py - About 50 mins to fix

                                      Function output_cluster_video has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      def output_cluster_video(
                                      Severity: Major
                                      Found in deepof/visuals.py - About 50 mins to fix

                                        Function plot_normative_log_likelihood has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        def plot_normative_log_likelihood(
                                        Severity: Major
                                        Found in deepof/visuals.py - About 50 mins to fix

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

                                          def annotate_video(
                                          Severity: Minor
                                          Found in deepof/visuals.py - About 45 mins to fix

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

                                            def plot_stationary_entropy(
                                                coordinates: coordinates,
                                                embeddings: table_dict,
                                                soft_counts: table_dict,
                                                breaks: table_dict = None,
                                            Severity: Minor
                                            Found in deepof/visuals.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 _scatter_embeddings has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                            def _scatter_embeddings(
                                            Severity: Minor
                                            Found in deepof/visuals.py - About 45 mins to fix

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

                                              def plot_arena(
                                              Severity: Minor
                                              Found in deepof/visuals.py - About 35 mins to fix

                                                There are no issues that match your filters.

                                                Category
                                                Status