lucasmiranda42/deepof

View on GitHub

Showing 195 of 195 total issues

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

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

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

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

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

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

        Function get_angles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_angles(self, tab_dict: dict, verbose: bool = True) -> dict:
                """Compute all the angles between adjacent bodypart trios per video and per frame in the data.
        
                Args:
                    tab_dict (dict): Dictionary of pandas DataFrames containing the trajectories of all bodyparts.
        Severity: Minor
        Found in deepof/data.py - About 35 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 condition_distance_binning has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

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

        def tune_search(
            preprocessed_object: tuple,
            adjacency_matrix: np.ndarray,
            encoding_size: int,
            embedding_model: str,
        Severity: Minor
        Found in deepof/model_utils.py - About 35 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 annotate_time_chunks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def annotate_time_chunks(
            deepof_project: coordinates,
            soft_counts: table_dict,
            breaks: table_dict,
            supervised_annotations: table_dict = None,
        Severity: Minor
        Found in deepof/post_hoc.py - About 35 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 get_distances has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_distances(self, tab_dict: dict, verbose: bool = True) -> dict:
                """Compute the distances between all selected body parts over time. If ego is provided, it only returns distances to a specified bodypart.
        
                Args:
                    tab_dict (dict): Dictionary of pandas DataFrames containing the trajectories of all bodyparts.
        Severity: Minor
        Found in deepof/data.py - About 35 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 gmm_model_selection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def gmm_model_selection(
            x: pd.DataFrame,
            n_components_range: range,
            part_size: int,
            n_runs: int = 100,
        Severity: Minor
        Found in deepof/utils.py - About 35 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 rotate_numba has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def rotate_numba(
            p: np.array, angles: np.array, origin: np.array = np.array([0, 0])
        ) -> np.array:  # pragma: no cover
            """Return a 2D numpy.ndarray with the initial values rotated by angles radians.
        
        
        Severity: Minor
        Found in deepof/utils.py - About 35 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 get_callbacks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def get_callbacks(
            embedding_model: str,
            encoder_type: str,
            kmeans_loss: float = 1.0,
            input_type: str = False,
        Severity: Minor
        Found in deepof/model_utils.py - About 25 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 separation_between_conditions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def separation_between_conditions(
            cur_embedding: table_dict,
            cur_soft_counts: table_dict,
            cur_breaks: table_dict,
            exp_conditions: dict,
        Severity: Minor
        Found in deepof/post_hoc.py - About 25 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 test_step has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def test_step(self, data):  # pragma: no cover
                """Performs a test step."""
                # Unpack data, repacking labels into a generator
                x, a, y = data
                if not isinstance(y, tuple):
        Severity: Minor
        Found in deepof/models.py - About 25 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 rolling_speed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def rolling_speed(
            dframe: pd.DatetimeIndex,
            window: int = 3,
            rounds: int = 3,
            deriv: int = 1,
        Severity: Minor
        Found in deepof/utils.py - About 25 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 train_step has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def train_step(self, data):  # pragma: no cover
                """Perform a training step."""
                # Unpack data, repacking labels into a generator
                x, a, y = data
                if not isinstance(y, tuple):
        Severity: Minor
        Found in deepof/models.py - About 25 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

        Severity
        Category
        Status
        Source
        Language