Problem Description

This guide was originally designed for the CAST Engineering Dashboard which is now a legacy feature of CAST.  This information can be useful in investigating issues with the current Engineering Dashboard in regards to technical size as well.

Documentation on the legacy compare version feature can be found here:  Compare Versions

This guide provides help for issues related to the following technical size issues:

  1. The Number of Code line and the variation are not as expected
  2. The Number of artifacts and the variation are not as expected
  3. The Number of processed, added, updated and or deleted artifacts is not as expected

When comparing 2 snapshots: Snapshot m and Snapshot n (Snapshot m has been computed before the Snapshot n) and the number of added/updated/deleted artifacts, make sure you consider all additions/updates/deletions of artifacts in snapshots between m and n. For example, if between snapshots m and n, we have 3 snapshots: n+1, n+2, n+3 and if an artifact is added in snapshot n+1, updated in snapshot n+2 and deleted in snapshot n+3:

  • The addition will be counted in added artifacts when comparing Snapshot m and Snapshot n
  • The updated will be counted in updated artifacts when comparing Snapshot m and Snapshot n
  • The deletion will be counted in deleted artifacts when comparing Snapshot m and Snapshot n

We counted these additions, updates and deletions because of resulting costs. The addition/update/deletion of an artifact generates cost even it doesn't appear in snapshot n nor in snapshot m.

The aim of this guide is to identify the artifacts counted as added/Updated/deleted and identify the snapshot where the action has of addition/update/deletion has been performed.

The total number of artifacts and number of code lines take into account only data snapshots m and n. We don't consider the other snapshots (computed between m and n) to compute these values.


Example of reported problem:  

If the variation of the number of artifacts is + 10 artifacts, the number of deleted artifacts is 35 and the number of added artifacts is 40. The customer says that these numbers are not coherent. You need to validate the variation of the number of artifacts (go to The Number of artifacts and the variation are not as expected) and the number of deleted and added artifacts (go to The Number of processed, added, updated and or deleted artifacts is not as expected) reported in the Snapshot Comparison page.


Applicable in CAST Version
Release
Yes/No
8.3.x(tick)


For the queries below, the following is needed:

snapshot_id

object_id

For the object_Id, please use the id of the application which can be obtained with the query on this page:  SQL Queries - CAST Central Base - Queries on applications - How to get the ID of the application

For the snapshot_id, please see the query on this page: SQL Queries - CAST Central Base - Queries on snapshots - How to get the ID and name of a snapshot for a given application

Number of code lines

Get the number of code lines computed on snapshot m using the following query:

Select distinct m1.METRIC_ID,m1.METRIC_NUM_VALUE
From <CB_NAME>.DSS_METRIC_RESULTS m1, <CB_NAME>.DSS_METRIC_TYPE_TREES t
Where m1.SNAPSHOT_ID = m
and t.METRIC_ID = 10151
And m1.METRIC_ID = t.METRIC_ID
And m1.METRIC_VALUE_INDEX = 1
And m1.OBJECT_ID = <OBJECT_ID>

Get the number of code lines computed on snapshot n using the following query:

Select distinct m1.METRIC_ID,m1.METRIC_NUM_VALUE
From <CB_NAME>.DSS_METRIC_RESULTS m1, <CB_NAME>.DSS_METRIC_TYPE_TREES t
Where m1.SNAPSHOT_ID = n
and t.METRIC_ID = 10151
And m1.METRIC_ID = t.METRIC_ID
And m1.METRIC_VALUE_INDEX = 1
And m1.OBJECT_ID = <OBJECT_ID>

The variation of the number of code lines = number of code lines computed on snapshot n minus the number of code lines computed on snapshot m. The percentage = ((number of code lines computed on snapshot n minus the number of code lines computed on snapshot m) divided by the number of code lines computed on snapshot n)*100.

Get the variation and the percentage using the following query:

Select distinct m1.METRIC_ID, 1,1,
m1.METRIC_NUM_VALUE,
m2.METRIC_NUM_VALUE-m1.METRIC_NUM_VALUE,
((m2.METRIC_NUM_VALUE-m1.METRIC_NUM_VALUE)/m1.METRIC_NUM_VALUE)*100.0,
m2.METRIC_NUM_VALUE
From <CB_NAME>.DSS_METRIC_RESULTS m1, <CB_NAME>.DSS_METRIC_RESULTS m2, <CB_NAME>.DSS_METRIC_TYPE_TREES t
Where m1.SNAPSHOT_ID = m
and t.METRIC_ID = 10151
And m1.METRIC_ID = t.METRIC_ID
And m1.METRIC_VALUE_INDEX = 1
And m1.OBJECT_ID = <OBJECT_ID>
And m2.SNAPSHOT_ID = n
And m2.METRIC_ID = m1.METRIC_ID
And m2.METRIC_VALUE_INDEX = 1
and m1.METRIC_NUM_VALUE != 0
And m2.OBJECT_ID = m1.OBJECT_ID

Number of artifacts

Get the number of artifacts computed on snapshot m using the following query

Select m1.METRIC_ID, m1.METRIC_NUM_VALUE
From <CB_NAME>.DSS_METRIC_RESULTS m1, <CB_NAME>.DSS_METRIC_TYPE_TREES t
Where m1.SNAPSHOT_ID = m
and t.METRIC_ID = 10152
And m1.METRIC_ID = t.METRIC_ID
And m1.METRIC_VALUE_INDEX = 1
And m1.OBJECT_ID = <OBJECT_ID>

Get the number of artifacts computed on snapshot n using the following query:

Select m1.METRIC_ID, m1.METRIC_NUM_VALUE
From <CB_NAME>.DSS_METRIC_RESULTS m1,<CB_NAME>.DSS_METRIC_TYPE_TREES t
Where m1.SNAPSHOT_ID = n
and t.METRIC_ID = 10152
And m1.METRIC_ID = t.METRIC_ID
And m1.METRIC_VALUE_INDEX = 1
And m1.OBJECT_ID = <OBJECT_ID>

The variation of the number of artifacts = number of Artifacts computed on snapshot n minus the number of artifacts computed on snapshot m. The percentage = ((number of artifacts computed on snapshot n minus the number of artifacts computed on snapshot m) divided by the number of artifacts computed on snapshot m)*100.

Get the variation and the percentage using the following query:

Select m2.METRIC_NUM_VALUE-m1.METRIC_NUM_VALUE, ((m2.METRIC_NUM_VALUE-m1.METRIC_NUM_VALUE)/m1.METRIC_NUM_VALUE)*100.0
From <CB_NAME>.DSS_METRIC_RESULTS m1, <CB_NAME>.DSS_METRIC_RESULTS m2, <CB_NAME>.DSS_METRIC_TYPE_TREES t
Where m1.SNAPSHOT_ID = m
and t.METRIC_ID = 10152
And m1.METRIC_ID = t.METRIC_ID
And m1.METRIC_VALUE_INDEX = 1
And m1.OBJECT_ID = <OBJECT_ID>
And m2.SNAPSHOT_ID = n
And m2.METRIC_ID = m1.METRIC_ID
And m2.METRIC_VALUE_INDEX = 1
and m1.METRIC_NUM_VALUE != 0
And m2.OBJECT_ID = m1.OBJECT_ID

Added artifacts

Number of added artifacts

Get the number of added artifacts using the following query:

select 'added', count(distinct cs1.OBJECT_ID)
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID = n
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 1

List of added artifacts

Get the list of added artifacts per snapshot using the following query:

select 'added', cs1.OBJECT_ID, cs1.SNAPSHOT_ID
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID = n
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 1

Count of added artifacts per complexity

The count of the detail of added artifacts = (number of added artifact with very high complexity divided by the number of added artifacts with high complexity divided by the number of added artifacts with moderate complexity divied by the number of added artifacts with low complexity) can be retrieved using the following query:

select 'added', cs1.CPLX_TYPE + 1, count(distinct cs1.OBJECT_ID)
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID = n
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 1
group by cs1.CPLX_TYPE order by 2

List of added artifacts per complexity

The list of detailed added artifacts per complexity and per snapshot can be retrieved using the following query:

select cs1.CPLX_TYPE + 1, cs1.OBJECT_ID, cs1.SNAPSHOT_ID
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID = n
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 1 order by 2

Updated artifacts

Number of updated artifacts

Get the number of updated artifacts using the following query:

select 'Updated', 1 as "CPLX_TYPE",count(distinct cs1.OBJECT_ID)
from <CB_NAME>.ADGV_COST_STATUSES cs1,<CB_NAME>.DSS_LINKS l,<CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID = n
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 3

List of updated artifacts

Get the list of updated artifacts per snapshot using the following query:

select "CPLX_TYPE", cs1.OBJECT_ID, cs1.SNAPSHOT_ID
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID = n
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 3

Count of updated artifacts per complexity

The distribuition of updated artifacts per complexity = (number of updated artifacts with very high complexity divided by the number of updated artifacts with high complexity divided by the number of updated artifacts with moderate complexity divided by the number of updated artifacts with low complexity) can be retrieved using the following query:

select 'Updated', cs1.CPLX_TYPE + 1, count(distinct cs1.OBJECT_ID)
from <CB_NAME>.ADGV_COST_STATUSES cs1,<CB_NAME>.DSS_LINKS l,<CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID = n
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 3
group by cs1.CPLX_TYPE order by 2

List of updated artifacts per complexity and per snapshot

select 'Updated', cs1.CPLX_TYPE + 1, cs1.OBJECT_ID, cs1.SNAPSHOT_ID
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID = n
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 3
order by 2, 4,3

Deleted artifacts

Number of deleted artifacts

The number of deleted artifacts is given by using the following query:

select 'deleted', 1 as "CPLX_TYPE", count(distinct cs1.OBJECT_ID)
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID in (m,n)
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
and cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 2

List of deleted artifacts per snapshot

select 'deleted', 1 as "CPLX_TYPE", cs1.OBJECT_ID, cs1.SNAPSHOT_ID
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID in (m,n)
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
and cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 2

Count of deleted artifacts per complexity

select 'deleted', cs1.CPLX_TYPE + 1, count(distinct cs1.OBJECT_ID)
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID in (m, n)
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 2
group by cs1.CPLX_TYPE order by 2

List of deleted artifacts per complexity and per snapshot

select 'deleted', cs1.CPLX_TYPE + 1, cs1.OBJECT_ID, cs1.SNAPSHOT_ID
from <CB_NAME>.ADGV_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS m
where m.OBJECT_ID = <OBJECT_ID>
and m.SNAPSHOT_ID in (m, n)
and l.PREVIOUS_OBJECT_ID = m.MODULE_ID
and l.LINK_TYPE_ID = 3
And cs1.OBJECT_ID = l.NEXT_OBJECT_ID
And cs1.SNAPSHOT_ID in (SNAPSHOT_ID)
and cs1.CHANGE_TYPE = 2
group by cs1.CPLX_TYPE order by 2

Processed artifacts

To get the number of processed artifacts use the following query:

SELECT 'total', 1 AS "CPLX_TYPE", COUNT(DISTINCT cs1.OBJECT_ID)
FROM <CB_NAME>.DSS_COST_STATUSES cs1, <CB_NAME>.DSS_LINKS l, <CB_NAME>.DSS_MODULE_LINKS M
WHERE M.OBJECT_ID = 1
AND ( (cs1.CHANGE_TYPE = 2 AND M.SNAPSHOT_ID IN (m, n)) OR (cs1.CHANGE_TYPE != 2 AND M.SNAPSHOT_ID = n))
AND l.PREVIOUS_OBJECT_ID = M.MODULE_ID
AND l.LINK_TYPE_ID = 3
AND cs1.OBJECT_ID = l.NEXT_OBJECT_ID
AND cs1.SNAPSHOT_ID > m
AND cs1.SNAPSHOT_ID <= n

Specific checks

If you are using SQL analyzer, Make sure to check if the version of DB extractor is same in both case. It is required to use the extractor of same version, else results may not be as expected. For example in one of the case the added/deleted/total critical violations were the same and the percentage of artifacts deleted and added both were 100%. The issue was due to different DB extractor version.

Known cases

Variation of the number of deleted artifacts = 0 and the number of artifacts has decreased in the latest snapshot

We had similar case where the reason for this is explained below:

  1. There was a migration from a minor to a major version
  2. The first snapshot (snapshot m) was computed before the migration using the old minor version
  3. The second snapshot (snapshot n) was computed after the migration using the new version

Because the definition of artifacts was changed between these two versions, there is a difference in the variation of the number of artifacts, but no artifacts have been deleted. In order to check if this scenario applies to you:

  1. Get each snapshot context: the version used for the snapshot computation
  2. Check whether the Local/Central and the snapshots have been migrated using the following query (to be executed on both Local and Central repositories):

    Select *
    from SYS_PACKAGE_HISTORY
    

    The query returns the INSTALLER column which stores the CAST version numbers. This will tell us if a migration has been carried out or not.

  3. If yes, was the migration before or after the snapshot generation? Use the following query to retrieve the snapshot computation dates:

    Select *
    from DSS_SNAPSHOTS
    

    Using the results of the queries above, you can now identify which snapshots were computed with which version.

  4. Now get the lists of counted artifacts in each snapshot using the local site involved for each snapshot computation. To do this, refer to The number of processed, added, updated and or deleted artifacts is not as expected
  5. Identify the difference to get the objects no longer seen as artifacts in snapshot m
  6. If you cannot find the justification on why some objects are no longer considered as artifacts in the new version, please contact CAST support with the Required input and the result of investigation done at your side

Some (or all) deleted artifacts are also reported as added artifacts

Observed problem: one or several objects are reported as added and deleted artifacts at the same time. In this case, please refer to CAST Engineering Dashboard - Object - Incorrect Object Status - Same object seen as added deleted

Deleting a previous snapshot while generating one : added violations = 0

This may corrupt the database.

The WA is to clean the tables using the folling statements :

1) launch the procedure to cleanup deleted snapshots : launch on Central Base (connecting as Central base user)
 exec ADGV_UPDATE_ANY_COST_STATUSES 4
 exec ADGV_UPDATE_ANY_COST_STATUSES 7
 exec ADGV_UPDATE_ANY_COST_STATUSES 9
 exec ADGV_UPDATE_ANY_COST_STATUSES 11
 exec ADGV_UPDATE_ANY_COST_STATUSES 13
 exec ADGV_UPDATE_ANY_COST_STATUSES 14
 exec ADGV_UPDATE_ANY_COST_STATUSES 15
 exec ADGV_UPDATE_ANY_COST_STATUSES 16 

2) Perform a reconsolidation using AdgAdmin on the two last snapshots.

After this results are displayed.