beckhoff TE1200 — 4.2.1.7.15 SA0180: Index range does not cover the entire array

Configuration | Rules 4.2.1.7.13 SA0178: Cognitive complexity | SA0178: Cognitive complexity Corresponding metric available The following metric is available for calculating cognitive complexity as part of the metrics table: Cognitive complexity [ } 100] 4.2.1.7.14 SA0179: Coupling between objects | SA0179: Coupling between objects Corresponding metric available The following metric is available for calculating the relationship between objects as part of the metrics table: Coupling between objects (CBO) [ } 104] 4.2.1.7.15 SA0180: Index range does not cover the entire array | SA0180: Index range does not cover the entire array Sample: PROGRAM MAIN VAR_TEMP nIndex : INT; END_VAR VAR aSample :

ARRAY[0..10] OF INT; END_VAR TE1200 79 Version: 2.11.1 Function The check determines whether a defined limit of cognitive complexity is exceeded in a function block. You can configure the parameter that is taken into account in the check by double- clicking on the row for rule 178 in the rule configuration (PLC Project Properties > category "Static Analysis" > "Rules" tab > Rule 178). You can make the following settings in the dialog that appears: • Complexity limit (default value: 20) Reason This is about checking individual programming guidelines. Some programming guidelines stipulate a maximum value for the cognitive complexity of function blocks.

Excessive cognitive complexity makes the code difficult to read and maintain. Importance Medium Function The check determines whether a defined limit of the coupling between objects in a function block is exceeded. You can configure the parameter that is taken into account in the check by double- clicking on the row for rule 179 in the rule configuration (PLC Project Properties > category "Static Analysis" > "Rules" tab > Rule 179). You can make the following settings in the dialog that appears: • Coupling limit (default value: 30) Reason This is about checking individual programming guidelines.

Some programming guidelines stipulate a maximum value for the coupling between objects for function blocks. Too much coupling between objects makes the code difficult to maintain. Importance Medium Synonym CBO: Coupling Between Objects Function Determines arrays with an index range that is not completely covered. Reason Arrays are often handled in loops, with the loop index indexing the array in such a way that all components of the array are accessed without gaps. This is the case if the loop index and the array index are the same in all dimensions. If the index range does not completely cover the array, this indicates components in the array that have not been processed. Importance Medium