Changes between Version 4 and Version 5 of Documentation/T3Q/Quality-Checks/Code-Style


Ignore:
Timestamp:
10/30/18 17:43:26 (6 years ago)
Author:
phdmakk
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/T3Q/Quality-Checks/Code-Style

    v4 v5  
    140140==== There Must Be No Uninitialised Local Variables ==== 
    141141 * '''Symbolic Name in XML Configuration''': checkNoUninitialisedVariables 
    142  * '''Dependant Tags in XML Configuration''': - 
     142 * '''Dependant Tags in XML Configuration''': checkNoUninitialisedVariablesExclude 
    143143 
    144144This check makes sure there are no uninitialised local variables. This covers local variables declared within statement blocks or module control parts. Variables declared within components are not considered as they may or may not be initialised depending on which other behaviour constructs have been executed. Instead, the data flow analysis is performed strictly within the scope of the top-level statement block. In the following example, the state of the various variables declared within a function is described for each statement using comments directly above the statement. 
     
    181181For variables initialised within branching behaviour, such as if-else if-else constructs, alt statements, and call statements, the data flow analysis evaluates whether each branch directly initialises the variables with absolute certainty. If the variable is initialised in only some of the branches, then a warning is raised as it cannot be ensured that a variable will be initialised before use during execution. This also applies to nested branches. For loops, it cannot be ensured that a variable will be initialised as a loop can be skipped if the loop condition evaluates to false. In such case, variables initialised within the loop are considered as such in the subsequent statements within the loop, however, for statements outside the loop, the variable is still considered to be not initialised (unless there is explicit initialisation outside the loop). 
    182182 
     183The '''checkNoUninitialisedVariablesExclude''' setting can be used to filter out warnings for variables of certain types. The meta-types enumerated, union, record of, record, set of, set, can be listed in order to exclude warnings for all variables of the corresponding meta-type from the output, e.g. exclude all variables of all record types. Additionally, user defined concrete types can be listed as well, so that only warnings for variables of a specific type, e.g. a specific record type, are excluded from the output. In the following example configuration, all warnings for all variables of set and set of types, as well as for all variables of the type MyRecordType are excluded from the output. 
     184 
     185{{{ 
     186      <checkNoUninitialisedVariablesExclude > 
     187        <string>set</string> 
     188        <string>set of</string> 
     189        <string>MyRecordType</string> 
     190      </checkNoUninitialisedVariablesExclude > 
     191}}} 
     192 
     193 
    183194==== There Must Be No Literals ==== 
    184195 * '''Symbolic Name in XML Configuration''': checkNoLiterals