alchemyst/Skogestad-Python

View on GitHub

Showing 668 of 668 total issues

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

def tf_step(G, t_end=10, initial_val=0, points=1000,
Severity: Major
Found in robustcontrol/utils.py - About 50 mins to fix

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

    def perf_Wp_plot(S, wB_req, maxSSerror, w_start, w_end,
    Severity: Major
    Found in robustcontrol/utilsplot.py - About 50 mins to fix

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

          if message:
              print('Rule 7:')
              if valid7:
                  print('wc < wu :', wc, '<', wu)
              else:
      Severity: Minor
      Found in robustcontrol/Chapter_05.py and 1 other location - About 50 mins to fix
      robustcontrol/Chapter_05.py on lines 454..459

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

      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

              np.linalg.svd(G(RHP_p+error_poles_direction))[2][:, 0].H*
      Severity: Minor
      Found in PEAK_MIMO.py and 1 other location - About 50 mins to fix
      PEAK_MIMO.py on lines 148..148

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

      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 plot_type == 'input':
              vec = numpy.array([V for _, _, V in map(utils.SVD, freqresp)])
              d = 'v'
      Severity: Minor
      Found in robustcontrol/utilsplot.py and 1 other location - About 50 mins to fix
      robustcontrol/utilsplot.py on lines 508..510

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

      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 message:
              print('Rule 8:')
              if valid8:
                  print('wc > 2p :', wc, '>', wp)
              else:
      Severity: Minor
      Found in robustcontrol/Chapter_05.py and 1 other location - About 50 mins to fix
      robustcontrol/Chapter_05.py on lines 410..415

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

      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

                  yz_direction = np.matrix(np.zeros([G(0.001).shape[0],
                                                     len(Zeros_G)]))
      Severity: Minor
      Found in PEAK_MIMO.py and 1 other location - About 50 mins to fix
      PEAK_MIMO.py on lines 46..47

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

      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

                             [Wp(s)*G(s), Wp(s), Wp(s)*G(s)],
      Severity: Minor
      Found in P_N_M_matrices.py and 1 other location - About 50 mins to fix
      P_N_M_matrices.py on lines 163..163

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

      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

                  yp_direction = np.matrix(np.zeros([G(0.001).shape[0],
                                                     len(Poles_G)]))
      Severity: Minor
      Found in PEAK_MIMO.py and 1 other location - About 50 mins to fix
      PEAK_MIMO.py on lines 44..45

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

      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

              np.abs(np.linalg.svd(G(RHP_Z+error_poles_direction))[0][:, 0].H*
      Severity: Minor
      Found in PEAK_MIMO.py and 1 other location - About 50 mins to fix
      PEAK_MIMO.py on lines 162..162

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

      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

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

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

      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

          elif plot_type == 'output':
              vec = numpy.array([U for U, _, _ in map(utils.SVD, freqresp)])
              d = 'u'
      Severity: Minor
      Found in robustcontrol/utilsplot.py and 1 other location - About 50 mins to fix
      robustcontrol/utilsplot.py on lines 505..507

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

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

      def rule4(G, R, wr, message=False, w1=-4, w2=2):
      Severity: Minor
      Found in robustcontrol/Chapter_05.py - About 45 mins to fix

        Function adjust_spine has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def adjust_spine(xlabel, ylabel, x0=0, y0=0, width=1, height=1):
        Severity: Minor
        Found in robustcontrol/utilsplot.py - About 45 mins to fix

          Function setup_plot has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def setup_plot(legend_list, w1=False, w2=False, G=False, K=False, wr=False):
          Severity: Minor
          Found in robustcontrol/doc_func.py - About 45 mins to fix

            Function rule5 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def rule5(G, Gm=1, message=False):
                """
                This is rule five of chapter five
            
                Calculates constraints for time delay, wc < 1 / theta
            Severity: Minor
            Found in robustcontrol/Chapter_05.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 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

              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
                    Severity
                    Category
                    Status
                    Source
                    Language