CAST HIGHLIGHT - Analysis - Though Highlight uses Physical LOC counts, LOC count is lesser than expected

Line of Code count is sometimes found to be lesser than expected though Highlight uses Physical LOC counts.

 

Action Plan

  1. Check whether the reason for LOC count to remain low is because of issues related to particular technology
      1. Check Technology Coverage to know if all the technologies used in the application is supported.
      2. Check if analyzer is skipping some technologies during the discovery step. CAST HIGHLIGHT - Discovery Step - Analyzer not detecting all the technologies
      3. For specific technologies there can be files that are not included.
            1. For java script if a file do not contain any javascript code, identified by the <script> or <script language="Javascript"> or <script type="text/javascript"> tags, it is excluded from the analysis. Minified files in JavaScript are excluded from analysis. 
            2. HTM, HTML and XHTML extensions contain possibly embedded javascript code. Files with these extensions are therefore passed to the analyzer as part of a JavaScript analysis.  But if it turns out that a file do not contain any javascript code,  it is excluded from the analysis. LOC count are only for the lines that contain javascript code.
            3. For COBOL some specific type of files are not included. Please refer CAST HIGHLIGHT - Analyzer - COBOL - All the cobol files are not getting scanned in Highlight scan
  2. Check and verify whether the code is properly delivered.

      1. Check whether the repository to be analyzed contains all the expected code. Confirm that all folders have been selected.
      2. Check if any filter is set for the scan data in Software Composition Analysis and Software Health in Health Distribution view. Please refer Re-calculate Software Health scores in real-time based on folder exclusions
      3. Check if any code  is excluded from analysis. Please refer  CAST HIGHLIGHT - Analysis Step - Reason for the code to be excluded from analysis
      4. Check if  file extensions needed to be renamed to match the extensions recognized by the agent. Please refer the section "Languages and file extensions" in the Getting Started Guide  
  3. Check if there are any issues with analysis and analysis is producing limited results Please refer CAST HIGHLIGHT - Analysis Step - Analysis proceeds with limited results
  4. Check the logs to see if any parsing issues can be identified in the logs.

NB: Method used for LOC Count varies  in Highlight and Imaging

Even though Highlight uses Physical LOC count,Highlight excludes non-commented and commented instructions, blank spaces, project and configuration files, binary files etc. But generated code and third-party component files if part of the source code is included. Please refer What is a line of code and how Highlight counts them?

The logical LOC count of CAST Imaging maybe more accurate, because Imaging measures lines of code specifically within the scope of module objects, unlike CAST Highlight which measures physical lines of code, regardless of the logical grouping. Logical LOC count, count only the artifacts which are directly part of the module, and will exclude code from external libraries or other modules.

Highlights Physical LOC count may be useful for overall project metrics while Imagings Logical LOC count with its module wise scope maybe more accurate to understand code size and the complexity related to the module. To attain higher accuracy, the methods for module wise count for Imaging also varies with tecnology. For eg C# module wise code may be counted differently than code in Java modules.

 

Tickets

49312, 48909, 42122, 33143, 50375

 

Related Documentation

What is a line of code and how Highlight counts them?

Technical Size metrics

CAST HIGHLIGHT - API - How to get the LOC count even when LOC count is low and is displayed only as a percentage?

CAST HIGHLIGHT - Results - SCA - The ratio of “Your Code” and “Third Party” code is calculated using "number of files" instead of "Lines of Code"

 

Additional Resources

CAST Highlight Troubleshooting Guides

CAST Highlight Product Documentation

Highlight REST API

Have more questions? Submit a request

Comments

Powered by Zendesk