Configuration | Forbidden symbols - Length - Halstead (HL) - Volume - Halstead (HV) - Difficulty - Halstead (D) Background information: Relationship between operators and operands (number, complexity, test effort) Based on the assumption that executable programs consist of operators and operands. Operands in TwinCAT: variables, constants, components, literals and IEC addresses. Operators in TwinCAT: keywords, logical and comparison operators, assignments, IF, FOR, BY, ^, ELSE, CASE, Caselabel, BREAK, RETURN, SIN, +, labels, calls, pragmas, conversions, SUPER, THIS, index access, component access, etc. For each program the following basic parameters are formed:
Number of different operators used - Halstead (n1), Number of different operands used - Halstead (n2) : ◦Number of different used operators (h 1 ) and operands (h 2 ); together they form the vocabulary size h. Number of operators - Halstead (N1), Number of operands - Halstead (N2) : ◦Number of total used operators (N 1 ) and operands (N 2 ); together they form the implementation class N. (Language complexity = operators/operator occurrences * operands/operand occurrences) These parameters are used to calculate the Halstead length (HL) and Halstead volume (HV): Length - Halstead (HL) , Volume - Halstead (HV) :
◦HL = h 1 * log 2 h 1 + h 2 * log 2 h 2 ◦HV = N* log 2 h Various key figures are calculated from the basic parameters: Difficulty - Halstead (D) : ◦Describes the difficulty to write or understand a program (during a code review, for example) ◦D = h 1 /2 *N2/h 2 Effort: ◦E = D*V The key figures usually match the actual measured values very well. The disadvantage is that the method only applies to individual functions and only measures lexical/textual complexity. 4.5 Forbidden symbols | Forbidden symbols In the Forbidden symbols tab, you can specify the keywords, symbols and identifiers that must not be used in the project code.
The forbidden symbols are checked during the static analysis [ } 110] if rule SA0181: Forbidden symbols [ } 80] is configured as an error or warning. TE1200 108 Version: 2.11.1