WEEE-Open / sardina

Our developers' section stats, computed hic et nunc
3 stars 0 forks source link

Add language statistics and improvements to output readability #22

Closed alecello closed 3 years ago

alecello commented 3 years ago

Language statistics

Generate language statistics for each repository and globally, to show how much of our code is made by each language, in percentage.

How

Both report a list (sorted in descending order) of langauges used in a given dataset: GitHub reports the number of bytes whereas CLOC reports number of lines, but since we're interested in percentages, both are fine

The result is the generation of a new pie chart for each repository (plus a global one) with the language distribution.

When

Language statistics are always generated when SLOCs are counted with cloc, since in that case those statistics are basically free by further parsing CLOC's output.

If SLOCSs are counted with wc or not counted at all, the user can specify the new --lang command line argument to have the script fetch those informations from GitHub's APIs. Of course I also added a complementary --no-lang that skips language generation.

Note that since CLOC's output is much more detailed than GitHub's APIs, it always takes precedence: if CLOC is being used then the --lang and --no-lang options are ignored and if neither is provided, the prompt asking the user wether they want to generate language statistics is skipped.

Documentation

I updated the combined.svg used in the README and removed the other two unused SVGs Also i changed the README to reflect the new command line arguments. I also made some somewhat random changes here and there, the bigger one being in the usage instructions. These changes have various reasons behind them but are mostly subjective and stylistic, so have a look at them and let me know if the changes are appreciated.

Output

I made some changes to the output the program produces: