lucasmiranda42/deepof

View on GitHub

Showing 195 of 195 total issues

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

    def fit_transform(self, data, key):
        """
        Performs linear interpolation for small gaps and, if full_imputation is True
        applies a multi-step imputation process for larger gaps.

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

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

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

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

      Avoid deeply nested control flow statements.
      Open

                          if "polygonal" in arena_type or len(corners) < 5:
                              cv2.line(
                                  frame_copy,
                                  (corners[c - 1][0], corners[c - 1][1]),
                                  (corners[c][0], corners[c][1]),
      Severity: Major
      Found in deepof/utils.py - About 45 mins to fix

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

        def rotate_all_numba(data: np.array, angles: np.array) -> np.array:  # pragma: no cover
            """Rotates Return a 2D numpy.ndarray with the initial values rotated by angles radians.
        
            Args:
                p (numpy.ndarray): 2D Array containing positions of bodyparts over time.
        Severity: Minor
        Found in deepof/utils.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

        Consider simplifying this complex logical expression.
        Open

            if (
                not aggregate_experiments
                and embeddings is not None
                and normative_model
                or not aggregate_experiments
        Severity: Major
        Found in deepof/visuals.py - About 40 mins to fix

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

              def create(
          Severity: Minor
          Found in deepof/data.py - About 35 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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          def rts_smoother_numba(measurements, F, H, Q, R):  # pragma: no cover
                          Severity: Minor
                          Found in deepof/utils.py - About 35 mins to fix

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

                                def click_on_corners(event, x, y, flags, param):
                            Severity: Minor
                            Found in deepof/utils.py - About 35 mins to fix

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

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

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

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

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

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

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

                                    def _preprocess_time_bins(
                                    Severity: Minor
                                    Found in deepof/visuals_utils.py - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language