priv-kweihmann / multimetric

Calculate code metrics in various languages
zlib License
36 stars 13 forks source link

Multimetric calculcation incorrect #19

Open prajeeshkozhisseri opened 3 years ago

prajeeshkozhisseri commented 3 years ago

Multimetric is calculating incorrectly when the comments are added """ in this format. Pls advise what is the logic and how it is calculating.

This one we have noticed in python files

We see LOC is giving different values and we are unable to find out how this is done.

Regards,

priv-kweihmann commented 3 years ago

Please provide a sample set and what suppose to be wrong about the output. LOC is calculated in https://github.com/priv-kweihmann/multimetric/blob/master/multimetric/cls/metric/loc.py using pygments tokens - so if you think there is something wrong, feel free to write a patch

BradKML commented 2 years ago

@prajeeshkozhisseri is it possible for you to try out multiple pieces of code and see what other tokens needs to be added into the mix? That would be extremely useful.

Also to @priv-kweihmann could you brief me on tokens, and may how it addresses indent-based languages?

priv-kweihmann commented 2 years ago

@BrandonKMLee this tool is using https://pygments.org for tokenizing - so all languages supported by pygments should work here as well. I just tested it with C/C++. python, javascript and ruby, so there might be a few adjustments per language needed.