Purpose (problem description)
This page helps to understand the violations related to the quality rules "Avoid cyclical calls and inheritances between namespaces content" and "Avoid cyclical calls and inheritances between packages". 
Observed in CAST AIP


Release
Yes/No
8.3.x (tick) 
Observed on RDBMS


RDBMS
Yes/No
CSS (tick) 
Step by Step scenario
  1. Run analysis and compute snapshot
  2. View violation from Dashboard
Action Plan

Perform the below actions

  1. Install MAINT_DIAG_CYCLES_DETAILS .sql on KB
  2. 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)
  3. 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)
  4. 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 example

    39510

  5. 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 example

    39468; 39510; 3

  6. 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_idcalled_idlev
    39510393910
    39391392251
    39225394682
    39468395103
  7. 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_idcalled_idrelationcount
    39510393915
    39391392252
    39225394681
    394683951037
  8. 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 
  9. From Enlighten put all packages and involved objects in a view (respect the order of caller/called relationship)

  10. 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                                                                                                                                                     
  11. There are several cyclical calls including "com.bretpatterson.schemagen.graphql" .  Also we can see one with "com.bretpatterson.schemagen.graphql.typemappers":
    1. "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"
       
    2. "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"
  12. If the above steps do not solve your issue contact CAST Technical Support. with the following Relevant input

 

Notes/comments

Ticket #,34372, 35669

Related Pages