Add sonar support.
Sonar issues fixed.