Calculate the Number of per module in the Knowledge BasePLEASE NOTE: THE QUERIES BELOW ARE ONLY VALID IN CAST AIP 8.3.36 AND BELOW. FOR CAST AIP 8.3.37 AND ABOVE YOU MUST MODIFY THE QUERIES AS FOLLOWS:
This section allows you to get the Value of th Number of for each module in the knowledge base the detail of this value by providing the list of objects used to cumpute this value - If the module is the result of an analysis job, the Number of is the number of the application's non-external objects with a type inheriting from the APM category.
- If the module is a User Defined module, the Number of is the number of the User Defined module's non-external objects with a type inheriting from the APM category.
For each module, proceed as follow: - Check whether the module is the result of an analysis job or a user defined module:
- For the module resulting from an analysis job, the module name will be followed by the Analyzer type such as 'Leben_C_Module-C++ Analyzer' and 'EAR_MAXNET_WEB_MAXNET-J2EE Analyzer'
- For the user defined module, the module name will not be followed by the Analyzer type as it can be based on the results of many analyses.
- If the module is the result of an analysis job:
- Get the Application's Id associated with the analysis job (module on the central) using following query: Select * From <KB_name>.CSV_ANALYSIS_APPLICATIONS where APPLICATION_NAME like <MODULE_NAME>
- Get the application's non-external objects list: Select * from <KB_name>.CTT_OBJECT_APPLICATIONS where APPLICATION_ID=< Application's Id > and PROPERTIES=0
- Get vaue of the Number 0f and list of objects used to compute the Number of
- Query for Number of Comments:
To get the number of comment lines of an application's non-external objects, run following query: Select sum(INFVAL) From <KB>.OBJINF where IDOBJ in (select (OBJECT_ID) from <KB>.CTT_OBJECT_APPLICATIONS where APPLICATION_ID=<APPLICATION_ID> and PROPERTIES=0) and INFTYP=2 and INFSUBTYP=0 - Query for Number of Commented-out code lines:
To get the number of commented-out lines of an application's non-external objects, run following query: Select sum(INFVAL) From <KB>.OBJINF where IDOBJ in (select (OBJECT_ID) from <KB>.CTT_OBJECT_APPLICATIONS where APPLICATION_ID=<APPLICATION_ID>and PROPERTIES=0) and INFTYP=9 and INFSUBTYP=1509 - Query for Number of Comment lines - Other: Number of comment lines-Other of an application's non-external objects = Number of comment lines of an application's non-external objects minus the Number of commented-out lines of an application's non-external objects
- Query for other Number Of (Number of tables, classes, methods....)
- Get the CATEGORY_NAME value, used in the below queries, by searching it in the asssesment model- take the category mentioned in the Detail SQL procedure of the diag(For instance, CATEGORY_NAME = 'DataBase Table' for Number of Tables).
- Count the Number of the objects with a type inheriting from the identified category: Select count(K1.IDKEY) From KEYS K1, KEYS K2 where K1.IDKEY in (select (OBJECT_ID) from CTT_OBJECT_APPLICATIONS where APPLICATION_ID==<Appliction_ID> and PROPERTIES=0) and K1.IDKEY=K2.IDKEY and K2.OBJTYP in (select distinct t.IdTyp from Typ t, TypCat tc where t.IdTyp = tc.IdTyp and tc.IdCatParent in (select Cat.IdCat from Cat where CatNam like '<CATEGORY_NAME>'))
- Get list of the objects with a type inheriting from the category under investigation: Select K1.* From KEYS K1, KEYS K2 where K1.IDKEY in (select (OBJECT_ID) from CTT_OBJECT_APPLICATIONS where APPLICATION_ID=<Appliction_ID> and PROPERTIES=0) and K1.IDKEY=K2.IDKEY and K2.OBJTYP in (select distinct t.IdTyp from Typ t, TypCat tc where t.IdTyp = tc.IdTyp and tc.IdCatParent in (select Cat.IdCat from Cat where CatNam like '<CATEGORY_NAME>'))
- If the module is a User Defined module:
- Get the User Defined module's objects list: SELECT UDM.KeyNam, (SELECT ofn.IDOBJ FROM <KB>.ObjFulNam ofn WHERE ofn.IdObj=UDMi.IdKey), ( SELECT ots.ObjTypStr FROM <KB>.ObjTypStr ots WHERE ots.ObjTyp=UDMi.ObjTyp) FROM <KB>.APPSET s, <KB>.Keys UDM, <KB>.AnaJob j, <KB>.SETROOT r, <KB>.OBJSET o, <KB>.Keys UDMi WHERE s.IDSET = UDM.IdKey AND s.IDJOB = j.IdJob AND j.JobTyp = 3001 AND UDM.ObjTyp = 20000 AND UDM.IdKey = r.IDSET AND o.IDSET = r.IDROOT AND o.IDOBJ != r.IDROOT AND o.IDOBJ = UDMi.IdKey AND UDM.KeyNam='<UDM_NAME>'
- Get the User Defined module's non-external objects list: SELECT UDM.KeyNam,(SELECT ofn.IDOBJ FROM <KB>.ObjFulNam ofn, WHERE ofn.IdObj=UDMi.IdKey),(SELECT ots.ObjTypStr FROM <KB>.ObjTypStr ots WHERE ots.ObjTyp=UDMi.ObjTyp) FROM <KB>.APPSET s, <KB>.Keys UDM, <KB>.AnaJob j, <KB>.SETROOT r, <KB>.OBJSET o, <KB>.Keys UDMi, <KB>.CTT_OBJECT_APPLICATIONS c WHERE s.IDSET = UDM.IdKey AND s.IDJOB = j.IdJob AND j.JobTyp = 3001 AND UDM.ObjTyp = 20000 AND UDM.IdKey = r.IDSET AND o.IDSET = r.IDROOT AND o.IDOBJ != r.IDROOT AND o.IDOBJ = UDMi.IdKey AND UDM.KeyNam='<UDM_NAME>' AND UDMi.IdKey= c.OBJECT_ID and c.PROPERTIES=0
- Get Number of
- Query for Number of Comments Select sum (INFVAL) From <KB>.OBJINF where IDOBJ in (SELECT (SELECT ofn.IDOBJ FROM <KB>.ObjFulNam ofn, WHERE ofn.IdObj=UDMi.IdKey) FROM <KB>.APPSET s, <KB>.Keys UDM, <KB>.AnaJob j, <KB>.SETROOT r, <KB>.OBJSET o, <KB>.Keys UDMi, <KB>.CTT_OBJECT_APPLICATIONS c WHERE s.IDSET = UDM.IdKey AND s.IDJOB = j.IdJob AND j.JobTyp = 3001 AND UDM.ObjTyp = 20000 AND UDM.IdKey = r.IDSET AND o.IDSET = r.IDROOT AND o.IDOBJ != r.IDROOT AND o.IDOBJ = UDMi.IdKey AND UDM.KeyNam='<UDM_NAME>' AND UDMi.IdKey= c.OBJECT_ID and c.PROPERTIES=0 and INFTYP=2 and INFSUBTYP=0
- Query for Number of Commented-out code lines Select sum(INFVAL) From <KB>.OBJINF where IDOBJ in (SELECT (SELECT ofn.IDOBJ FROM <KB>.ObjFulNam ofn, WHERE ofn.IdObj=UDMi.IdKey) FROM <KB>.APPSET s, <KB>.Keys UDM, <KB>.AnaJob j, <KB>.SETROOT r, <KB>.OBJSET o, <KB>.Keys UDMi, <KB>.CTT_OBJECT_APPLICATIONS c WHERE s.IDSET = UDM.IdKey AND s.IDJOB = j.IdJob AND j.JobTyp = 3001 AND UDM.ObjTyp = 20000 AND UDM.IdKey = r.IDSET AND o.IDSET = r.IDROOT AND o.IDOBJ != r.IDROOT AND o.IDOBJ = UDMi.IdKey AND UDM.KeyNam='<UDM_NAME>' AND UDMi.IdKey= c.OBJECT_ID and c.PROPERTIES=0) and INFTYP=9 and INFSUBTYP=1509
- Query for Number of Comment lines - Other Number of comment lines-Other of an application's non-external objects = Number of comment lines of an application's non-external objects minus Number of commented-out lines of an application's non-external objects
- Query for other Number Of:
Get the CATEGORY_NAME value, used in the below queries, by searching it in the metric category names and Ids page (For instance, CATEGORY_NAME = 'DataBase Table' for Number of Tables).- Count the Number of objects( non external objects of the User defined module) with a type inheriting from the identified category SELECT count(UDM.KeyNam) FROM APPSET s, Keys UDM, AnaJob j, SETROOT r, OBJSET o, Keys UDMi WHERE s.IDSET = UDM.IdKey AND s.IDJOB = j.IdJob AND j.JobTyp = 3001 AND UDM.ObjTyp = 20000 AND UDM.IdKey = r.IDSET AND o.IDSET = r.IDROOT AND o.IDOBJ != r.IDROOT AND o.IDOBJ = UDMi.IdKey AND UDM.KeyNam='<UDM_NAME>' and UDMi.ObjTyp in (select distinct t.IdTyp from Typ t, TypCat tc where t.IdTyp = tc.IdTyp and tc.IdCatParent in (select Cat.IdCat from Cat where CatNam like 'CATEGORY_NAME'))
The Number of at the module is the result of the above query - Get the list of the objects with a type inheriting from the identified category, using the following query: SELECT UDM.KeyNam, (SELECT ofn.IDOBJ FROM <KB>.ObjFulNam ofn, WHERE ofn.IdObj=UDMi.IdKey), (SELECT ots.ObjTypStr FROM <KB>.ObjTypStr ots WHERE ots.ObjTyp=UDMi.ObjTyp) FROM <KB>.APPSET s, <KB>.Keys UDM, <KB>.AnaJob j, <KB_name>.SETROOT r, <KB>.OBJSET o, <KB_name>.Keys UDMi, <KB>.CTT_OBJECT_APPLICATIONS c WHERE s.IDSET = UDM.IdKey AND s.IDJOB = j.IdJob AND j.JobTyp = 3001 AND UDM.ObjTyp = 20000 AND UDM.IdKey = r.IDSET AND o.IDSET = r.IDROOT AND o.IDOBJ != r.IDROOT AND o.IDOBJ = UDMi.IdKey AND UDM.KeyNam='<UDM_NAME>' AND UDMi.IdKey= c.OBJECT_ID and c.PROPERTIES=0 and UDMi. OBJTYP in (select distinct t.IdTyp from Typ t, TypCat tc where t.IdTyp = tc.IdTyp and tc.IdCatParent in (select Cat.IdCat from Cat where CatNam like '<CATEGORY_NAME>')))
|