Along with your Adelia quality manager expansion plugin, you can provide a program used to compute the metrics and verify the rules described by this plugin. This program must be a Visual Adelia Batch or Adelia Server program implementing a certain number of predefined entry points in the form of public procedures (subsequently referred to as "expansion points") that conform to the interface described below.
Expansion point implementation is optional: the expansion program is valid if it implements at least one expansion point.
The analysis program loads the program into memory at the start of the analysis process, then calls the "BEGIN" expansion point to enable the programmer to initialize the work context. The analysis program then iteratively calls the appropriate expansion points for each program analyzed. At the end of the analysis, the "END" expansion point is called and the expansion program is unloaded from memory.
The expansion program communicates with the CASE tool via the QualMgrToolBx DLL functions to access the configuration data (rule activation and parameters), execution data (current values of certain metrics) and to save its own metrics and violations.
The different expansion points are as follows:
Note: In the KLBADEL example environment, you can find an example expansion program in the TOOLS application area.
VERSION expansion point
This expansion point is called by the analysis program when loading a plugin, if a DLL version number is specified in the plugin description file. In this case, the entry point must exist and the version returned by this expansion point must match that specified by the plugin.
Parameters
Name |
Type |
I/O |
Description |
Dllversion |
NUM_BIN_4 |
O |
DLL version. |
BEGIN expansion point
This expansion point is called by the analysis program during project analysis initialization. The programmer can perform general initializations at this point.
Parameters
Name |
Type |
I/O |
Description |
EnvName |
ALPHA(128) |
I |
Name of the environment. |
ProjectName |
ALPHA(128) |
I |
Project name. |
GenMode |
ALPHA(6) |
I |
Analysis mode (full, delta or none). |
creatObj |
BOOL |
I |
Compilation job creation. |
sonar |
BOOL |
I |
SONAR type analysis. |
BEGIN_PGM expansion point
This expansion point is called by the analysis program during program analysis initialization. The programmer can initialize specific data at this point.
Parameters
Name |
Type. |
I/O |
Description |
ProgramName |
ALPHA(15) |
I |
Name of the program. |
ProgramType |
ALPHA(4) |
I |
Program type. |
DECLARATION expansion point
This expansion point is called by the analysis program when analyzing an object declaration.
Parameters
Name |
Type |
I/O |
Description |
||||||||||||||||||||||||||||||||
ProgramName |
ALPHA(15) |
I |
Name of the program. |
||||||||||||||||||||||||||||||||
ProgramType |
ALPHA(4) |
I |
Program type. |
||||||||||||||||||||||||||||||||
ExpLineNo |
NUM_BIN_4 |
I |
Line number in the expanded source, or zero. |
||||||||||||||||||||||||||||||||
LineNo |
NUM_BIN_4 |
I |
Line number in the program source code, or zero. |
||||||||||||||||||||||||||||||||
RuleName |
ALPHA(15) |
I |
Name of the management rule, or blank. |
||||||||||||||||||||||||||||||||
MruLineNo |
NUM_BIN_4 |
I |
Line number in the management rule, or zero. |
||||||||||||||||||||||||||||||||
ItemName |
ALPHA(128) |
I |
Name of the item in the data environment. |
||||||||||||||||||||||||||||||||
ItemType |
ALPHA(15) |
I |
Item type (VAR, OBJ, PROC, etc.)
|
||||||||||||||||||||||||||||||||
AdeliaType |
ALPHA(2) |
I |
Adelia type
|
||||||||||||||||||||||||||||||||
length |
NUM_BIN_4 |
I |
Length. |
||||||||||||||||||||||||||||||||
nbDecimals |
NUM_BIN_2 |
I |
Decimals. |
||||||||||||||||||||||||||||||||
dim1 |
NUM_BIN_2 |
I |
Dimension 1 if array, or zero. |
||||||||||||||||||||||||||||||||
dim2 |
NUM_BIN_2 |
I |
Dimension 2 if array, or zero. |
||||||||||||||||||||||||||||||||
ObjectName |
ALPHA(15) |
I |
Name of the graphical object. |
||||||||||||||||||||||||||||||||
parameter |
BOOL |
I |
Program or procedure parameter. |
||||||||||||||||||||||||||||||||
DSField |
BOOL |
I |
DS field. |
||||||||||||||||||||||||||||||||
ListField |
BOOL |
I |
List field. |
||||||||||||||||||||||||||||||||
local |
BOOL |
I |
Local visibility. |
||||||||||||||||||||||||||||||||
AdditionalInfo |
ALPHA(50) |
I |
Additional information according to context:
PROCEDURE context: Positions 1 to 15
Positions 16 to 25
BREAK context: Positions 1 to 15
|
SOURCE expansion point
This expansion point is called by the analysis program at the end of program analysis.
The programmer can, for example, save the total program metrics here.
Parameters
Nom |
Type. |
I/O |
Description |
ProgramName |
ALPHA(15) |
I |
Name of the program. |
ProgramType |
ALPHA(4) |
I |
Program type. |
ExpLineNo |
NUM_BIN_4 |
I |
Line number in the expanded source, or zero. |
LineNo |
NUM_BIN_4 |
I |
Line number in the program source code, or zero. |
RuleName |
ALPHA(15) |
I |
Name of the management rule, or blank. |
MruLineNo |
NUM_BIN_4 |
I |
Line number in the management rule, or zero. |
server |
ALPHA(15) |
I |
Logical server name. |
source |
ALPHA(5000) |
I |
Line source. |
END_PGM expansion point
This expansion point is called by the analysis program at the end of program analysis.
The programmer can, for example, save the total program metrics here.
Parameters
Name |
Type |
I/O |
Description |
ProgramName |
ALPHA(15) |
I |
Name of the program. |
ProgramType |
ALPHA(4) |
I |
Program type. |
FileName |
ALPHA(250) |
I |
Name of the XML file containing the program source code. |
VerifSuccess |
BOOL |
I |
Program verification was successful. |
END expansion point
Called by the analysis program at the end of project analysis.
The program computes the project-related metrics.
The functions QMQueryFirstProgram and QMQueryNextProgram of the QualToolBxMgr DLL are used to scroll through the programs to be included in total metrics.
Important note: As the analysis can be performed by delta, some programs may not have been processed during previous phases. Use the list of programs included in project analysis, not a total value calculated progressively.
Parameters
None.