Configuration | Metrics Example of a property: Prefix definitions ◦Prefix for the method/property scope PRIVATE (121) = "priv_" ◦Prefix for the POU type PROPERTY (107) = "P_{datatype}" Please note: For POUs with an access modifier (i.e. methods or properties), the overall prefix is expected to be the combination of the scope prefix (NC0121–NC0124: PRIVATE/PROTECTED/ INTERNAL/PUBLIC) and the prefix for the POU type (NC0105 for methods, NC0107 for properties). ◦Prefix for the variable data type LREAL (18) = "f" With the prefix definitions mentioned the overall prefix "priv_P_f" is thus expected for a property with the access modifier PRIVATE and the data type LREAL.
4.4 Metrics | Metrics In the Metrics tab you can select and configure the metrics to be displayed for each function block in the Standard Metrics [ } 112] view when the command 'View Standard Metrics' is executed. You have over 20 metrics at your disposal to analyze and characterize the underlying source code. When calculated regularly, the metrics can indicate negative trends and deviations from quality targets. The key figures therefore represent an indicator for assessing software quality. For example, the tabular output contains metrics for the number of statements or the proportion of comments.
Analysis of libraries The following metrics are also output for the libraries integrated in the project: code size, variable size, stack size and number of calls. Compilation errors for violations of upper/lower limits You can use rule SA0150 of the static code analysis to output violations of the upper and lower limits of the activated metrics as compilation errors. Configuration of the metrics Evaluation of the upper and lower limits The set upper and lower limits you can be evaluated in two ways. Standard Metrics view: ◦Enable the metric whose configured upper and lower limits you want to evaluate. ◦Execute the Command 'View Standard Metrics' [ } 112] .
◦TwinCAT shows the enabled metrics for each programming block in the tabular Standard Metrics view. TE1200 93 Version: 2.11.1 Active You can enable or disable the individual metrics using the checkbox for the respective row. When command 'View Standard Metrics' [} 112] is executed, the metrics that are enabled in the respective configuration are shown for each programming block in the Standard Metrics view. • : The metric is disabled and is not displayed in the Standard Metrics view when the command View Standard Metrics is executed. • : The metric is enabled and is displayed in the Standard Metrics view when the command View Standard Metrics is executed.
Lower limit For each metric you can define an individual upper and lower limit by entering the required number in the respective metric row. If a metric is only limited in one direction, you can leave the configuration for the other direction blank. In other words, you may specify either only the lower limit or only the upper limit. Upper limit