alchemyst/Skogestad-Python

View on GitHub

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):
Severity: Minor
Found in robustcontrol/doc_func.py - About 45 mins to fix

    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):
    Severity: Minor
    Found in robustcontrol/utilsplot.py - About 45 mins to fix

      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
      Severity: Major
      Found in PEAK_MIMO.py - About 45 mins to fix

        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):
        Severity: Minor
        Found in robustcontrol/utilsplot.py - About 45 mins to fix

          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):
          Severity: Minor
          Found in robustcontrol/utils.py - About 45 mins to fix

            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):
            Severity: Minor
            Found in Uncertain_MIMO.py - About 45 mins to fix

              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
              
              
              Severity: Minor
              Found in robustcontrol/utils.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 plot_freq_subplot has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def plot_freq_subplot(plt, w, direction, name, color, figure_num):
              Severity: Minor
              Found in robustcontrol/utilsplot.py - About 45 mins to fix

                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
                Severity: Major
                Found in robustcontrol/utils.py - About 45 mins to fix

                  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):
                  Severity: Minor
                  Found in Uncertain_MIMO.py - About 45 mins to fix

                    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
                    Severity: Major
                    Found in robustcontrol/reporting.py - About 45 mins to fix

                      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:
                      Severity: Minor
                      Found in robustcontrol/utils.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 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 = []
                      Severity: Minor
                      Found in robustcontrol/utils.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

                      Avoid deeply nested control flow statements.
                      Open

                                          if axlim is not None:
                                              ax.axis(axlim)
                                          else:
                                              ax.axis([None, None, None, max(rgamax)])
                      
                      
                      Severity: Major
                      Found in robustcontrol/utilsplot.py - About 45 mins to fix

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

                        def zeros(G=None, A=None, B=None, C=None, D=None):
                        Severity: Minor
                        Found in robustcontrol/utils.py - About 35 mins to fix

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

                              def __init__(self, name, out_name, in1, in2, add=True):
                          Severity: Minor
                          Found in connect.py - About 35 mins to fix

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

                            def kalman_controllable(A, B, C, P=None, RP=None):
                            Severity: Minor
                            Found in robustcontrol/utils.py - About 35 mins to fix

                              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):
                              Severity: Minor
                              Found in PEAK_MIMO.py - About 35 mins to fix

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

                                def kalman_observable(A, B, C, Q=None, RQ=None):
                                Severity: Minor
                                Found in robustcontrol/utils.py - About 35 mins to fix

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

                                  def satisfy(wI, G, Gp, params, s):
                                  Severity: Minor
                                  Found in robustcontrol/doc_func.py - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language