joaomcteixeira/taurenmd

View on GitHub

Showing 58 of 59 total issues

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

def main(
Severity: Major
Found in src/taurenmd/cli_nosol.py - About 1 hr to fix

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

    def calc_planes_angle(a1, b1, c1, a2, b2, c2, aunit='radians'):
    Severity: Major
    Found in src/taurenmd/libs/libcalc.py - About 50 mins to fix

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

      def main(
      Severity: Major
      Found in src/taurenmd/cli_imagemol.py - About 50 mins to fix

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

        def frame_list(len_traj, start=None, stop=None, step=None, flist=None,):
            """
            Create frame integer list from a length and slice parameters.
        
            Examples
        Severity: Minor
        Found in src/taurenmd/libs/libio.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 export_data_to_file has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def export_data_to_file(
        Severity: Minor
        Found in src/taurenmd/libs/libio.py - About 45 mins to fix

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

          def plot(
                  y_data,
                  x_labels=None,
                  x_label_rot=90,
                  labels=None,
          Severity: Minor
          Found in src/taurenmd/plots/labeldots.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 main has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def main(
          Severity: Minor
          Found in src/taurenmd/_cli_template.py - About 45 mins to fix

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

            def frame_list(len_traj, start=None, stop=None, step=None, flist=None,):
            Severity: Minor
            Found in src/taurenmd/libs/libio.py - About 35 mins to fix

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

              def evaluate_to_slice(*, value=None, start=None, stop=None, step=None):
              Severity: Minor
              Found in src/taurenmd/libs/libio.py - About 35 mins to fix

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

                def mk_frame_path(ipath, frame=0, ext='.pdb', leading=0, suffix=None):
                Severity: Minor
                Found in src/taurenmd/libs/libio.py - About 35 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return slice(value)
                  Severity: Major
                  Found in src/taurenmd/libs/libio.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return slice(*indexes)
                    Severity: Major
                    Found in src/taurenmd/libs/libio.py - About 30 mins to fix

                      Function "main" has 12 parameters, which is greater than the 7 authorized.
                      Open

                              topology,
                              trajectories,
                              insort=False,
                              start=None,
                              stop=None,
                      Severity: Major
                      Found in src/taurenmd/cli_rmsd.py by sonar-python

                      A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                      Noncompliant Code Example

                      With a maximum number of 4 parameters:

                      def do_something(param1, param2, param3, param4, param5):
                          ...
                      

                      Compliant Solution

                      def do_something(param1, param2, param3, param4):
                          ...
                      

                      Remove this commented out code.
                      Open

                              # subtitle = 'Selections: {}'.format(' · '.join(selections))
                      Severity: Major
                      Found in src/taurenmd/cli_rmsd.py by sonar-python

                      Programmers should not comment out code as it bloats programs and reduces readability.

                      Unused code should be deleted and can be retrieved from source control history if required.

                      See

                      • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
                      • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
                      • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
                      • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

                      Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
                      Open

                          assert q3s.shape == p4_vecs.shape
                      
                      
                      Severity: Info
                      Found in src/taurenmd/libs/libcalc.py by bandit

                      Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
                      Open

                          assert theta.size == p4_vecs.shape[0]
                      Severity: Info
                      Found in src/taurenmd/libs/libcalc.py by bandit

                      Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
                      Open

                          assert isinstance(frame_slice, slice)
                      Severity: Info
                      Found in src/taurenmd/libs/libmda.py by bandit

                      Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
                      Open

                          assert p4_vecs.shape[1] == 3
                      Severity: Info
                      Found in src/taurenmd/libs/libcalc.py by bandit

                      Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
                      Open

                          assert q1x2.shape == (3,)
                      Severity: Info
                      Found in src/taurenmd/libs/libcalc.py by bandit

                      Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
                      Open

                          assert len(x_data) == y_data.shape[1], \
                              '{} vs {}'.format(len(x_data), y_data.shape[1])
                      Severity: Info
                      Found in src/taurenmd/plots/plotparams.py by bandit
                      Severity
                      Category
                      Status
                      Source
                      Language