Purpose (problem description)
The purpose of this page is to explain how to deal with hanging issues when running the Metrics Calculation step on a DDL file, after a SQL Analyzer analysis
Observed on RDBMS
RDBMS
Yes/No
Oracle Server(tick)
Microsoft SQL Server(tick)
CSS3(tick)
CSS2(tick)
Step by Step scenario
  1. Run the Analysis (At application level or Analysis Unit Level)
  2. After the Execution Unit has been analyzed, we note that the Run Metrics Calculation step never ends.
Action Plan

In such a SQL Analyzer analysis we often have only one file or a few files containing all the code, so we cannot afford to apply the dichotomy process. Some metrics are particularly long to process, for example "Avoid using SQL queries inside loops". Deactivating them may be an option.

  1. Edit file <Extension Folder>\com.castsoftware.sqlanalyzer-x.y.z\configuration\Languages\SQL\SQLCastMetrics.xml
  2. Comment-out the section for metric "Avoid using SQL queries inside loops" like shown below :

    SQLCastMetrics.xml
    <!--  
    <METRIC Name="Avoid using SQL queries inside loops" TYPE="1523">
        <LANGUAGE NAME="SQLScript-LANGUAGE">
          <ACTIVE>yes</ACTIVE> 
          <INIT>0</INIT> 
          <SEARCH_IN_CODE>Yes</SEARCH_IN_CODE> 
          <SEARCH_IN_COMMENT>No</SEARCH_IN_COMMENT> 
          <SEARCH_IN_STRING>No</SEARCH_IN_STRING> 
          <SEARCH_IN_EMBEDDEDSQL>No</SEARCH_IN_EMBEDDEDSQL> 
          <SEARCH_CASE_SENSITIVE>No</SEARCH_CASE_SENSITIVE> 
          <EMBEDDED>
            <BEGIN>
              <REGEXP><![CDATA[[[:space:]](while\b|loop\b|for\b[[:space:]]*[[:alnum:]]*[[:space:]]*do\b|repeat\b|<<)[[:space:]]*]]></REGEXP>
            </BEGIN>
            <VALUE> 
              <REGEXP><![CDATA[[[:space:]](select|update|insert|delete|merge)[[:space:]]]]></REGEXP>
            </VALUE>
            <END>
              <REGEXP><![CDATA[(end[[:space:]]*loop|end[[:space:]]*while|end|end[[:space:]]*for|end[[:space:]]*repeat|goto)]]></REGEXP>
            </END>
          </EMBEDDED>
        </LANGUAGE>
      </METRIC>
    -->
  3. Relaunch Analysis
  4. If you do not find the information you are looking for or solution for your problem,contact CAST Technical Support with Relevant Input. CAST Technical Support will reproduce the issue

Notes/Comments

 Ticket # 13498

Related Pages