joaomcteixeira/taurenmd

View on GitHub

Showing 58 of 59 total issues

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

        assert len(self.percentages) == len(self.filled_length)
Severity: Info
Found in src/taurenmd/libs/libcli.py by bandit

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

    assert y_data.shape[0] == len(plot_labels), (
        '{} vs {}'.format(y_data.shape[0], len(plot_labels)))

Severity: Info
Found in src/taurenmd/plots/plotparams.py by bandit

Remove this commented out code.
Open

    # rmsds[:, ii] = R.rmsd[:, 2][self._fslicer]
Severity: Major
Found in src/taurenmd/libs/libcalc.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"

Function "plot" has 21 parameters, which is greater than the 7 authorized.
Open

        y_data,
        x_labels=None,
        x_label_rot=90,
        labels=None,
        ymax=None,

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):
    ...

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

    assert q2x3s.shape == q3s.shape

Severity: Info
Found in src/taurenmd/libs/libcalc.py by bandit

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_fext.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):
    ...

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

    assert n1.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 all(len(i) == len(j) for i, j in zip(data, labels)), \
        'data and labels size do not match'

Severity: Info
Found in src/taurenmd/libs/libutil.py by bandit

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

        topology,
        trajectories,
        plane_selection,
        insort=False,
        aunit='degrees',
Severity: Major
Found in src/taurenmd/cli_pangle.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):
    ...

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

    assert coords.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 n2.shape == p4_vecs.shape, f'{n2.shape}, {p4_vecs.shape}'

Severity: Info
Found in src/taurenmd/libs/libcalc.py by bandit

Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
Open

    def __call__(self, parser, namespace, values, option_string=None):
Severity: Critical
Found in src/taurenmd/libs/libcli.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

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

        topology,
        trajectories,
        insort=False,
        sel1='all',
        sel2='all',
Severity: Major
Found in src/taurenmd/cli_distances.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):
    ...

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

    assert u2.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 coords.shape[0] > 3
Severity: Info
Found in src/taurenmd/libs/libcalc.py by bandit

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_rmsf.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):
    ...

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

        assert len(self.percentages) == total + 1
Severity: Info
Found in src/taurenmd/libs/libcli.py by bandit

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

        topology,
        trajectories,
        insort=False,
        selection=None,
        maintain=None,
Severity: Major
Found in src/taurenmd/cli_nosol.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):
    ...
Severity
Category
Status
Source
Language