lucasmiranda42/deepof

View on GitHub

Showing 195 of 195 total issues

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

    def get_areas(self, speed: int = 0, selected_id: str = "all") -> table_dict:
        """Return a table_dict object with all relevant areas (head, torso, back, full). Unless specified otherwise, the areas are computed for all animals.

        Args:
            speed (int): The derivative to use for speed.
Severity: Minor
Found in deepof/data.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 get_training_set has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    def get_training_set(
        self, current_table_dict: table_dict, test_videos: int = 0
    ) -> tuple:
        """Generate training and test sets as numpy.array objects for model training.

Severity: Minor
Found in deepof/data.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 kleinberg_core_numba has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def kleinberg_core_numba(
    gaps: np.array, s: np.float64, gamma: np.float64, n: int, T: np.float64, k: int
) -> np.array:  # pragma: no cover
    """Computation intensive core part of Kleinberg's algorithm (described in 'Bursty and Hierarchical Structure in Streams').

Severity: Minor
Found in deepof/utils.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 19 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

    Function plot_behavior_trends has 18 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

      Function supervised_annotation has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def supervised_annotation(
              self,
              params: Dict = {},
              center: str = "Center",
              align: str = "Spine_1",
      Severity: Minor
      Found in deepof/data.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 set_up_project_directory has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def set_up_project_directory(self, debug=False):
              """Create a project directory where to save all produced results."""
              # Create a project directory, as well as subfolders for videos and tables
              project_path = os.path.join(self.project_path, self.project_name)
      
      
      Severity: Minor
      Found in deepof/data.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 compute_transition_matrix_per_condition has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      def compute_transition_matrix_per_condition(
          embedding: table_dict,
          soft_counts: table_dict,
          breaks: table_dict,
          exp_conditions: dict,
      Severity: Minor
      Found in deepof/post_hoc.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 _filter_embeddings has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      def _filter_embeddings(
          coordinates,
          embeddings,
          soft_counts,
          breaks,
      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

      Coordinates has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Coordinates:
          """Class for storing the results of a ran project. Methods are mostly setters and getters in charge of tidying up the generated tables."""
      
          def __init__(
              self,
      Severity: Minor
      Found in deepof/data.py - About 2 hrs to fix

        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 load_table has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

          def load_table(
              tab: str,
              table_path: str,
              table_format: str,
              rename_bodyparts: list = None,
          Severity: Minor
          Found in deepof/utils.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 __init__ has 16 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

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

            def recluster(
                coordinates: coordinates,
                embeddings: table_dict,
                soft_counts: table_dict = None,
                min_confidence: float = 0.75,
            Severity: Minor
            Found in deepof/post_hoc.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 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 plot_heatmaps has a Cognitive Complexity of 15 (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 connect_mouse has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            def connect_mouse(
                animal_ids=None, exclude_bodyparts: list = None, graph_preset: str = "deepof_14"
            ) -> nx.Graph:
                """Create a nx.Graph object with the connectivity of the bodyparts in the DLC topview model for a single mouse.
            
            
            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 enforce_skeleton_constraints_numba has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

            def enforce_skeleton_constraints_numba(
                data, skeleton_constraints, original_pos, tolerance=0.1, correction_factor=0.5
            ):  # pragma: no cover
                """
                Adjusts the positions of body parts in each frame to ensure that the distances between connected parts
            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 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
                Severity
                Category
                Status
                Source
                Language