qax-os / goreporter

A Golang tool that does static analysis, unit testing, code review and generate code quality report.
Apache License 2.0
3.13k stars 273 forks source link

Does it provide an average final grade or Score? #80

Open leandromoreira opened 5 years ago

leandromoreira commented 5 years ago

I want to use it to fail the build pipeline, for instance let's say the "quality".

leandromoreira commented 5 years ago

I found Score at the text format (it's absent from json format) and then I use gnu/linux:

# if the score is lower than 65 it's going to return 1 otherwise it'll return 0
goreporter -p . -f text | grep Score | awk -F':' '$2 < 65 {print; err = 1} END {exit err}'

Is there any easier way?

leandromoreira commented 5 years ago

There are:

Quality and Score, what's the difference?

Does the score follows the rule:

//    +--------------------------------------------------+
//    |   issues    |               score                |
//    +==================================================+
//    | 5           | 100-issues*2                       |
//    +--------------------------------------------------+
//    | [5,10)      | 100 - 10 - (issues-5)*4            |
//    +--------------------------------------------------+
//    | [10,20)     | 100 - 10 - 20 - (issues-10)*5      |
//    +--------------------------------------------------+
//    | [20,40)     | 100 - 10 - 20 - 50 - (issues-20)*1 |
//    +--------------------------------------------------+
//    | [40,*)      | 0                                  |
//    +--------------------------------------------------+