Showing 98 of 668 total issues
Function setup_bode_plot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def setup_bode_plot(title_str, w=numpy.logspace(-2, 2, 100), func=False, legend=False, plot=plt.loglog, grid=True):
Function sv_dir_plot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sv_dir_plot(G, plot_type, w_start=-2, w_end=2, axlim=None, points=1000):
Avoid deeply nested control flow statements. Open
for j in range(len(Poles_G)):
denominator_mat = ((np.conjugate(yp_direction[:, i]))
*Dead_time_matrix(Poles_G[i], dead_time_vec_max_row)
*Dead_time_matrix(Poles_G[j], dead_time_vec_max_row)
*yp_direction[:, j]).T
Function bode
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def bode(G, w_start=-2, w_end=2, axlim=None, points=1000, margin=False):
Function scaling
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def scaling(G_hat, e, u, input_type='symbolic', Gd_hat=None, d=None):
Function bound_SISO_wi
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def bound_SISO_wi(w_start, w_end, vec, G, Gp, steps):
Function zero_directions_ss
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def zero_directions_ss(A, B, C, D):
"""
This function calculates the zeros with input and output directions from
a state space representation using the method outlined on pg. 140
- Read upRead up
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 plot_freq_subplot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_freq_subplot(plt, w, direction, name, color, figure_num):
Avoid deeply nested control flow statements. Open
if (y1[0, 0] > constraint) or bconst:
y1[0, 0] = constraint
# once constraint the system is oversaturated
bconst = True
# TODO : incorrect, find the correct switch condition
Function bound_MIMO_wi
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def bound_MIMO_wi(w_start, w_end, vec, G, Gp, steps):
Avoid deeply nested control flow statements. Open
if isinstance(u, (float)): # data is float
u = '{:.3e}'.format(u)
elif isinstance(u, (str, bool, int)): # data is string or boolean
u = ' {}'.format(u)
else: # data is matrix
Function step
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def step(self, u_input, t_start=0, t_end=100, points=1000):
"""
Calculate the time domian step response of a mimotf object.
Parameters:
- Read upRead up
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 minors
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def minors(G, order):
"""
Returns the order minors of a MIMO tf G.
"""
retlist = []
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if axlim is not None:
ax.axis(axlim)
else:
ax.axis([None, None, None, max(rgamax)])
Function zeros
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def zeros(G=None, A=None, B=None, C=None, D=None):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name, out_name, in1, in2, add=True):
Function kalman_controllable
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def kalman_controllable(A, B, C, P=None, RP=None):
Function PEAK_MIMO
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def PEAK_MIMO(w_start, w_end, error_poles_direction, wr, deadtime_if=0):
Function kalman_observable
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def kalman_observable(A, B, C, Q=None, RQ=None):
Function satisfy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def satisfy(wI, G, Gp, params, s):