Ohcount is a source code line counter and analysis library originally developed for Ohloh and used to generate code statistics reports.
It can examine individual source files or entire directory trees, detect the primary language family in a file, and break content down line by line into code, comments, and other elements. One of its strengths is handling files that mix languages, such as HTML documents containing embedded CSS and JavaScript.
This is free and open source software.
Key Features
- Counts source lines in individual files or whole directory trees.
- Detects the primary language family used by a source file.
- Handles multiple languages within a single file.
- Provides detailed source annotations on a line-by-line basis.
- Can find source files by language family.
- Includes Ruby bindings for accessing language detection features from applications.
- Also ships with a Python wrapper, although the wrapper is currently marked unsupported.
- Supports a large range of programming and markup languages.
Website: github.com/blackducksoftware/ohcount
Support:
Developer: blackducksoftware
License: GNU General Public License v2.0
Related Software
| Alternatives to cloc | |
|---|---|
| Tokei | Displays statistics about your code |
| scc | Fast accurate code counter with complexity calculations and COCOMO estimates |
| SLOCCount | Set of tools for counting physical Source Lines of Code |
| gocloc | A compact fast cloc tool seeking inspiration from Tokei |
| loccount | Re-implementation of David A. Wheeler’s sloccount tool in Go |
| loc | Rust implementation of cloc, but it’s more than 100x faster |
| tcount | Count your code by tokens and patterns in the syntax tree |
| sloc | Simple tool to count source lines of code written in CoffeeScript |
| polyglot | Command-line tool that determines project contents |
| enry | Programming language detector based on go-enry |
| Linguist | Assess a repository’s languages stats with github-linguist executable |
| CLOCTUI | TUI for CLOC |
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

