Changes between Version 7 and Version 8 of Documentation/T3Q/Quality-Checks/Code-Style


Ignore:
Timestamp:
12/17/18 15:12:08 (5 years ago)
Author:
phdmakk
Comment:

--

Legend:

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

    v7 v8  
    9696==== There Must Be No Over-specific Runs On Clauses ==== 
    9797 * '''Symbolic Name in XML Configuration''': checkNoOverSpecificRunsOnClauses 
    98  * '''Dependant Tags in XML Configuration''': recursionInCheckNoOverSpecificRunsOnClauses 
     98 * '''Dependant Tags in XML Configuration''': recursionInCheckNoOverSpecificRunsOnClauses, extendsInCheckNoOverSpecificRunsOnClauses (since v2.0.0b26) 
    9999 
    100100This check will make sure no over-specific '''runs on''' clauses are used. An over-specific runs on clause is when none of the component element definitions (variables, timers, constants, and ports) of the component used in the runs on clause are referenced within the body of the function or alststep with the runs on clause. If at least one of the component element definitions is referenced within the body of the function or altstep, then no problem is reported. If the '''recursionInCheckNoOverSpecificRunsOnClauses''' setting is enabled (which it is by default), also the functions and altsteps referenced within the body of the current construct will be inspected. This is due to the fact that often wrapper functions are used that do not make direct use of the component element definitions themselves. 
     
    105105 
    106106[[Include(source:trunk/t3q-examples/checkNoOverSpecificRunsOn/checkNoOverSpecificRunsOn.ttcn3, text/x-rst)]] 
     107 
     108As of v2.0.0b26 an additional setting '''extendsInCheckNoOverSpecificRunsOnClauses''' is provided to enable the consideration of definitions recursively inherited from extended components as well (disabled by default). If this setting is enabled, a function or an altstep specified to run on a given component will only raise a warning if none of the definitions within the component itself ''as well as'' all the components that this component extends (and the components extended by those components recursively) are used within the function or altstep. For example: 
     109 
     110{{{ 
     111    //base component 
     112    type component componentWithDefinition { 
     113        timer definedTimer; 
     114    } 
     115 
     116 
     117    //alias     / extension 
     118    type component directAlias extends componentWithDefinition { 
     119         
     120    } 
     121 
     122    //multi alias /extension 
     123    type component multiAlias extends directAlias { 
     124         
     125    } 
     126 
     127    //always good - base component 
     128    function someFunctionOnBaseComponent () 
     129    runs on componentWithDefinition { 
     130        definedTimer.start ( 10.0 ); 
     131    } 
     132 
     133 
     134    //good - via direct alias (with extendsInCheckNoOverSpecificRunsOnClauses) 
     135    //bad - no definition from directAlias used (without extendsInCheckNoOverSpecificRunsOnClauses) 
     136    function someFunctionOnMultiAlias () 
     137    runs on directAlias { 
     138        definedTimer.start ( 10.0 ); 
     139    } 
     140 
     141 
     142    //good - via multi alias (with extendsInCheckNoOverSpecificRunsOnClauses) 
     143    //bad - no definition from multiAlias used (without extendsInCheckNoOverSpecificRunsOnClauses) 
     144    function someFunctionOnMultiAlias () 
     145    runs on multiAlias { 
     146        definedTimer.start ( 10.0 ); 
     147    } 
     148}}} 
    107149 
    108150==== There Must Be No Unused Imports ====