alchemyst/Skogestad-Python

View on GitHub

Showing 668 of 668 total issues

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

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

                       np.hstack([Ps[1, 0], Ps[1, 1], Ps[1, 2]]),
    Severity: Major
    Found in P_N_M_matrices.py and 2 other locations - About 1 hr to fix
    P_N_M_matrices.py on lines 69..69
    P_N_M_matrices.py on lines 71..71

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 38.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function cross_over_freq has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def cross_over_freq(sys, tol=0.05):
        """
        Only returns the cross over frequency for a transfer function.
        The tf may cross from above or below...
        Very similar to margin due to a programming glitch on my part...
    Severity: Minor
    Found in control_add_on.py - About 55 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 sv_dir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def sv_dir(G, table=False):
        """
        Returns the input and output singular vectors associated with the
        minimum and maximum singular values.
    
    
    Severity: Minor
    Found in robustcontrol/utils.py - About 55 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                if y[i] == max_v[j]:
                    time_max.append(t[i])
    Severity: Minor
    Found in Second_order.py and 1 other location - About 55 mins to fix
    Second_order.py on lines 43..44

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 37.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        return (tau * s + ro) / (tau / rinf * s + 1)
    Severity: Minor
    Found in robustcontrol/robusttools.py and 1 other location - About 55 mins to fix
    perturbed_models.py on lines 76..76

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 37.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

                if y[i] == min_v[j]:
                    time_min.append(t[i])
    Severity: Minor
    Found in Second_order.py and 1 other location - About 55 mins to fix
    Second_order.py on lines 41..42

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 37.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function simulate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def simulate(self, uf, ts, x0=None):
            """
            Simulates the response of the system to the input.
            Uses a Runge-Kutta delay integration routine.
            Parameters:
    Severity: Minor
    Found in robustcontrol/InternalDelay.py - About 55 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            slope.append((np.log(mag[x + 1]) - np.log(mag[x]))
                         / (np.log(omega[x + 1]) - np.log(omega[x])))
    Severity: Minor
    Found in control_add_on.py and 1 other location - About 55 mins to fix
    control_add_on.py on lines 59..59

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 37.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function BoundST has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def BoundST(G, poles, zeros, deadtime=None):
        """
        This function will calculate the minimum peak values of S and T if the
        system has zeros and poles in the input or output. For standard conditions
        Equation 6.8 (p224) is applied. Equation 6.16 (p226) is used when deadtime
    Severity: Minor
    Found in robustcontrol/utils.py - About 55 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        w_i = (((s * a + start) / ((a /end) * s + 1))
    Severity: Minor
    Found in perturbed_models.py and 1 other location - About 55 mins to fix
    robustcontrol/robusttools.py on lines 31..31

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 37.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function rule1 has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def rule1(G, Gd, K=1, message=False, plot=False, w1=-4, w2=2):
    Severity: Major
    Found in robustcontrol/Chapter_05.py - About 50 mins to fix

      Function dis_rejctn_plot has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def dis_rejctn_plot(G, Gd, S=None, w_start=-2,
      Severity: Major
      Found in robustcontrol/utilsplot.py - About 50 mins to fix

        Function input_acceptable_const_plot has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def input_acceptable_const_plot(G, Gd, w_start=-2, w_end=2, axlim=None,
        Severity: Major
        Found in robustcontrol/utilsplot.py - About 50 mins to fix

          Function allSISOrules has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def allSISOrules(G, deadtime, Gd, K, R, wr, Gm):
          Severity: Major
          Found in robustcontrol/Chapter_05.py - About 50 mins to fix

            Function display_export_data has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def display_export_data(data, display_type, row_head, save=False, latex=False, width=None, sep='|'):
            Severity: Major
            Found in robustcontrol/reporting.py - About 50 mins to fix

              Function input_perfect_const_plot has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def input_perfect_const_plot(G, Gd, w_start=-2, w_end=2, axlim=None,
              Severity: Major
              Found in robustcontrol/utilsplot.py - About 50 mins to fix

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

                    def __init__(self, numerator, denominator=1, deadtime=0, name='',
                Severity: Major
                Found in robustcontrol/utils.py - About 50 mins to fix

                  Function pole_zero_directions has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def pole_zero_directions(G, vec, dir_type, display_type='a', e=1E-8, z_tol=1E-4, p_tol=1E-4):
                  Severity: Major
                  Found in robustcontrol/utils.py - About 50 mins to fix

                    Function bodeclosedloop has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def bodeclosedloop(G, K, w_start=-2, w_end=2,
                    Severity: Major
                    Found in robustcontrol/utilsplot.py - About 50 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language