Extend paths and write view for leaderboard

I have started to implement the leaderboard comparing the repositories
with each other by ranking them based on their average score.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Refactor repository average calculation into model

I have moved the method to calculate the repository score into the
repository model class where, to my mind, it belongs anyway. Also
I have renamed it from average_score to just score, because I think
whether the average, the median or some weighting is done should be
left to the implementation.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Fix code to make the new score accessible

Just fixed some code which prevented the new code form working. Score
cannot be a private method, I had to use the :: modifier to access the
correct repository class inside the Concerns::Repository and I had to
refactor the usage of average_score(repository).

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Implement leaderboard

Just finished the implementation of the leaderboard comparing the
repositories with each other based on their average score. I have
included some code into render the different score values from the
different metrics. This commit closes #10.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Make JavaScript code for repository map robust

Due to adding more and more often the repositories to the JavaScript
environment by using gon and the repository concern controller I am
facing JavaScript errors more often.

It is better to rely on a distinct namespace through HTML class
attribution. Hence, I have replaced the if check for gon with a
check for the jQuery selector.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Change source of scores for value normalization

Instead of starting with an empty array for the normalization of metric
scores, the array is initialized with the values passed to the method.
This way exceptions can be prevented, if there are no scores available.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>