ohcount
|
The Ohloh source code line counter
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 as published by the Free Software Foundation.
Ohcount is specifically licensed under GPL v2.0, and no later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Ohcount is a program for counting lines of source code. It was originally developed at Ohloh and used to generate the reports at www.ohloh.net
Ohcount supports multiple languages within a single file: for example a complex HTML document might include regions of both CSS and Javascript.
Ohcount has 4 main components:
The command line tool allows you to profile individual files or whole directory trees.
Ohcount is supported on Mac OSX 10.5 and Ubuntu 6.06 LTS. Other Linux environments should also work, but your mileage may vary. Windows is not supported.
Ohcount source code is available as a Git repository:
git clone git://ohcount.git.sourceforge.net/gitroot/ohcount/ohcount
In order to build Ohcount, the following is required:
Run the 'build' script to build Ohcount.
You may then link or copy 'bin/ohcount' to your system's PATH.
Building the Ruby extension of Ohcount requires:
You may then link or copy 'ruby/ohcount.{rb,so}' and 'ruby/gestalt{/,.rb}' to the appropriate places in your Ruby installation.
Building the Doxygen docs requires:
To measure lines of code, simply pass file or directory names to the bin/ohcount executable:
Directories will be probed recursively. If you do not pass any parameters, the current directory tree will be counted.
You can use the ohcount 'detect' option to simply determine the language family of each source file. The files will not be parsed or counted. For example, to find all of the Ruby files in the current directory tree:
The 'annotate' option presents a line-by-line accounting of the languages used in a source code file. For example:
More options can be found by typing:
See the Related Pages tab at the top of the page.
For more information visit the Ohloh website: https://sourceforge.net/projects/ohcount
You can reach Ohloh via email at: info@.nosp@m.ohlo.nosp@m.h.net