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)
- Exclude checks
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)))
- Exclude checks
Remove this commented out code. Open
# rmsds[:, ii] = R.rmsd[:, 2][self._fslicer]
- Read upRead up
- Exclude checks
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,
- Read upRead up
- Exclude checks
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
- Exclude checks
Function "main" has 12 parameters, which is greater than the 7 authorized. Open
topology,
trajectories,
insort=False,
start=None,
stop=None,
- Read upRead up
- Exclude checks
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,)
- Exclude checks
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'
- Exclude checks
Function "main" has 13 parameters, which is greater than the 7 authorized. Open
topology,
trajectories,
plane_selection,
insort=False,
aunit='degrees',
- Read upRead up
- Exclude checks
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
- Exclude checks
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}'
- Exclude checks
Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed. Open
def __call__(self, parser, namespace, values, option_string=None):
- Read upRead up
- Exclude checks
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',
- Read upRead up
- Exclude checks
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
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert coords.shape[0] > 3
- Exclude checks
Function "main" has 12 parameters, which is greater than the 7 authorized. Open
topology,
trajectories,
insort=False,
start=None,
stop=None,
- Read upRead up
- Exclude checks
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
- Exclude checks
Function "main" has 8 parameters, which is greater than the 7 authorized. Open
topology,
trajectories,
insort=False,
selection=None,
maintain=None,
- Read upRead up
- Exclude checks
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): ...