SQL Queries - Common SQL Queries - Queries on Metrics - How to determine whether a metric is unified

Purpose of Query

This query provides information on whether a metric is unified.

When examining items in the dashboard, you may see metrics greyed out as shown in the screenshot below:

This is even though these metrics are active in the assessment model.

The main reason why these metrics are disabled is that they are tagged as "non unified". It means that this rule is not executed anymore and replaced by a "Unified" rule.

Usually, the non unified rules name end with the technology name like : 

  • Avoid Artifacts having a very low Comment/Code ratio (ASP - JavaScript VBScript)

The unified metric name has generally the "Non unified" metric root name. For instance:

  • Avoid Functions having a very low Comment/Code ratio
Applicable CAST Version
Release
Yes/No
8.3.x(tick)
8.2.x(tick)
Applicable RDBMS


RDBMS
Yes/No
Oracle Server(question)
Microsoft SQL Server(question)
CSS(tick)
Query for CSS
SELECT *
FROM   dss_metric_types
WHERE  metric_id = 1642
Query result example
 

1642;"Avoid Functions/Procedures with queries on too many Tables (PL/SQL Oracle)";"Avoid Functions / Procedures with queries on more than 4 Tables. Queries with more than 4 Tables is considered complex.
Changing the threshold value requires Metric Assistant configuration update.
Note: "Functions & Procedures" is a generic name that include different types of objects:
- function
- stored procedure
- trigger (special stored procedure fired by event)
- package function
- package procedure";3;1;"";4;0;0

Query result interpretation

 For unification, the main column from the query above is the column metric_options (this column has a value of 4 in the example above)

  • 0: Unified: N/A, XXL: N/A
  • 1: Unified: N/A, XXL: XXL
  • 2: Unified: N/A, XXL: Non-XXL
  • 4: Unified: Not Unified, XXL: N/A
  • 5: Unified: Not Unified, XXL: XXL
  • 6: Unified: Not Unified, XXL: Non-XXL
  • 8: Unified: Unified, XXL: N/A
  • 9: Unified: Unified, XXL: XXL
  • 10: Unified: Unified, XXL: Non-XXL

In the above example the value of 4 returned for this column indicates that this rule is not unified

Query for Oracle
Enter the SQL query
Query result example

Query result interpretation

Query for SQL server
Enter the SQL query
Query result example

Query result interpretation

Notes/comments



Related Pages