You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey i tried double check the results of the Tool with radon and stumbled across some huge differences in Comment Ratio.
I checked the source code and found this:
_n+=MetricBaseComments._specific[language] # pragma: no cover - bug in pytest-cov
forxintokens:
self.__overall+=len(str(x[1]))
ifstr(x[0]) in_n:
self.__comments+=len(str(x[1])) # pragma: no cover - bug in pytest-cov
I wanted to ask if my understanding is correct that you calculate the literal character length of the comment in comparison to the literal character length of the program?
The text was updated successfully, but these errors were encountered:
Yes, that is correct - it might be other tools base that on lines or something else, but for me the essence is characters belonging to comments against the characters of the whole file.
The ratio should be correct, but maybe not comparable to other tools.
In a nutshell that applies to all of the metrics, as it should only be used to compare two or more runs of the tool against each other to decide what is okay and what's not
Okay thanks for your answer. Yeah also a understandable decision.
Sure I also only expected that it is supposed to compare with itself. But as it calculates the maintainability index and for example the Microsoft one provides thresholds I wanted to roughly check if the calculations of the sub metrics are somewhat overlapping with what I would expect. And as I actually found it a good idea of the SEI index to increase it via comment ratio I bumped into the comments calculation.
Hey i tried double check the results of the Tool with radon and stumbled across some huge differences in Comment Ratio.
I checked the source code and found this:
multimetric/multimetric/cls/metric/comments.py
Lines 29 to 37 in 6853074
I wanted to ask if my understanding is correct that you calculate the literal character length of the comment in comparison to the literal character length of the program?
The text was updated successfully, but these errors were encountered: