Post
FollowHow to exclude violations based on a common condition for AED?
Huge number of false violations can be reported in AED.
Excluding the objects through AED manually can consume a long time.
We can reduce the effort and time,if we perform exclusions based on some common condition.
You can perform the exclusions using the table aed_exclusions_requests. This table is located in the central schema.
After updating the table you need to consolidate the snapshot.
We list the following common conditions :
To exclude violations for a particular quality rule:
Insert into aed_exclusions_requests
values (
<OBJECT_ID>, -- Object Id from The CB
<QR_ ID>, -- For Example 7908, this the ID of the QR Avoid unreferenced Methods
(Select object_id
from dss_objects
where object_type_id = -102
and object_name = <'Application name'>), -- For Example "My application"
<'USER NAME, used to connect to AED'>, -- For example AMINE
Now(),
'Custom Exclusion - Raison of Exclusion' -- For Example "False violation", "Not applicable" ....
)
To exclude violations from a particular source path:
Insert into aed_exclusions_requests
SELECT dob.object_id,
dmr.metric_id - 1,
(
SELECT object_id
FROM dss_objects
WHERE object_type_id = -102
AND object_name = <'APPLICATION_NAME'>
), -- For Example "My application",
'<USER_NAME>', -- For example AMINE is The user name to connect to AED
Now(),
'Custom Exclusion - Raison of Exclusion' -- For Example "False violation", "Not applicable" ....
FROM dss_metric_results dmr
JOIN dss_objects dob
ON dob.object_id = dmr.object_id
JOIN dss_source_positions dsp
ON dob.object_id = dsp.object_id
JOIN dss_source_texts dst
ON dst.local_source_id=dsp.local_source_id
WHERE dmr.metric_id = 4566 + 1 -- The Id of the Quality rule
AND source_path = <'SOURCE_PATH'> -- Source path from where you want to exclude the violations
AND dmr.snapshot_id IN
(
SELECT snapshot_id
FROM (
SELECT snapshot_id ,
functional_date
FROM dss_snapshots
WHERE application_id IN
(
SELECT object_id
FROM dss_objects
WHERE object_type_id = -102
AND object_name = <'APPLICATION_NAME'> -- For Example "My application",
)
ORDER BY 2 DESC limit 1 )current_snapshot )
Please sign in to leave a comment.