I want to gather a few statistical data about a repository to compare it through time. The goal is to know how the usage of specific languages evolved over time, and how the complexity and size of different projects grew or shrank.
There is a great tool called cloc
which measures lines of code in different languages. It's a good start, but LOC measure is not very representative. I would like to gather better measures such as, to begin with, logical lines of code and function points, and eventually the cyclomatic complexity.
There are tools for that too:
Python has an excellent
radon
library which gives LLOCs, cyclomatic complexity, etc., and make it possible to indirectly determine the number of function points.C# has, obviously, Visual Studio's Code Metrics which also gives detailed information, including ILLOC which, unlike LOC, is quite representative of the size of a project, as well as cyclomatic complexity.
JavaScript has
complexity-report
which also makes it possible to compute the number of function points, as well as the LLOC and cyclomatic complexity.PHP seems to have a tool too, which gives both LLOC and the number of function points, as well as cyclomatic complexity, and other information.
What I can't find is a similar tool for Bash. There is a well known ShellCheck static analysis tool, but this is not what I want: ShellCheck rather searches for possible issues with the code, similarly to JavaScript's jslint
and C#'s Code Analysis.
So:
Is there a tool which, similarly to
cloc
, shows LLOC, function points and cyclomatic complexity for dozens of languages?Or is there such a tool specifically for Bash scripts?
Note: I'm interested in a free tool which can be used from a Linux terminal, not paid products, and not online services or APIs.
cloc
and, more importantly, adds cyclomatic complexity, it lacks LLOC and function points. On the other hand, it's not clear to me if LLOC is really much more relevant than LOC for Bash, and function points may not be relevant either (for instance for large scripts containing no functions). I suggest that we wait for a few days for other answers, and if there are none, close my question as a duplicate.