Tuesday, April 10, 2012

Sonar Java Web Client: Authors by line null

When running the following code on my Sonar, measure returns null. (Should return something on the lines of "1=author;2=author..."). However it works on nemo.sonarsource.org.

Other measures eg: violation work correctly on mine so this is probably not a question of faulty code. I suspect I need to configure Sonar somehow?

    private final Sonar sonar;

public String getAuthors(String resourceKey){
return getMeasure(resourceKey, "authors_by_line").getData();

private Measure getMeasure(String resourceKey, String measureName){
Resource resource = sonar.find(ResourceQuery.createForMetrics(
resourceKey, measureName));

Measure measure = resource.getMeasure(measureName);

return measure;

No comments:

Post a Comment