Enlighten - Information - How to identify cyclical calls when Escalated links are activated

Purpose

Situation

Case 1: Dot Net: Dashboard shows violations for the rule Avoid cyclical calls and inheritances between namespaces content. Need to understand the details of cyclic calls in Enlighten.

Case 2: J2EE: Dashboard shows violations for the rule Avoid cyclical calls and inheritances between packages content. Need to understand the details of cyclic calls in Enlighten

Expectation

Identify cyclical calls in Enlighten

Figure 1

 Figure 2

Applicable in CAST Version
Release
Yes/No
8.3.x (tick) 
8.2.x (tick) 
8.1.x (tick) 
8.0.x (tick) 
7.3.x(tick)
7.2.x(tick)
7.0.x(tick)
Observed on RDBMS
RDBMS
Yes/No
Oracle Server (tick)
Microsoft SQL Server (tick)
CSS2 (tick)
Details

 Steps

  1. Launch Enlighten and select corresponding LOCAL base
  2. Launch dashboard from CAST MS and navigate to Investigation View. Please click on the violating rule "Avoid cyclical calls and inheritances between namespaces content" (Hightlighted and marked as 1 in below image)
  3. In the "OBJECTS WITH VIOLATION" section,List of objects violating the rule will be displayed. We need to identify which of these objects are involved in cyclical calls. 
  4. Click on the first object name (Highlighted and marked as 2 in below image)
  5. In the "OBJECT DETAILS" tab, Right Click on the displayed object name and open it in new tab (Highlighted and marked as 3 in below image)  

    (Note: In higher version, Right click on technical context)

                                        

  6. The object's URL will display object # (Highlighted and marked as 4 in below image), which is OBJECTID. To identify the next object in cyclical call, we need to run few queries on central database. So launch respective query browser 
    1. We need to identify SNAPSHOT ID and METRIC ID, which is required to identify the next object in cyclical call
      1. To identify METRICID, run this query

        select metric_id from dss_metric_types where metric_name = 'Avoid cyclical calls and inheritances between namespaces content'     

        Note: For java Metric is :'Avoid cyclical calls and inheritances between packages content'

      2. To identify SNAPSHOTID, run this query

        select snapshot_id from dss_metric_results where object_id = OBJECTID and metric_id = (METRICID+1).

        Choose the SNAPSHOTID from the displayed list

    2. After collecting OBJECTID, METRICID, SNAPSHOTID, run this query

      Select dos1.object_id as cur_namespace_id, dos1.object_full_name as cur_namespace_name, dos2.object_id as next_namespace_id, dos2.object_full_name as next_namespace_name from dss_metric_results dmr join dss_objects dos1 on dos1.object_id = dmr.object_id join  dss_objects dos2 on dos2.object_id = dmr.metric_object_id where dmr.metric_id = (METRICID+1)and dmr.object_id = (OBJECTID)and dmr.snapshot_id = (SNAPSHOTID).

    3. Above query will output cur_namespace_id,cur_namespace_name, next_namespace_id and next_namespace_name. Please note down the result values
    4. In Enlighten, from the Object Browser, select the project, right click and open "Find object in Browser"
    5. Search for the value of cur_namespace_name. It will be displayed in Result section. Add it to Enlighten View
    6. Search for the value of next_namespace_name. It will be displayed in Result section. Add it to Enlighten View. An escalated link will be formed between the two objects
    7. To search for the next object in cyclical call, we have next OBJECTID, which is the value of next_namespace_id. Use the value as OBJECTID in (b) query and repeat (c),(d),(e) and (f) until a cyclical link is formed (refer image in Expectation Section)

Figure 3

 

Alternate & Quick Solution

  1. Launch Dashboard
  2. Go to Investigation - Application Drilldown view
  3. Select the target application from LHS
  4. Select "BY VIOLATION" tab on RHS
  5. in the "BY VIOLATION" tab, Sort the list by "Rule Name"
  6. From the sorted list, navigate to the section having rule "Avoid cyclical calls and inheritances between namespaces content"

    For java, metric is : "Avoid cyclical calls and inheritances between packages content"

  7. From this subset of list,Take the first Object Name violating the rule. Search it in Enlighten and add in its view
  8. Now Select the object name (that you added in enlighten view) from the subset list . This will display "Violation Details" at the bottom of the page
  9. In the "Violation Details" section, there is a sub section "Cyclically called / inherited Package full name"
  10. The object name displayed under this sub section is the next object in the cyclical call, violating the rule
  11. Search for this object name in Enlighten and add it in view
  12. Repeat Steps 8 - 11 until you see an escalated link between objects in Enlighten that form a cyclical call

 

Additional Tips for Finding the Cycle in Cases of .NET Namespaces

  • .NET Namespaces can have sub-namespaces that can be involved in a cycle.
    • If there are interconnections between the namespaces then sub-namespaces may have a cycle with other namespaces that are still part of the parent so that the queries above may indicate a cycle between the parent and a sub-namespace.
    • For example, in the screenshot below the queries above indicated a cylcle between the Parent A and the Child 1. The screenshot does show a cycle between these as Child 2 (which is part of Parent A) calls Child 1, and Child 1 calls Child 3 (which is part of Parent A as well):
  • .NET Namespaces can also have there only procedures that are also involved with sub-namespaces in a cylce
    • For exmaple, in the screenshot below the queries above indicated a cycle between Parent A and Child 1. The screenshot below shows a cycle between these as Proc 1 (which is part of Parent A) calls Child 1, and Child 1 calls Child 2 (which is part of Parent A as well):

 

Notes

 

Related Pages