This guide troubleshoots the issue of missing quality rule. Below screenshots are examples to illustrate the different ways of finding out whether a Quality Rule is missing from the Dashboard.
When a Quality Rule which has not been calculated, is searched for, the Quality Rule is grayed out in the search results.
In the below screenshot you can see that the Quality rule "Method override fails due to mismatch of const/volatile qualifiers" is grayed out with no result.
When trying to access from quick access, this quality rule will not be displayed under the Metric Selection section.
In the below screenshot Quality Rule for JEE, shows 0 results when searched under list of Quality Rule for JEE
Another way of identifying that the Quality Rule is missing is in the FRAME_METRIC_DETAIL view. Note that this view is deprecated.
In the below screenshot the Quality Rule - Method override fails due to mismatch of const/volatile qualifiers is missing.
For more details on what is a quality rule refer to - Metrics and Quality Rules Documentation
Release | Yes/No |
---|---|
8.3.x |
RDBMS | Yes/No |
---|---|
CSS |
Step by Step scenario
- Run analysis followed by snapshot
- Launch Cast Engineering Dashboard
- Search for a quality rule and you can see that the quality rule is greyed out in the search results
OR compare two versions of snapshots and you can see that N/A is displayed for one of the snapshots
Action Plan
To troubleshoot this issue, you need the following Relevant input
Perform the below actions:
- For custom quality rules refer to the section - #Custom Quality Rules
- Otherwise, check if your case is listed in the Known Cases
- Next, if the missing quality rule belongs to COE then refer to section Quality rules belongs to COE languages
- Then check if the Missing quality rule is because of the incorrect exclusion list
- Check if the metric weight is 0. As of CAST 8.3.30, AAD consolidation will filter zero weights and null grades.
- To check, run the following query: select * from dss_metric_type_trees where aggregate_weight = 0 and metric_id = XXXX
- To update, run the following query: update dss_metric_type_trees set aggregate_weight = 1 where metric_id = XXXX
- After any changes, the snapshot should be either re-generated or consolidated to take the metric tree changes into effect
- Queries are run on the central database
- Next, Check if Total and detail procedures have been executed during the snapshot generation
- If none of the procedures are executed then:
- Check if the metric has been disabled . If the Quality rule is not disabled and still you are getting the Quality rules as grayed out then contact CAST Technical Support with Relevant Input
Check if the Quality rule was detected during the snapshot generation, for that run the following on the knowledge schema
SELECT description FROM dss_history WHERE description LIKE '%PROC NOT FOUND%<metric_id>%' ORDER BY history_id
Replace <metric_id> by the Id of the Quality rule
Query result sample:
"PROC NOT FOUND SET_VantiveBasic_Function 2800002 SET_VantiveBasic_Function";"2018-04-04 16:16:59.441";34770 "PROC NOT FOUND SET_VantiveBasic_Sub 2800003 SET_VantiveBasic_Sub";"2018-04-04 16:16:59.453";34771
If the query returns no rows, then there is an issue in the implementation of the Quality rule,contact CAST Technical Support with Relevant Input
- Check if the issue is not due to the fact that the QR is present in the application but not in the union content module, for this refer to SQL Queries - CAST Central Base - Corruptions on Quality rule - How to check if a Quality rule is calculated at the application level but not at the union content module and vice versa, if yes following the steps present in the page in order to correct the corruption, else go to the next step.
- Check if the issue is due to the change in applicable technologies of assessment model for the rule between 2 snapshots.
- Check if issue is due to the fact that assessment model data is not loaded during snapshot using query - SQL Queries - CAST Management Base - How to check if an assessment model data is loaded properly during snapshot. If the query is not returning any result then you can take a snapshot skipping analysis.
- If above steps did not help then contact CAST Technical Support with Relevant Input
For CAST Technical Support only , refer to page CAST Engineering Dashboard - Missing Quality Rules - Find the component with the bug - CAST Internal
Relevant input
- Screenshot of the dashboard showing the name of the quality rule that is greyed out in the search box.
- CAST Support Tool (CST) - alias Sherlock export with source code of current version.
- In case the diagnostic is missing after migration then the CAST Support Tool (CST) - alias Sherlock export of previous version with Source code (If the previous environment is not available to generate Sherlock then the management and Knowledge Base backup and source file containing the object that is expected to be in scope of Quality Rule / violation but is not)
- In case the metric deals with database objects then extraction logs of both versions (This log is fetched by Sherlock if you have used DMT else if you have used standalone extractor then provide this manually).
Custom Quality Rules
To verify if the missing quality rule is a custom quality rule run the below query on central Database -
select METRIC_ID from DSS_METRIC_DESCRIPTIONS where METRIC_DESCRIPTION like '%metric_name%'and language = 'ENGLISH'
Example
select METRIC_ID from DSS_METRIC_DESCRIPTIONS where metric_description like 'Avoid Artifacts with High Integration Complexity (IC > X)%' and language = 'ENGLISH'
Result
metric_id 6604
How to interpret the result - Here the metric_id returned by the row is 6604 which is < 2000000 , if the result of the query is > 2000000 then the quality rule is a Custom rule.
If it is not a custom quality rule then proceed to step 2 in Action Plan
If the quality rule does not return any row it means that the rule is not created in the database. To solve this problem follow the below steps -
- Launch Servman
- Right click on mngt / CB / KB and click on Load Metamodel
- Launch the analysis + snapshot again
After loading the metamodel if you are still facing the issue then check if the DSS_METRIC_DESCRIPTIONS table is empty by running the following query -
select * from DSS_METRIC_DESCRIPTIONS where METRIC_ID > 2000000
If you are not able to find in the list the missing quality rule it means that the scope of the quality rule is empty.
Goto section Check if Total and detail procedures have been executed during the snapshot generation
If you get the case where Total count =0 and Detail count =0, then ask the author of the customized procedures to fix the issue, this is out of scope of CAST Technical Support.
Known Cases
Quality rules that belong to COE languages
If the quality rule belongs to any of the following technologies then refer to this section - EGL , Flex, Fortran, PeopleSoft, PHP, PL1, RPG, Shell, Siebel, TIBCO
In case of these technologies the default assessment model that is already present in CMS will not contain the Quality Rules specific to these languages.
So if the snapshot is generated without importing the assessment model from Central Database then there are possibilities that none of the Quality rules are violated and as a reason there are missing technical criteria and due to missing technical criteria the Business criteria is missing.
To solve this problem assessment model needs to be imported from central database before running a full snapshot as given in the documentation - Step 3: Use the CAST Management Studio to import the Assessment Model
Even after importing the assessment model if you are unable to see the rules then apply the solution given in the page - CMS Snapshot Analysis - Run Analyser - Fatal Error - Universal Analyzer - Invalid type name xxx not declared in metamodel
If you have the rules coming from COE package plugin missing then the reason may be because the JAVA_HOME is not set in the analysis machine.
Ensure that the JAVA_HOME environment variable is set in the analysis machine and re-run the analysis to solve this problem.
Select the page depending on the technology:
Missing quality rule is because of the incorrect exclusion list
The quality rules may be missing because of incorrect definition of the exclusion list/query.
The query might be containing a word in the search string, which is matching the source path/schema name which might be containing that word due to which most/all files are excluded from dashboard. As a result no QRs are visible. You need to check the exclusion query & correct it accordingly.
You can launch CMS and look in the below section -
Execute the query that you have given in the Explicit list and check if the object(s) that you are expecting to be violated falls in this list.
Check if Total and detail procedures have been executed during the snapshot generation
Get the name of total and detail procedures of theQR by running the below query on the Central database -
SELECT TT.METRIC_SCOPE_PROCEDURE_NAME AS DetailProc , T.METRIC_ID , T.METRIC_NAME , COALESCE(P.OBJECT_TYPE_ID,0) AS OBJECT_TYPE_ID, VT.METRIC_VALUE_PROCEDURE_NAME AS TotalProc FROM DSS_METRIC_TYPE_TREES TT , DSS_METRIC_VALUE_TYPES VT , DSS_METRIC_TYPES T LEFT OUTER JOIN DSS_METRIC_PARAM_TYPES P ON ( P.METRIC_ID = T.METRIC_ID AND P.PARAM_INDEX = 1 ) WHERE T.METRIC_GROUP = 1 AND TT.METRIC_ID = T.METRIC_ID + 1 AND VT.METRIC_ID = T.METRIC_ID AND VT.METRIC_VALUE_INDEX = 2 AND metric_name LIKE '%<METRIC_NAME>%' ORDER BY METRIC_NAME
Example -SELECT TT.METRIC_SCOPE_PROCEDURE_NAME AS DetailProc , T.METRIC_ID , T.METRIC_NAME , COALESCE(P.OBJECT_TYPE_ID,0) AS OBJECT_TYPE_ID, VT.METRIC_VALUE_PROCEDURE_NAME AS TotalProc FROM DSS_METRIC_TYPE_TREES TT , DSS_METRIC_VALUE_TYPES VT , DSS_METRIC_TYPES T LEFT OUTER JOIN DSS_METRIC_PARAM_TYPES P ON ( P.METRIC_ID = T.METRIC_ID AND P.PARAM_INDEX = 1 ) WHERE T.METRIC_GROUP = 1 AND TT.METRIC_ID = T.METRIC_ID + 1 AND VT.METRIC_ID = T.METRIC_ID AND VT.METRIC_VALUE_INDEX = 2 AND metric_name LIKE '%Private Fields naming convention - case and character set control%' ORDER BY METRIC_NAME
OutPut -
"DIAG_SCOPE_NETNAM007";3562;"Private Fields naming convention - case and character set control";141901;"DIAG_DOTNET_ANA_PV_FIELD_TOTAL" "DIAG_SCOPE_NETNAM007";3562;"Private Fields naming convention - case and character set control";138385;"DIAG_DOTNET_ANA_PV_FIELD_TOTAL" "DIAG_SCOPE_NETNAM007";3562;"Private Fields naming convention - case and character set control";138383;"DIAG_DOTNET_ANA_PV_FIELD_TOTAL"
Execute following queries to check if procedures have been executed -
Detail Procedure
Select * from <KB_NAME>.DSS_HISTORY where description in '%<PROC_DETAIL_NAME>%'
Total Procedure
Select * from <KB_NAME>.DSS_HISTORY where description in '%<_DETAIL_NAME>%'
If the query returns rows that means the procedure has been executed. If the queries return no rows that means the procedures have not been executed.
Check if the metric has been disabled
Check if the quality sizing factor / quality rule has been unchecked as shown below. In the below example Technical Debt has been deactivated. To activate it check the Active checkbox.
If the metric has been disabled then enable it by checking the check box Active making it to True,and generate a new snapshot to solve the issue.
Applicable technologies
Applicable technologies can be different in assessment model as shown below. For example, rule-' Avoid undocumented Classes' has JEE technology applicable in latest run and not in previous run. This causes missing rule in previous run :
Previous run :
Latest run: