Post

3 followers Follow
0

How to exclude violations based on a common condition?

Huge number of false violations can be reported in AED and CED.

Excluding the objects through AED or CED 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 dss_object_exceptions. This table is located in the central schema.

After updating the table you need to compute a snapshot by skipping analysis. 

We list the following common conditions :

  • To exclude all the objects of one particular Quality rule, you need to update the table as follows :

INSERT INTO dss_object_exceptions

            (
                        metric_id,
                        object_id,
                        first_snapshot_id,
                        last_snapshot_id,
                        user_name,
                        last_update,
                        justify
            )
SELECT dmr.metric_id - 1,
       dmr.object_id,
       dsn.snapshot_id,
       1000000000,
       3,
       Now(),
       'inserted by script'
FROM   dss_metric_results dmr
JOIN   dss_snapshots dsn
ON     dmr.snapshot_id = dsn.snapshot_id
WHERE  dsn.snapshot_id = <snapshot_id>
AND    metric_id = <metric_id> + 1

  • To exclude objects whose full name is based on an expression for all Quality rules , you need to update the table as follows :
INSERT INTO dss_object_exceptions

            (metric_id,

             object_id,

             first_snapshot_id,

             last_snapshot_id,

             user_name,

             last_update,

             justify)

SELECT dmr.metric_id,

       dob.object_id,

       dsn.snapshot_id,

       1000000000,

       3,

       Now(),

       'inserted by script'

FROM   dss_metric_results dmr

       JOIN dss_snapshots dsn

         ON dmr.snapshot_id = dsn.snapshot_id

       JOIN dss_objects dob

         ON dob.object_id = dmr.object_id

       JOIN DSS_METRIC_TYPES dmt

    ON dmr.metric_id = dmt.metric_id

       where DMT.METRIC_GROUP          = 1

       AND dsn.snapshot_name = 'snapshot_name'

       AND dob.object_full_name LIKE '%expresion%'

 

  • To exclude objects whose full name is based on an expression for a specific Quality rule, you need to update the table as follows :
INSERT INTO dss_object_exceptions

            (metric_id,

             object_id,

             first_snapshot_id,

             last_snapshot_id,

             user_name,

             last_update,

             justify)

SELECT dmr.metric_id,

       dob.object_id,

       dsn.snapshot_id,

       1000000000,

       3,

       Now(),

       'inserted by script'

FROM   dss_metric_results dmr

       JOIN dss_snapshots dsn

         ON dmr.snapshot_id = dsn.snapshot_id

       JOIN dss_objects dob

         ON dob.object_id = dmr.object_id

       JOIN dss_metric_descriptions dmd

         ON dmd.metric_id = dmr.metric_id

WHERE  dmd.language = 'ENGLISH'

       AND dsn.snapshot_name = 'snapshot_name'

       AND dmd.metric_description = 'QR NAME'

       AND dob.object_full_name LIKE '%expresion%'
  • To exclude objects whose source code is based on an expression for a specific Quality rule, you need to update the table as follows :
INSERT INTO dss_object_exceptions

            (metric_id,

             object_id,

             first_snapshot_id,

             last_snapshot_id,

             user_name,

             last_update,

             justify)

SELECT dmr.metric_id,

       dob.object_id,

       dsn.snapshot_id,

       1000000000,

       3,

       Now(),

       'inserted by script'

FROM   dss_metric_results dmr

       JOIN dss_snapshots dsn

         ON dmr.snapshot_id = dsn.snapshot_id

       JOIN dss_objects dob

         ON dob.object_id = dmr.object_id

       JOIN dss_metric_descriptions dmd

         ON dmd.metric_id = dmr.metric_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  dmd.language = 'ENGLISH'

       AND dsn.snapshot_name = 'snapshot_name'

       AND dmd.metric_description = 'QR NAME'

       AND dst.source_text LIKE '%expresion%'

Please sign in to leave a comment.

3 comments

0
Avatar

Hi Amine,

We are frequently getting request from customers to exclude only false violations.

Is there any way to find the false violations other than manually validating them?

0 votes
Comment actions Permalink
0
Avatar

Hi Veena, 

Unfortunately, we cannot! There is no automatic way to detect the false violations, this depends on the quality rule description. 

In fact you should understand the raison for which the QR is false for a single object in violation than generalize on other violations

0 votes
Comment actions Permalink