SA0150: Violations of lower or upper limits of the metrics
Function | Determines function blocks that violate the enabled metrics at the lower or upper limit. |
Reason | Code that adheres to certain metrics is easier to read, easier to maintain and easier to test. |
Importance | High |
PLCopen rule | CP9 |
Sample:
The metric "Number of calls" is enabled and configured in the metrics configuration enabled (PLC Project Properties > category "Static Analysis" > "Metrics" tab).
- Lower limit: 0
- Upper limit: 3
- Function block Prog1 is called 5 times
When performing the static analysis, a violation of SA0150 is reported as an error or warning in the error list.
// => SA0150: Metric violation for 'Prog1'. Result for metric 'Calls' (5) > 3"