Release | Yes/No |
---|---|
8.3.x |
RDBMS | Yes/No |
---|---|
CSS |
- Run analysis and compute snapshot
- View violation from Dashboard
Perform the below actions
- Install MAINT_DIAG_CYCLES_DETAILS .sql on KB
If the you are investigating the quality rule "Avoid cyclical calls and inheritances between namespaces content" then run the following on KB
select MAINT_DIAG_CYCLES_DETAILS (7294)
Else if you are investigating the quality rule "Avoid cyclical calls and inheritances between packages" the run the following on KB
select MAINT_DIAG_CYCLES_DETAILS (7292)
Get the id where the cyclical packaged begin:
select metric_object_id from dss_metric_results where metric_id = <Metric_id > + 1 -- if "Avoid cyclical calls and inheritances between namespaces content" then 7294 else 7292 and object_id = <The id of object in violation>
Query result example39510
- Get the highest level call as follow:
select caller_id, called_id, lev from TMP_DIA_LEVELS tdl where tdl.initial_id = called_id and called_id = 39510
Query result example39468; 39510; 3
Run the same query as before after replacing "called_id" by the "caller_id" returned from previous query until the level is equal to 0 (PS: if the query retirns more than one row then choose the row with the lowest level), example:
select * from TMP_DIA_LEVELS tdl where tdl.initial_id = 39510 and called_id = 39468 -- 39510 39225 39468 2 select * from TMP_DIA_LEVELS tdl where tdl.initial_id = 39510 and called_id = 39225 -- 39510 39391 39225 1 select * from TMP_DIA_LEVELS tdl where tdl.initial_id = 39510 and called_id = 39391 -- 39510 39510 39391 0 -- 39510 39225 39391 2 -- 39510 39468 39391 3
In this example the list of the involved packages will be as follow:
caller_id called_id lev 39510 39391 0 39391 39225 1 39225 39468 2 39468 39510 3 To get an idea about the volume of objects involved in the cyclical call, for each couple the number of objects in relationship is provided with the following query, where (<caller_id_i>, <called_id_i>) are the ids retreived from previous queries:
select * from TMP_Arcs where (caller_id, called_id) in ((<caller_id_1>, <called_id_1>),...., <caller_id_n>, <called_id_n>)
Query example:
select * from TMP_Arcs where (caller_id, called_id) in ((39510, 39391), (39391, 39225), (39225, 39468), (39468, 39510))
Query result example:
caller_id called_id relationcount 39510 39391 5 39391 39225 2 39225 39468 1 39468 39510 37 The detailed list is as follow:
select * from TMP_ArcsDetails tad where (tad.referencingPackageId, tad.referencedPackageId) in ((<caller_id_1>, <called_id_1>),...., <caller_id_n>, <called_id_n>) order by tad.referencingPackageId
Query example:
select * from TMP_ArcsDetails tad where (caller_id, called_id) in ((39510, 39391), (39391, 39225), (39225, 39468), (39468, 39510)) order by tad.referencingPackageId
From Enlighten put all packages and involved objects in a view (respect the order of caller/called relationship)
- Add belong links of objects that are the top callers between objects until linking those objects with the packages. As an example you will get a view as follows
- There are several cyclical calls including "com.bretpatterson.schemagen.graphql" . Also we can see one with "com.bretpatterson.schemagen.graphql.typemappers":
- "com.bretpatterson.schemagen.graphql.typemappers.IGraphQLTypeMapper" belongs to "com.bretpatterson.schemagen.graphql" and it is called by "com.bretpatterson.schemagen.graphql.typemappers.IGraphQLTypeMapper.getOutputType" which belongs tp "com.bretpatterson.schemagen.graphql.typemappers"
- "com.bretpatterson.schemagen.graphql.typemappers.IGraphQLTypeMapper" belongs to "com.bretpatterson.schemagen.graphql.typemappers" and it's called by com.bretpatterson.schemagen.graphql.GraphQLSpringSchemaBuilder.getDefaultTypeMappers which belongs to "com.bretpatterson.schemagen.graphql"
- "com.bretpatterson.schemagen.graphql.typemappers.IGraphQLTypeMapper" belongs to "com.bretpatterson.schemagen.graphql" and it is called by "com.bretpatterson.schemagen.graphql.typemappers.IGraphQLTypeMapper.getOutputType" which belongs tp "com.bretpatterson.schemagen.graphql.typemappers"
- If the above steps do not solve your issue contact CAST Technical Support. with the following Relevant input
Ticket #,34372, 35669