-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(HIS): add COMF his metric #77
base: wip/his-metrics
Are you sure you want to change the base?
Conversation
be420a9
to
c3679fc
Compare
c1452fe
to
4a2edbb
Compare
Signed-off-by: Afonso Santos <afomms@gmail.com>
Signed-off-by: Afonso Santos <afomms@gmail.com>
da904be
to
93d77c1
Compare
Signed-off-by: Afonso Santos <afomms@gmail.com>
93d77c1
to
6a8f110
Compare
Updated with the modifications introduced in #68 and changed the output format. @miguelafsilva5 @josecm |
I don't know if I'm doing anyhing wrong, but this checker seems to be ignoring inline comments. For example:
|
That's actually a good point that I didn't take into account. From my analysis, neither pygount, slocount, cloc, tokei, analyzo, or cocnt count inline comments, which is a problem. They consider those lines as a source code line. |
This PR introduces the feature of checking the comment density within a file.
A file must have a minimum comment density of 0.2.
Two tools are used in this checker. The
pmccabe
counts the number of statements and thepygount
counts the number of comments.According to the HIS metrics, the comment density is given by the relationship between the number of comments (outside of and within functions) to the number of statements.
So the density is calculated by dividing the total comments (in the file) by the total number of statements (in the file).
As the comments tool also counts the license comments, I have created a variable
license_comment_size
to remove these comments from the density metric.Edited by @danielRep :
To test with https://github.com/bao-project/bao-his-tests just run the command
make ci METRIC=comf
.Checklist: