alchemyst/Skogestad-Python

View on GitHub

Showing 98 of 668 total issues

Function rga_nm_plot has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def rga_nm_plot(G, pairing_list=None, pairing_names=None, w_start=-2,
                w_end=2, axlim=None, points=1000, plot_type='all'):
    """
    Plots the RGA number for a specified pairing

Severity: Minor
Found in robustcontrol/utilsplot.py - About 2 hrs 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 possibilities has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def possibilities(umin, umax, Amount):
    """This function is to calculate all possible perturbations of a maximum and
    minimum of a vector of parameters"""

    def box_ready(umin, umax, Amount):
Severity: Minor
Found in perturbations.py - About 1 hr 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 dis_rejctn_plot has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def dis_rejctn_plot(G, Gd, S=None, w_start=-2,
                    w_end=2, axlim=None, points=1000):
    """
    A subplot of disturbance condition number to check for input saturation
    (equation 6.43, p238). Two more subplots indicate if the disturbances fall
Severity: Minor
Found in robustcontrol/utilsplot.py - About 1 hr 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 perf_Wp_plot has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def perf_Wp_plot(S, wB_req, maxSSerror, w_start, w_end,
                 axlim=None, points=1000):
    """
    MIMO sensitivity S and performance weight Wp plotting function.

Severity: Minor
Found in robustcontrol/utilsplot.py - About 1 hr to fix

    Function sym2mimotf has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def sym2mimotf(Gmat, deadtime=None):
        """Converts a MIMO transfer function system in sympy.Matrix form to a
        mimotf object making use of individual tf objects.
    
        Parameters
    Severity: Minor
    Found in robustcontrol/utils.py - About 1 hr 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 poles_and_zeros_of_square_tf_matrix has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def poles_and_zeros_of_square_tf_matrix(G):
        """
        Determine poles and zeros of a square mimotf matrix, making use of the determinant.
        This method may fail in special cases. If terms cancel out during calculation of the determinant,
        not all poles and zeros will be determined.
    Severity: Minor
    Found in robustcontrol/utils.py - About 1 hr 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 rule6 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def rule6(G, Gm, message=False):
        """
        This is rule six of chapter five
    
        Calculates if tight control at low frequencies with RHP-zeros is possible
    Severity: Minor
    Found in robustcontrol/Chapter_05.py - About 1 hr 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 from_tf_coefficients has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def from_tf_coefficients(num, den, delays):
            """
            array-like: (numerator, denominator, delays)
            numerator, denominator, delays can either be in SISO form or MIMO form
            MIMO form e.g.:
    Severity: Minor
    Found in robustcontrol/InternalDelay.py - About 1 hr to fix

      Function freq_step_response_plot has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def freq_step_response_plot(G, K, Kc, t_end=50, freqtype='S', w_start=-2,
      Severity: Major
      Found in robustcontrol/utilsplot.py - About 1 hr to fix

        Function step_response_plot has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def step_response_plot(Y, U, t_end=50, initial_val=0, timedim='sec',
        Severity: Major
        Found in robustcontrol/utilsplot.py - About 1 hr to fix

          Function rga_plot has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def rga_plot(G, w_start=-2, w_end=2, axlim=None, points=1000, fig=0,
          Severity: Major
          Found in robustcontrol/utilsplot.py - About 1 hr to fix

            Function mimo_bode has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def mimo_bode(G, w_start=-2, w_end=2,
            Severity: Major
            Found in robustcontrol/utilsplot.py - About 1 hr to fix

              Function input_acceptable_const_plot has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def input_acceptable_const_plot(G, Gd, w_start=-2, w_end=2, axlim=None,
                                              points=1000, modified=False):
                  """
                  Subplots for input constraints for acceptable control. Applies equation
                  6.55 (p241).
              Severity: Minor
              Found in robustcontrol/utilsplot.py - About 1 hr 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 common_roots_ind has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def common_roots_ind(a, b, dec=3):
                  #Returns the indices of common (approximately equal) roots
                  #of two polynomials
                  a_ind = []  # Contains index of common roots
                  b_ind = []
              Severity: Minor
              Found in robustcontrol/utils.py - About 1 hr 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 minimal_realisation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def minimal_realisation(a, b, c):
                  """"This function will obtain a minimal realisation for a state space
                  model in the form given in Skogestad second edition p 119 equations
                  4.3 and 4.4
              
              
              Severity: Minor
              Found in robustcontrol/utils.py - About 1 hr 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 tf2ss has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              def tf2ss(H):
                  """
                  Converts a mimotf object to the controllable canonical form state space
                  representation. This method and the examples were obtained from course work
                  notes available at
              Severity: Minor
              Found in robustcontrol/utils.py - About 1 hr 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 SVD_w has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def SVD_w(G, w_start=-2, w_end=2, axlim=None, points=10000):
                  """ 
                  Singular value demoposition functions    
                  """
              
              Severity: Minor
              Found in SVD_w.py - About 1 hr to fix

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

                def ref_perfect_const_plot(G, R, wr, w_start=-2, w_end=2, axlim=None,
                Severity: Major
                Found in robustcontrol/utilsplot.py - About 1 hr to fix

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

                  def rga_nm_plot(G, pairing_list=None, pairing_names=None, w_start=-2,
                  Severity: Major
                  Found in robustcontrol/utilsplot.py - About 1 hr to fix

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

                    def rule2(G, R, K, wr, message=False, plot=False, w1=-4, w2=2):
                    Severity: Major
                    Found in robustcontrol/Chapter_05.py - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language