alchemyst/Skogestad-Python

View on GitHub

Showing 668 of 668 total issues

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

                        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

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

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

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

                  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 step has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def step(G, t_end=100, initial_val=0, input_label=None,
                    Severity: Minor
                    Found in robustcontrol/utilsplot.py - About 45 mins to fix

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

                                             [-G(s)*Wg(s), -I, -G(s)]])
                      Severity: Minor
                      Found in P_N_M_matrices.py and 1 other location - About 40 mins to fix
                      P_N_M_matrices.py on lines 157..157

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

                      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

                          store_rhs_eq = np.zeros([np.shape(G(0.0001))[0], len(w)])
                      Severity: Major
                      Found in PEAK_MIMO.py and 2 other locations - About 40 mins to fix
                      PEAK_MIMO.py on lines 200..200
                      PEAK_MIMO.py on lines 260..260

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

                      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

                          mod_G_Gd = np.zeros([np.shape(G(0.0001))[0], len(w)])
                      Severity: Major
                      Found in PEAK_MIMO.py and 2 other locations - About 40 mins to fix
                      PEAK_MIMO.py on lines 259..259
                      PEAK_MIMO.py on lines 260..260

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

                      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

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

                                             [-G(s)*Wg(s), -I, -G(s)]])
                      Severity: Minor
                      Found in P_N_M_matrices.py and 1 other location - About 40 mins to fix
                      P_N_M_matrices.py on lines 150..150

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

                      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

                          store_lhs_eq = np.zeros([np.shape(G(0.0001))[0], len(w)])
                      Severity: Major
                      Found in PEAK_MIMO.py and 2 other locations - About 40 mins to fix
                      PEAK_MIMO.py on lines 200..200
                      PEAK_MIMO.py on lines 259..259

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

                      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 weight_calc has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def weight_calc(w_start, w_end, li, weight_i, steps):
                      Severity: Minor
                      Found in Uncertain_MIMO.py - About 35 mins to fix

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

                        def plot_zeros_poles(z, labels=None, markers='*', markersize=30, markercolor='blue'):
                        Severity: Minor
                        Found in robustcontrol/utilsplot.py - About 35 mins to fix

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

                          def condtn_nm_plot(G, w_start=-2, w_end=2, axlim=None, points=1000):
                          Severity: Minor
                          Found in robustcontrol/utilsplot.py - About 35 mins to fix

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

                            def SVD_w(G, w_start=-2, w_end=2, axlim=None, points=10000):
                            Severity: Minor
                            Found in SVD_w.py - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language