SONAR-3755 improve SQL requests by using inner joins
Add debug logs in dev mode
SONAR-3755 fix NPE