CAST Highlight Code Reader Guide
/
v3.08 · Windows / Linux / Mac
Getting Started Guide · Section III

Analyzing Source Code with the Code Reader

The Code Reader scans your application source code locally, extracts software health, cloud maturity, and open-source composition metrics, and packages the results for upload to your CAST Highlight portal — no source code ever leaves your machine.

40+Technologies
3Platforms
CSVOutput format
AES-256In-transit encryption

Overview

Who this section is for, and how the Code Reader fits into a CAST Highlight assessment.

This section of the guide is designed for team members with a Contributor role — typically application owners. If your team wants to leverage automation capabilities instead of the desktop app, the same analyzers are available through the CAST Highlight Command Line Interface (CLI), which integrates into CI/CD pipelines.

The typical workflow

Install the Code Reader → define your scan scope → run a scan → upload the result ZIP to the portal → complete the survey → submit. Each step is covered below in order.

Technical Requirements

OS
Operating System
  • Microsoft Windows ≥ Windows 10, or Linux / Mac
💻
Browser (portal)
  • Google Chrome recommended
  • Microsoft Edge, Firefox ESR supported
  • Unsupported vendor versions are not guaranteed
💾
Disk & memory
  • 600 MB free disk space
  • 8 GB memory
🔑
Permissions
  • Administrator privileges to run the installer
📄
Source code
  • Stored as text files, UTF-8 encoding
  • Accessible from the machine running the Code Reader

Installing the Code Reader

Download from the Application Scans section of the portal — always grab the latest version.

CAST Highlight · Code Reader Downloads

Unified experience across operating systems (Windows, Linux, Mac).

🖻 Windows

Version 1.0.2 x64 (94MB)

Download
🐧 Linux

Debian · 1.0.2 amd64 (70MB)
Fedora · 1.0.2 x86_64 (70MB)

Download
macOS

Version 1.0.2 x64 (70MB)

Download

Download the binary that corresponds to the operating system where the Code Reader will be installed, then follow the installer wizard steps. The Code Reader is packaged with Perl and the CAST Highlight CLI, both required elements.

Linux & Mac prerequisites

Perl and additional modules might be required. Check the prerequisites before installing.

Prefer automation? Download the CAST Highlight CLI instead — it contains the same analyzers as the Code Reader and integrates within your CI/CD environment. See the Command Line (CLI) section below.

Define Your Code Scan Scope

A few minutes of prep now saves rework later — the Code Reader treats every file in scope as equally part of the application.

CAST Highlight analyzes code at the file level and doesn't evaluate logical links or dependencies between files — every file inside the scan scope is treated as part of the application. To get accurate, consistent results, use the folder/file exclusion features to prepare your scope first.

  • Open source & COTS packages — include the folders that contain them if you want to identify them (often grouped under a third-party subfolder, with main code under src/main).
  • Test classes — exclude them unless you specifically want them scanned.
  • Generated code (e.g. *.t.ds, *.flow.js) — exclude it, since the development team can't manage the health of auto-produced code.
  • SCM, build & deployment folders (e.g. .git, .svn) — exclude for more consistent results.
  • Dependency manifests (e.g. pom.xml, build.gradle, package.json, .vcsproj) — keep these in scope if you want framework and dependency insights.
Avoid scanning entire drives

If you scan a whole C:\ drive, Highlight will systematically scan every file it can with its 40+ supported technologies and try to consolidate insights from there — the few minutes spent scoping the application up front are saved many times over when consuming the analytics later.

Running the Code Reader

Launch, discover, and let the Code Reader do the scanning.

1
Launch the app

Click the CAST Highlight Code Reader shortcut on your desktop.

2
Select source folders

Add one or multiple folders containing your source code to be discovered by the Code Reader.

3
Launch scan

Click "Launch Scan" once your folder selection is ready. You can cancel discovery at any time.

4
Review & save results

Once complete, review the technology summary, then save results as a ZIP ready for upload.

Code Reader · Application scan complete
TechnologyExtension# FilesStatus
Kotlin.kt1560Analyzed
Ksh.sh4Analyzed
conf73Not Supported
configloader1Not Supported
Save Results
Save Logs for Support
Save highlight.properties

Once the scan is finished, you can:

  • Save Results — produces the ZIP file you'll upload to the SaaS platform for the corresponding application.
  • Open / Save scan logs.
  • Re-scan the selected folder, or go back to the initial screen to scan another folder.
  • Save scan settings (a .properties file) to ease future automation through the CLI.

Common reasons a file is excluded

  • Binary file
  • Unreadable file
  • Missing file
  • External library
  • Encoded file
  • Generated file
  • Syntax error
  • Content not in expected language
  • Code not compliant with analysis criteria
  • File too big (limit is 3 MB)
  • Time out
  • Analyzer not available
  • Some analysis unit is not OK
Tips & tricks

If your files use extensions that don't match what the Code Reader detects, rename them to match — see the Best Practices and Languages & Extensions sections below. If you hit an issue, save the analysis logs and share them with CAST Support.

Advanced Settings

Fine-tune a scan from the "Advanced Settings" button on the initial screen.

🏷
Filter Technologies
  • Select specific technologies to include during the scan.
  • Unspecified technologies are ignored — leave blank to scan all supported technologies.
Exclude Items
  • Ignore Directories, Files, or Paths
  • Match by name or extension, or use regular expressions
Upload Scan Results
  • Server URL, Company Identifier, Application ID
  • Snapshot Label & Date
  • User Login / Password / Token
  • Automatically upload results for an application once the scan completes
Miscellaneous Options
  • Create Cloud/Green insights file for importing into IDEs
  • Enforce scan of large files (>3MB)
  • Include all NPM dependencies on lock files
  • Enforce scan of generated code

These settings are shared with the Command Line and can be retrieved from the Command Line (CLI) section below. Reset to default values at any time with "Reset Configuration".

Uploading the Results

The Code Reader produces a ZIP of anonymized CSV files — upload it to the portal to populate results.

1
Log in to the portal
2
Find your application

Under the Application Scans section, look for the application you analyzed.

3
Upload Results

Click "Upload Results" and point to the result ZIP file saved by the Code Reader.

4
Confirm

Once uploaded, you'll see a record on screen. You can also upload result .csv files one by one.

Removing an uploaded file

An analysis results file can be deleted at any time during the upload process via the trash-can icon. A Contributor removing their own results will need to re-enter their password to validate the action; the Portfolio Manager can remove any file.

Answering Surveys

If surveys are activated for your organization, complete them before submitting.

  • Under Application Scans, click the campaign, then the application.
  • Click the "Survey" button and answer the questions for each section.
  • If the survey is de-activated for your organization, simply click "Submit" — you're finished.

Survey progress is shown at the top of the screen. Once all mandatory questions are answered, you can submit your results — though answering every question enriches your organization's CAST Highlight data.

Submitting the Results

  • Once all required CSV files are uploaded and any mandatory survey questions are complete, click "Submit" on the application under Application Scans.
  • This step is required to populate results in the portal.
Submission locks the application

Once submitted, a Contributor can no longer make changes — only the Portfolio Manager can modify an application after results are submitted. If the analysis needs to be redone, contact your organization's Portfolio Manager (or CAST Support if you don't know who that is).

Command Line Interface (CLI) v5.12.18

Run the exact same analyzers as the desktop Code Reader from a Java binary — scriptable, CI/CD-friendly, and UI-free.

The CAST Highlight command line (HighlightAutomation.jar) is a Java binary that enables automated source code scans inside CI/CD environments. It replaces the Code Reader's desktop UI with fully scriptable options, so continuous software health and cloud readiness monitoring can run unattended on every build.

Requirements

JV
Java
  • Supported major JDK releases: 11, 17, 21
  • Pre-release versions are not supported
🐧
Linux (Debian-based)
  • Perl 5.xx with libraries: Digest::SHA, XML::LibXML, JSON, Time::HiRes, Math::BigInt
🖻
Windows
  • Strawberry Perl 5.42.0.1 installation required
MAC
macOS
  • Running the CLI inside a Docker container is recommended

Version 5.12.18 is available for download after accepting the end-user license agreement, from the Application Scans section of the portal.

Core Syntax

java -jar HighlightAutomation.jar [options]

Mandatory Options

OptionDescription
--sourceDirAbsolute path to the source code directory to scan. Repeat the flag to scan multiple folders in one pass.
--workingDirAbsolute path to the Highlight working directory, where scan results and logs are stored.

Scan Options

OptionPurpose
--propertiesPathPath to a centralized .properties configuration file.
--technologiesComma-separated list of specific languages to scan (e.g. Java,Python).
--ignoreDirectoriesDirectory patterns (regex) to exclude during the scan.
--ignorePathsRegular expressions to exclude paths, separated by |.
--ignoreFilesFile patterns (regex) to exclude from scanning.
--analyzerDirAlternate analyzer scripts directory.
--perlInstallDirWindows-only: path to the Perl installation directory.
--keywordScanPath to a KeywordScan XML configuration file.
--analyzeBigFilesBypass the default file size limitation (3 MB).
--allowGeneratedCodeInclude generated code files (e.g. *.designer.vb, *.designer.cs).
--packageManager mvnNative Maven integration for dependency resolution.
--mavenRepositoryLocal .m2 repository path for Maven components.
--nugetRepositoryLocal Nuget cache path for .NET dependencies.
--includeAllDependenciesInclude indirect dependencies (e.g. from node_modules).
--includeArchiveContent={depth}Extract and scan archive contents down to the specified depth.
--dockerImageNameTag {name#tag}Scan a Docker image directly, by image name and tag.
--fingerprintsEnable fingerprint matching for open-source component detection.
--excludeInferredCVE true/falseDisable CVE detection that relies on component name matching.
--dbgMatchPatternDetailGenerate detailed files used for VS Code plugin integration.

Git Repository Options

OptionPurpose
--gitUrlGitHub or GitLab repository URL to scan directly, without checking it out yourself.
--gitBranchBranch to download. Defaults to main when omitted.
--gitTokenAuthentication token, required for private repositories.
--gitTypeGit server type, e.g. gitlab for a locally-hosted GitLab instance.

Upload Options

OptionPurpose
--loginEmail of an active CAST Highlight user account.
--passwordPassword for the account above.
--basicAuthBase64-encoded credentials, as an alternative to login/password.
--tokenAuthOAuth token for authentication — the recommended method, and required for SSO/SAML organizations.
--companyIdCompany identifier, taken from the portal URL.
--applicationIdApplication identifier, taken from the portal URL.
--serverUrlURL of your CAST Highlight server instance.
--snapshotDatetimeEpoch timestamp in milliseconds to assign to the snapshot.
--snapshotLabelSnapshot label (e.g. a version or build number).
--skipUploadGenerate CSV results only — don't upload them.
--appendResultAdd these results to an existing upload rather than replacing it.
--skipSubmitUpload the CSVs without triggering platform processing.
--zipResult {path}Create a ZIP file containing the result CSVs at the given path.
--uploadZipFile {path}Upload a previously-scanned ZIP without re-scanning the source.

Utility Options

OptionDescription
--helpDisplay all available options.
--printTechnosList all supported technologies.
SSO / SAML organizations

If your CAST Highlight instance uses SSO/SAML, authenticate with --tokenAuth (a user token) instead of --login / --password — basic credentials aren't accepted.

Usage Examples

Basic Windows scan (no upload)
java -jar HighlightAutomation.jar --workingDir "C:\highlight-myproject" --sourceDir "C:\myproject\src" --skipUpload
Scan a public GitHub repository
java -jar HighlightAutomation.jar --gitUrl https://github.com/googleapis/gax-go.git --sourceDir "C:\myproject\src" --workingDir "C:\temp\hlresults" --skipUpload
Scan a private GitHub repository
java -jar HighlightAutomation.jar --gitUrl https://github.com/private/repo.git --gitToken YOUR_TOKEN --sourceDir "C:\myproject\src" --workingDir "C:\temp\hlresults" --skipUpload
Scan specific technologies only
java -jar HighlightAutomation.jar --workingDir "C:\highlight-myproject" --sourceDir "C:\myproject\src" --technologies "Java,Python" --skipUpload
Exclude test folders
java -jar HighlightAutomation.jar --workingDir "C:\highlight-myproject" --sourceDir "C:\myproject\src" --ignoreDirectories "test,jquery" --skipUpload
Scan multiple folders in one pass
java -jar HighlightAutomation.jar --sourceDir "C:\folder1" --sourceDir "C:\folder2" --workingDir "C:\temp" --skipUpload
Maven, with dependency resolution
java -jar HighlightAutomation.jar --sourceDir "C:\source" --workingDir "C:\source\hlresults" --packageManager mvn --includeAllDependencies --skipUpload
Nuget (.NET), with a cache path
java -jar HighlightAutomation.jar --sourceDir "C:\source" --workingDir "C:\source\hlresults" --nugetRepository "C:\Users\<username>\.nuget\packages" --includeAllDependencies --skipUpload
Scan a Docker image
java -jar HighlightAutomation.jar --dockerImageNameTag node#latest --includeArchiveContent=3 --workingDir "C:\temp" --skipUpload
Upload results with authentication
java -jar HighlightAutomation.jar --workingDir "C:\highlight-myproject" --sourceDir "C:\myproject\src" --login "john.doe@acme.com" --password "*******" --applicationId 1234 --companyId 5678 --serverUrl "https://rpa.casthighlight.com"
Behind a proxy, with credentials
java -Dhttps.proxyHost=proxy_host -Dhttps.proxyPort=proxy_port -Dhttps.proxyUser=user -Dhttps.proxyPassword=password -jar HighlightAutomation.jar --workingDir "C:\highlight-myproject" --sourceDir "C:\myproject\src" --login xxx --password xxxx

Default Excluded Directories

The CLI automatically skips these common directories, so you rarely need to list them yourself with --ignoreDirectories:

.git* .svn .circleci .scannerwork .azure .vscode test/ tests/ sample/ samples/ example/ examples/ demo/ __MACOSX/ .DS_Store debug/ /obj/Release/ /obj/Debug/ /bin/Release/ /bin/Debug/ node_modules/ vendor/ packages/ Pods/ bin/ build/ dist/ out/ target/ mocks swagger karma e2e

Default Excluded Files

Test and flow files are excluded by default:

*.t.ds *.flow.js *.spec.ts *.spec.js *-spec.js *.specs.js *-specs.js

Exit Codes

CodeMeaning
0Success
1General failure
2Options parse error
3Technology discovery error
4Analysis error
5Upload error
6Source/output directory validation error
7ZIP file save error
8ZIP file upload error

Output

A log file named HLAutomation.log is created in the working directory after each run. Scan results are generated as CSV files under HLTemporary/analysis/, and discovery logs are written to HLTemporary/discover/.

Best Practices by Technology

Language- and database-specific tips to get clean, analyzable results.

AB
SAP / ABAP
  • Use the CAST extractor to compile ABAP source files before analysis.
  • Benefits: validated with Code Reader, automatically splits files as required, and handles extracted files without manual extension changes.
  • A different extractor can be used, but you'll lose the above advantages.
JS
JavaScript
  • Third-party libraries and minified files (filename.min.js) aren't fit for health analysis.
  • They're auto-detected and excluded, but stored separately in *.ThirdParties.csv for Software Composition Analysis.
SH
UNIX Shell Scripts
  • Supports KSH (.ksh), Bourne (.sh) and Bourne Again (.bash). C-Shell is not supported.
  • Two scan options differ by file filtering: .ksh only, or * (all files — recommended, then hand-pick files to analyze).
PL
PL/SQL
  • Recommended: use the CAST extractor. Source provided via .pkb, .pks, or .psql.
  • A single .sql/.psql file is auto-split into functions, procedures & triggers; code outside routines is analyzed as a "root" artifact.
  • Non-procedural code is excluded. DB extractors produce .src by default — rename to .psql for best results.
for /d %x in (*) do pushd %x & ren *.src *.sql & popd
TS
Microsoft T-SQL
  • Recommended: use the CAST extractor, which splits T-SQL files by artifact (procedures, functions, triggers) per file.
  • Procedural code outside an artifact is a "root" artifact and is also analyzed; non-procedural code is excluded.
  • Rename default .src output to .tsql for best results.
DB
DB2 / MySQL / MariaDB
  • Light analyzers — calculate lines of code (LOC) only, after code/comment separation. No procedural distinction, no Software Health rules.
  • Use .db2, .mysql, or .mariadb extensions respectively for best results.
PG
PostgreSQL
  • Non-procedural code is excluded from analysis (like PL/SQL).
  • Use the .postgresql extension to explicitly associate files to the PostgreSQL analyzer.
VB
Visual Basic
  • The Code Reader does not distinguish VB.NET, VB5 and VB6 — extensions and syntax are very close, but it is optimized for VB.NET.
  • VB Scripts (.vbs) are not supported.
NX
Extension-less LanguagesCOBOL · UNIX shell · PL1
  • Only include source code in the scanned folder — e.g. exclude copybooks / JCL from a COBOL analysis, keep just the programs.
  • Alternatively, select a folder with mixed assets and check/uncheck individual files.
  • Highlight rejects non-source assets automatically, but this can slow down analysis time.

Languages & File Extensions

Rename source files to match a recognized extension for the most accurate analyzer routing.

Filter
Language / TechnologyTypeSource File Extensions & Notes

No technologies match your search.

Binary extensions considered for Software Composition Analysis

CAST Highlight's analyzers also take binary extensions into account to help detect third-party components: .jar (Java), .dll (Windows), .a, .lib, .so. After a scan, binary file information is stored in a separate result CSV (BinaryLibraries.csv) which needs to be uploaded along with the other CSV results.

Structure & Definition of the Analysis Output File

Every output file has three segments: Output File Attributes, Section Attributes, and File Attributes.

Customer data is never sent over the internet by e-mail or any other protocol. The result of the code-level analysis performed by the Code Reader on client infrastructure is uploaded to the website over HTTPS and encrypted in transit using a 256-bit encryption mechanism. The Code Reader produces several types of CSV result files — all readable, so feel free to open them and inspect their structure and content.

Output File Attributes

AttributeDefinition
app_versionIdentifies the version of the analyzed application
version_countIdentifies the version of the Code Reader
app_typeIdentifies the type of analysis
base_nameOutput file name as specified by the user
csv_base_filenameOutput file name
version_HighlightCAST Highlight Code Reader version number
start_dateAnalysis date
uuidCAST Highlight UUID identifier of the current file

Section Attributes

The section data defines the file structure for the specific analyzer along with additional analyzer attributes. Scan metrics are anonymized (e.g. Id_123) and decoded by the portal once the file has been uploaded.

File Output Structure Example

[Dat_FileName;Dat_Language;Dat_AnalysisDate;Dat_AnalysisStatus;Dat_AbortCause;Dat_AnaModel;Dat_Lines;Nbr_Lines;Id_008;Id_010;Id_011;Id_014;Id_029;Id_033;Id_037;Id_049;Id_064;Id_072;Id_078;Id_082;Id_083;Id_084;Id_095;Id_102;Id_104;Id_105;Id_108;…]

File Output Attribute Definitions

AttributeDefinition
Dat_FileNameFile name
Dat_LanguageProgramming language analyzed
Dat_AnalysisDateDate of the analysis
Dat_CRCLegacy fingerprint based on file content
Dat_SHA256Fingerprint based on content
Dat_AnalysisStatusReports the analysis status
Dat_AbortCauseReports the cause of failure
Dat_AnaModelReports the model of the count
Dat_LinesNumber of lines of code analyzed
Nbr_LinesNumber of lines of code analyzed
Id_#Reports alarm counts against specific rules per analyzer. Parsed as part of the reporting process to derive CAST Highlight risk ratings.

A file summary is generated for each file analyzed, following the Section format above. Example:

(ejb/AuthorsBean.java;Java;20120702113949;0;None;unspecified;33;33;0;6;0;0;112;3;0;0;0;0;0;0;0;1;0;1;1;0;1;0;0;2;0;0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;45;0;0;3;0;0;1;0;3;0;1;0;0;0;0;5;21;0;1;0;0;0;1;9;0;2;)

Code Scan Troubleshooting & Support

Known Limitations

Long paths on Windows

If you're scanning files whose full path (directories + file name) exceeds 260 characters, the scan will likely interrupt. Workaround: reduce the length of the path.

Need help?

Save analysis logs with "Save Logs for Support" and share them with the CAST Support team for the fastest resolution.