priv-kweihmann/multimetric

pylint and coverage

Closed this issue · 5 comments

Hello!

Thanks for this tool: wonderful work!

I do have a question about how pylint and coverage works. Do you have a more exhaustive example?

Thanks,
Rui

This tool just imitates the same formula used by pylint 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) to calculate a score.
The classifications from above forluma are done here

def __getError(self, metrics):

There is no real usage of pylint in the background.
Does that answer your question?

So, one would have to pass the Pylint's report to multimetric, is it?

no no, I just found one usage of the coverage information ->

def __getTiobeCoverage(self, metrics):

basically you need to pass a file containing information about the given coverage from any tool you like to this tool.
As the README states this can be either a csv or a json

csv: CSV file of following line format
     <file>,<content>,<severity>

json: JSON file
     <file>: {
         "content": <content>,
         "severity": <severity>
     }

which makes it for the case of coverage information something like

file1.c,45.9
file2.h,80.9

or as a json

[
 "file1.c": { "content": 45.9 },
  "file2.h": { "content": 80.9 }
]

where those values are coming from is up to you.

In case you'd like to import from another tool in a different format, I'd happy about PRs :-)

This is great! Thanks.

Regarding pylint, just checking my understanding: you need to run pylint and map the results to a csv/json in order for it to be used by multimetrics. Is my understanding correct?

Correct