How are stats calculated? (crit, haste, etc.)

I was wondering where the calculations for stats like crit, haste and others are calculated.

As far as I can tell, it’s calculated in the StatSystem.cpp

I just can’t seem to spot where the players level is included in the calculation.

200 haste rating translates to (more or less, just an example):

Level 10 = 50% haste

Level 20 = 25% haste

Where is the players level included in the calculation in the core?