Ohcount: a tool that parses and counts source code lines

oh count 1

If abstraction is common to both orientations of Nelio’s approach, the artist feels the need to create pieces that he describes as intermediaries to explore new nuances between these two movements of contemporary art and invite to follow a path that goes beyond the apparent dichotomies. The artist works in evolutionary and progressive series that he completes over time. A way to muddy the tracks without completely confusing the spectator and to intermingle divergent practices to make coexist, through the creative act, opposite ideas. In the same way, Nelio creates with the concern not to impose a definitive meaning on his works, in order to open them to the projections and interpretations of each. Suggest rather than demonstrate, question rather than explain: art is not a discourse, it is the language of the inexpressible, an aesthetic of lines, forms and colors that depicts our inner worlds and landscapes of our existential paradoxes.is like to analyze the content within the source code of your favorite applications This application may be quite interesting for more than one of you. The present day we are going to talk about a tool that will help us analyze the lines of code, as well as this same one it will show us the amount of lines that each file contains.

Ohcount is a free and open source application, It is licensed under the GNU General Public License Version 2 so it can be redistributed and / or modified. Ohcount is a simple command line utility that parses the source code and prints the number lines totals from a source code file.

It is not just a source code line counter, it also detects popular open source licenses, such as the GPL, within a large source code directory. Additionally, Ohcount can also detect code that targets a particular programming API, such as KDE or Win32.

This application identifies source code files in most programming languages common and prepares total code and comment counts. It can operate on individual files or entire directory trees.

oh count has two main components: a detector which determines the family of the main programming language used by a particular source file, and a parser which provides a line-by-line breakdown of the contents of a source file.

oh count it is quite useful for developers who want to analyze code written by themselves or by other developers, and check how many lines that code contains, what languages ​​have been used to write those codes, and the license details of the code, etc.

oh count

How to install Ohcount on Ubuntu 18.04 LTS and derivatives?

Although the source code of the application can be downloaded to compile, we have the facility that Ohcount can find it within the Ubuntu repositories.

If you want to install this application on your systems They must open a terminal Ctrl + Alt + T and we are going to execute:

sudo apt install ohcount

Once this is done, they will have the application installed on their system.

How to use Ohcount?

How to use this application is quite simple, If you want to know their parameters and what they do, you can type:

ohcount --help

Now to start using it, they simply have to be placed inside the main directory of the source code of the application that they want to analyze from a terminal.

And being inside the code directory analyze simply type:

ohcount

Although They can also indicate the path where they have the application simply type:

ohcount /ruta/a/el/codigo

Done this the application it may take a while to analyze and display results, this all depends on how big the source code is (files, folders, lines).

If only we want to analyze a single file we must indicate it For this we can do it in the following way, taking, for example:

ohcount helloworld.c

In the case of wanting search only a single programming language within all code files source to analyze we can perform a combination, for example:

ohcount --detect | grep ^ Python

Si we want to see the source code inside a file We only have to add the parameter -a:

ohcount -a helloworld.c

As well we can perform a combination where we are going to search within all the files for a single language programming and show us the content within the files.

ohcount helloworld.c --detect | grep ^ C

As mentioned the application also allows us to see the source code licenses so if you only want to know the license used in the source code, we are going to type:

ohcount -l

If that's the case only for a single file:

ohcount -l helloworld.c

Finally, to find all source code files within recursively given paths, use the -d parameter:

ohcount -d

This tool can be quite interesting when performing a combination of parameters to obtain more specific results.


Be the first to comment

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.