pyomeca/pyorerun

View on GitHub

Showing 14 of 14 total issues

Function rrc3d has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

def rrc3d(
    c3d_file: str,
    show_floor: bool = True,
    show_force_plates: bool = True,
    show_forces: bool = True,
Severity: Minor
Found in pyorerun/rrc3d.py - About 4 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

BiorbdModelNoMesh has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class BiorbdModelNoMesh:
    """
    A class to handle a biorbd model and its transformations
    """

Severity: Minor
Found in pyorerun/biorbd_components/model_interface.py - About 2 hrs to fix

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

    def read_vtp_file(filename: str) -> dict:
        """
        Reads a VTP file and extracts the mesh data.
    
        Parameters
    Severity: Minor
    Found in pyorerun/utils/vtp_parser.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 rerun has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        def rerun(
            self, name: str = "animation_phase", init: bool = True, clear_last_node: bool = False, notebook: bool = False
        ) -> None:
            if self.nb_phases == 1:
                self.phase_reruns[0].rerun(name, init, clear_last_node, notebook)
    Severity: Minor
    Found in pyorerun/multi_frame_rate_phase_rerun.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 rrc3d has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def rrc3d(
    Severity: Major
    Found in pyorerun/rrc3d.py - About 1 hr to fix

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

          def add_q(
      Severity: Minor
      Found in pyorerun/multi_phase_rerun.py - About 45 mins to fix

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

            def add_floor(
        Severity: Minor
        Found in pyorerun/multi_phase_rerun.py - About 35 mins to fix

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

              def add_animated_model(
          Severity: Minor
          Found in pyorerun/multi_phase_rerun.py - About 35 mins to fix

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

            def crop_video(
            Severity: Minor
            Found in pyorerun/rrc3d.py - About 35 mins to fix

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

                  def add_q(
              Severity: Minor
              Found in pyorerun/phase_rerun.py - About 35 mins to fix

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

                    def rerun(
                Severity: Minor
                Found in pyorerun/phase_rerun.py - About 35 mins to fix

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

                      def add_force_data(
                  Severity: Minor
                  Found in pyorerun/multi_phase_rerun.py - About 35 mins to fix

                    Function frame_t_span_idx has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def frame_t_span_idx(self) -> list[list[int]]:
                            """
                            Get the index of the time spans for each frame.
                            """
                            frame_t_span_idx = []
                    Severity: Minor
                    Found in pyorerun/multi_frame_rate_phase_rerun.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 to_rerun has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def to_rerun(self, frame: int) -> None:
                            if self.properties.ranges is None:
                                for joint_idx in range(self.nb_q):
                                    name = f"{self.properties.displayed_joint_names[joint_idx]}"
                                    rr.log(
                    Severity: Minor
                    Found in pyorerun/xp_components/timeseries_q.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