konstantinos-papadopoulos/PID-BO-CONTROLLER

View on GitHub
plant.py

Summary

Maintainability
D
2 days
Test Coverage

Function createPolesCoefficients has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
Open

    def createPolesCoefficients(self, polesOrder, tpj):
        """
        """

        pGp0 = 1
Severity: Minor
Found in plant.py - About 1 day 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 createZerosCoefficients has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def createZerosCoefficients(self, zerosOrder, tzi):
        """
        """

        q0 = 1 ;
Severity: Minor
Found in plant.py - About 5 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

File plant.py has 291 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright (c) 2016 Konstantinos G. Papdopoulos. All rights reserved.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this distribution,
# and is available at http://www.eclipse.org/legal/epl-v10.html
Severity: Minor
Found in plant.py - About 3 hrs to fix

    Function createPolesCoefficients has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def createPolesCoefficients(self, polesOrder, tpj):
            """
            """
    
            pGp0 = 1
    Severity: Minor
    Found in plant.py - About 1 hr to fix

      Avoid deeply nested control flow statements.
      Open

                              for m in range(int(polesOrder)):
                                  if  (i != j != k != l != m != i) and (i < j < k < l < m):
                                      print('i:',i+1,'j:',j+1,'k:',k+1,'l:',l+1,'m:',m+1);
                                      pGp5 = tpj['tp'+str(i+1)]*tpj['tp'+str(j+1)] * \
                                      tpj['tp'+str(k+1)]*tpj['tp'+str(l+1)] * \
      Severity: Major
      Found in plant.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if  (i != j != k != l != i) and (i < j < k < l):
                                    print('i:',i+1,'j:',j+1,'k:',k+1,'l:',l+1);
                                    q4 = tzi['tz'+str(i+1)] * tzi['tz'+str(j+1)] * \
                                    tzi['tz'+str(k+1)] * tzi['tz'+str(l+1)] + q4
                                    print('q4->',q4)
        Severity: Major
        Found in plant.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if  (i != j != k != l != i) and (i < j < k < l):
                                      print('i:',i+1,'j:',j+1,'k:',k+1,'l:',l+1);
                                      pGp4 = tpj['tp'+str(i+1)]*tpj['tp'+str(j+1)] * \
                                      tpj['tp'+str(k+1)]*tpj['tp'+str(l+1)] + pGp4
                                      print('pGp4->',pGp4)
          Severity: Major
          Found in plant.py - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status