Download v 1.3



Counts total lines of code, lines of comments, and blank lines in all files which match the specified filters, optionally recursing into subdirectories. Use CSL with no command line arguments to see a list of options and copyright information..

The syntax used for detecting what is code and what is comment is selected using a command line argument and may be set to C++, Ada, FORTRAN Free Form, FORTRAN Fixed Form, Visual Basic or Matlab. 


Installation / Usage


Line count is based on the LF or CRLF terminated lines in the source file. Multiple commands on the same line are counted as one line, one command split across multiple lines is counted as multiple lines. This method is easier to process and is believed to gave a  better measure of code complexity than counting number of commands.

A comment line which contains no alphanumeric characters is not believed to help document the code and is therefore counted as blank. Where a line contains both code and comment, it is counted as code.

In C++ syntax, lines containing only { or ; are considered  blank. Lines containing only } are considered code. This is intended give closer alignment with other languages where the looping and branching structures have a terminating line of code such as "END IF".

In C++ syntax each line inside a block comment must contain one or more alphanumeric characters to be classed as comment. Lines which do not meet this criteria are classed as blank.

In FORTRAN Fixed syntax, lines must have characters between column 7 and 72 inclusive to be classed as code.  In FORTRAN Fixed syntax, Compaq Visual FORTRAN allows comments  to be started by a ! anywhere on the line, as per free form  syntax. This is not in the FORTRAN 77 specification and these lines will be counted as blank.

Note that all output is tab delimited for easy import into spreadsheets or other post processing tools.

Version History

Added directory exclusion and corrected /m clashs
Added summary output
Added "Bare" output and FORTRAN Fixed Form syntax
Original Release


page last updated: 2 November 2003