-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On a directory of C files ccloc counts code lines as negative #2
Comments
Hey, could you run it by file and add the content of a file that gives a negative count. Or maybe the headers. The problem seems to be from the comment count. I guess there are some comment cases that I didn't account for. Like if there is a single line comment but marked with |
As the files are of a project I've no authorization to publicize, I'll investigate the corner cases you mention and report back asap. |
Using the regexp More specifically, the header file has nine of such lines, and the C files 13 lines each (one of them includes one with So I think this diagnostic of yours is confirmed for this project case. As an example of code you can inspect, I did the same experiment with Fabrizzio's wav https://github.com/fabrizzio-gz/wav, getting the following results:
Even if the blattant negative number don't appear still the difference is noticeable. |
In a project folder with 58 C files and two C header files, ccloc called as follows
D:\> ccloc . -l C "C Header"
reports:As a comparison, when the same set of files is counted with
cloc
, this is summary obtained:The total lines of the two counters match for C files, and within ten lines of the
wc
utility, however the rest of the metrics are very discrepant and the negative counts for code seems to be a bug of some sort.The text was updated successfully, but these errors were encountered: