Skip to main content

CxCMDLineCounter - Count Lines of Code

When uploading a project for scanning, and you would like to know how many lines of code (LOC) are to be scanned, you can use Checkmarx's Cx CMD Line Counter utility.

Notice

Note that for JavaScript code the counted lines of code result may not be entirely accurate until after the first scan is performed.

To count the lines of code for a project:

1. Download and extract the zipped CxCmdLineCounter.exe. from Checkmarx Utilities.

2. Open the Command Line Interface (CMD) window and navigate to the folder that contains the CxCmdLineCounter.exe

3. Run:

CxCmdLineCounter [Project Folder] [Result File Path]\[FileName.txt]
where <Project Folder> is the source code folder, and [Result File Path]\[FileName.txt] is the path and file name to the output txt file to be created  

For example:

CxCmdLineCounter.exe c:\Projects\TestProject c:\Projects\TestProject.txt

Using the example above creates a file named "TestProject.txt" in the projects folder that has the number of counted lines of the entire code under "C:\projects\TestProject".