SQL Queries - CAST Management Base - How to check for overlapping user-defined source folders by technology

Purpose of Query

This query when ran on the CAST management base will provide the list of user-defined source folders for a given technology, ordered by file types in alphabetical order

You just have to compare the folders and see if there are some overlap on the others.

Please note that this query will have empty results if no source include folder were manually configured by the user.
In this case you should compare the rootpath of the analysis units using the following query instead : SQL Queries - CAST Management Base - How to check for overlapping analysis units by technology

A pre-requisite is to identify the table you will use, depending on the technology :

In management base, for each technology you have one table containing the analysis units.

Their names are CMS_<TECHNO>_ANALYSIS.

For instance, for Java you have table CMS_J2EE_ANALYSIS.

For .Net you have CMS_NET_ANALYSIS.

For C++ you have CMS_CPP_ANALYSIS.

Applicable CAST Version
Applicable RDBMS
Query for CSS, Oracle, and SQL server
How to check for overlapping source folders (here it is JAVA case)
SELECT cja.object_name AS AnalysisUnitName, 
       CO.symbol      AS CustomIncludePath 
FROM   cms_objectlinks CO 
       JOIN cms_code_sourcefolder CCS 
         ON CCS.object_id = CO.callee_id 
       JOIN cms_j2ee_analysis cja 
         ON cja.object_id = CO.caller_id 
ORDER  BY CO.symbol, 
Query result example













Query result interpretation
  • Category "clientFiles" : you see that the two source folders are overlapping, since "S:\Sources\MyApp\Analyzed\DSS\MF_code\app\js" is incuded in "S:\Sources\MyApp\Analyzed\DSS\MF_code\app" 
  • Category "javaFiles" : no overlap
  • Category "propertyFiles" : you see that "main1", main2" and "main3" are overlapping, since they are pointing to the same folder : "S:\Sources\MyApp\Analyzed\SL\sl_core\main"
  • Category "xmlFiles" : you see that two folders are overlapping since they are pointing to the same folder : "S:\Sources\MyApp\Analyzed\XXXX\XXXXWebApp"