SQL Queries - CAST Knowledge Base - Queries on metrics and diagnostics - How to determine the remote calls for an object
Purpose of Query
This page provides a query to run on the CAST knowledge base which provides the remote calls for an object.
An example is for violated object for the metric **’**Avoid direct or indirect remote calls inside a loop’
Applicable CAST Version
| Release | Yes/No |
|---|---|
| 8.3.x | ✅ |
| 8.2.x | ✅ |
Applicable RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ❓ |
| Microsoft SQL Server | ❓ |
| CSS3 | ✅ |
| CSS2 | ✅ |
Query for CSS
Run the following query on the Knowledge Base
SELECT
CASE ikdep.ord
WHEN 1
THEN ofnclr.fullname
END AS "Violating object Full name ",
ikdep.ord AS "call depth" ,
ofnclr.fullname AS "caller Full name" ,
ofncle.fullname AS "Callee Full name"
FROM InKB_DIA_ExpensivePath ikdep
JOIN Acc a
ON a.IdAcc = ikdep.IdAcc
JOIN ObjFulNam ofnclr
ON ofnclr.IdObj = a.Idclr
JOIN ObjFulNam ofncle
ON ofncle.IdObj = a.Idcle
WHERE ikdep.IdTyp = 1
ORDER BY ikdep.idpath,
ikdep.ord
Query result example
| Violating object full name | call depth | caller full name | callee name |
| au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.tripJourneyAction | 1 | au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.tripJourneyAction | au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.createTripJourney |
| 2 | au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.createTripJourney | au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.getNextVal | |
| 3 | au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.getNextVal | org.hibernate.Query.list |
Query result interpretation
The query will provide the violating object name, the call depth, the caller full name and the callee name related to the violation.
Query for Oracle
Enter the SQL query
Query result example
Query result interpretation
Query for SQL server
Enter the SQL query
Query result example
Query result interpretation
Notes/comments
Related Pages