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  (tick)
8.2.x  (tick)
Applicable RDBMS


RDBMS
Yes/No
Oracle Server (question)
Microsoft SQL Server (question)
CSS3 (tick)
CSS2 (tick)


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 namecall depthcaller full namecallee name
au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.tripJourneyAction1au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.tripJourneyActionau.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.createTripJourney

2au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.createTripJourneyau.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.getNextVal

3au.gov.nsw.railcorp.nabs.dao.billingmgmt.BillingMgmtDAOImpl.getNextValorg.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