Changes between Version 11 and Version 12 of Documentation/T3Q/Quality-Checks/Code-Style


Ignore:
Timestamp:
12/10/24 17:35:42 (9 months ago)
Author:
phdmakk
Comment:

--

Legend:

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

    v11 v12  
    257257 
    258258This check makes sure there are no literals used, except in module parameters, template definitions, and constant definitions. Note that while in both module-level constants and local constants literals are permitted, in the case of templates, only template definitions at the module level can contain literals. Note also that currently matching symbols, boolean values, verdicts, omit-values, enumerated values, and address-values are not considered ''literals''. This may be a subject to change. 
     259 
     260 
     261==== There Must Be No ValueOf Operations for Values ==== 
     262 * '''Symbolic Name in XML Configuration''': checkNoValueOfForValues 
     263 * '''Dependant Tags in XML Configuration''': - 
     264 
     265This check makes sure there are no '''valueof''' operations on "pure" values. This currently covers references to local variables and formal parameters. 
     266 
     267{{{ 
     268        function f_Work() { 
     269                var float v_ToConvert := 2.0; 
     270                var float v_ValueCms; 
     271                var template float v_ToConvertTemplate := 2.0; 
     272                //Being a value already the call to valueof is redundant -> warning 
     273                v_ValueCms := f_ConvertInchesToCm(valueof(v_ToConvert)); 
     274                //Should be ok -> no warning 
     275                v_ValueCms := f_ConvertInchesToCm(valueof(v_ToConvertTemplate));  
     276        } 
     277        //TODO: further examples with return values, parameters, etc 
     278 
     279        function f_Work ( 
     280                float p_ToConvert, 
     281                template float p_ToConvertTemplate 
     282        )  return template float { 
     283                var float v_ValueCms; 
     284                //Being a value already the call to valueof is redundant -> warning 
     285                v_ValueCms := f_ConvertInchesToCm(valueof(p_ToConvert)); 
     286                //Should be ok -> no warning   
     287                v_ValueCms := f_ConvertInchesToCm(valueof(p_ToConvertTemplate));  
     288        } 
     289}}}