alchemyst/Skogestad-Python

View on GitHub

Showing 668 of 668 total issues

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

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

                s_min = numpy.array(
                    [utils.sigmas(S(s[p]), 'min') for p in range(points)])
    Severity: Major
    Found in robustcontrol/utilsplot.py and 1 other location - About 1 hr to fix
    robustcontrol/utilsplot.py on lines 894..895

    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 40.

    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

                s_max = numpy.array(
                    [utils.sigmas(S(s[p]), 'max') for p in range(points)])
    Severity: Major
    Found in robustcontrol/utilsplot.py and 1 other location - About 1 hr to fix
    robustcontrol/utilsplot.py on lines 892..893

    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 40.

    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

                    mag = numpy.array(
                              numpy.abs(
                                  ([utils.RGA(Gfr)[i, j] for Gfr in freqresp])
    Severity: Major
    Found in robustcontrol/utilsplot.py and 1 other location - About 1 hr to fix
    robustcontrol/utilsplot.py on lines 696..697

    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 40.

    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

                    rgas = numpy.array(
                        numpy.abs(([utils.RGA(Gfr)[i, j] for Gfr in freqresp]))
    Severity: Major
    Found in robustcontrol/utilsplot.py and 1 other location - About 1 hr to fix
    robustcontrol/utilsplot.py on lines 665..667

    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 40.

    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 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

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

                    plt.semilogx(w, abs(vec[:, i, 0]), label='$%s_{max}$' % d, lw=2)
            Severity: Major
            Found in robustcontrol/utilsplot.py and 1 other location - About 1 hr to fix
            robustcontrol/utilsplot.py on lines 518..518

            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 39.

            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

                    plt.semilogx(w, abs(vec[:, i, -1]), label='$%s_{min}$' % d, lw=2)
            Severity: Major
            Found in robustcontrol/utilsplot.py and 1 other location - About 1 hr to fix
            robustcontrol/utilsplot.py on lines 517..517

            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 39.

            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 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

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

                      P = np.vstack([np.hstack([Ps[0, 0], Ps[0, 1], Ps[0, 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 70..70
                  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

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

                                     np.hstack([Ps[2, 0], Ps[2, 1], Ps[2, 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 70..70

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language