Detects the usage of different access paths for the same variable
Justification: Different access to the same element decreases the readability and
maintainability of a program. We recommend the consistent usage of {attribute 'qualified-only'}
for libraries, global variable lists, and enumerations. This forces a fully qualified
access.
Importance: Low
Example
VAR_GLOBAL iTemp:INT; instPOU:POU; END_VAR FUNCTION_BLOCK POU VAR a:INT; END_VAR a := INT#1; PROGRAM SA0042 VAR ptiTemp:POINTER TO INT; sTemp:STRING; END_VAR ptiTemp := ADR(iTemp); ptiTemp^:= INT#1; iTemp:= INT#2; // SA0042 - direct access on variable GVL.iTemp := INT#3; // SA0042 - access on variable via GVL sTemp := CONCAT( 'ab', 'cd'); // SA0042 - direct access on function sTemp := Standard.CONCAT( 'ab', 'cd'); // SA0042 - access on function via Standard instPOU(); // SA0042 - direct access on POU instance GVL.instPOU(); // SA0042 - access via GVL --> SA0042: Different access paths for 'CONCAT' --> SA0042: Different access paths for 'Standard.CONCAT' --> SA0042: Different access paths for 'instPOU' --> SA0042: Different access paths for 'GVL.instPOU' --> SA0042: Different access paths for 'iTemp' --> SA0042: Different access paths for 'GVL.iTemp'