SQL Queries - CAST Knowledge Base - Queries on objects - How to retrieve information about objects involved in the strongly connected component

Purpose

This page provides some important information on objects involved in the strongly connected component. For each object involved in the SCC, it give us the number of caller or called objects inside the SCC (direct and indirect called/caller), object type, object full name, and object language.

Applicable in CAST Version

ReleaseYes/No
8.3.x
8.2.x

Applicable RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS

Query for CSS

To use this the save of SCC group should be available: 

delete from SYS_SITE_OPTIONS where OPTION_NAME = 'GRAPH_SAVE_LARGEST_SCC_GROUP';
Insert into SYS_SITE_OPTIONS(OPTION_NAME, OPTION_VALUE) values ('GRAPH_SAVE_LARGEST_SCC_GROUP', '1');

After saving the SCC group, compute function point from TCC then get the information using the following query:

  SELECT *
FROM   (SELECT 'FAN-OUT MORE'       ,
               S.object_id OBJECT_ID,
               A.count_
       FROM    fp_largestscc S
               JOIN
                       (SELECT  A.caller_id                 OBJECT_ID,
                                COUNT(DISTINCT A.called_id) COUNT_
                       FROM     ctv_links A
                       WHERE    A.called_id IN
                                                (SELECT DISTINCT S.object_id
                                                FROM             fp_largestscc S
                                                )
                       GROUP BY A.caller_id
                       )
                       A
               ON      S.object_id = A.object_id
       
       UNION ALL
       
       SELECT   'FAN-IN MORE',
                S.object_id  ,
                A.count_
       FROM     fp_largestscc S
                JOIN
                         (SELECT  A.called_id                 OBJECT_ID,
                                  COUNT(DISTINCT A.caller_id) COUNT_
                         FROM     ctv_links A
                         WHERE    A.caller_id IN
                                                  (SELECT DISTINCT S.object_id
                                                  FROM             fp_largestscc S
                                                  )
                         GROUP BY A.called_id
                         )
                         A
                ON       S.object_id = A.object_id
       ORDER BY 3 DESC
       )
       F
       JOIN cdt_objects O
       ON     F.object_id = O.object_id

Following is an example of the result (this is just one line of the result)

Query result example

“FAN-IN MORE”;216150;1799;216150;“name”;“fullname”;“C# Method”;“fullname”;" public";“C#”

Query result interpretation

The public C# method of full name “fullname” and id 216150 is involved in the SCC, this object is called by 1799 objects.

If the first column returns FAN-OUT MORE then the interpretation will be The public C# method of full name “fullname” and id 216150 is involved in the SCC, this object call 1799 objects.

Query for Oracle

Same as CSS

Query result example

Query result interpretation

Query for SQL server

Same as CSS

Query result example

Query result interpretation

Notes/comments

Related Pages