Counts blank lines, comment lines, and physical lines of source code in many programming languages.
cloc is a command-line utility that counts blank lines, comment lines, and physical lines of source code in many programming languages. It helps developers quantify codebase size, analyze project structure, and track changes over time by providing detailed language-specific metrics.
Software developers, team leads, and project managers who need to measure code volume, assess complexity, or generate reports for codebases across multiple languages and file formats.
Developers choose cloc for its accuracy, extensive language support, and portability—it runs anywhere Perl is available, requires no dependencies, and offers powerful diffing and output format options unmatched by simpler counters.
cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Recognizes hundreds of programming languages with precise filters to distinguish code from comments, as highlighted in the language-aware analysis feature.
Written entirely in Perl with no external dependencies, running on Linux, macOS, Windows, and other systems, making it highly portable as emphasized in the philosophy.
Counts code in files, directories, git repos, and archives like .tar and .zip, and outputs results in JSON, XML, CSV, and Markdown for easy integration, per the multi-format support.
Computes differences in code metrics between two versions of a codebase, useful for tracking changes over time, as detailed in the diff capabilities section.
The source version requires a Perl interpreter, which can be a barrier on Windows without ActiveState or Strawberry Perl, as noted in the installation instructions.
Has built-in timeouts (--diff-timeout) and file size limits (--max-file-size=100 MB), and may be slower than compiled alternatives for massive codebases, as hinted by the troubleshooting options.
Focuses only on counting lines, blanks, and comments without insights into code complexity, quality, or structure, unlike tools like Sonar or Ohcount.