是否可以在插件中访问sonarqube分析结果?

时间:2014-01-17 11:28:58

标签: plugins sonarqube

根据声纳日志,我看到声纳首先运行传感器,然后运行装饰器,然后将分析结果存储到数据库中。是否可以在声纳插件中访问分析结果?

由于

2 个答案:

答案 0 :(得分:0)

Sonar Web应用程序可在localhost:9000(或安装在何处)获得。

Eclipse还有一个插件可以查看问题: http://docs.codehaus.org/display/SONAR/SonarQube+in+Eclipse

答案 1 :(得分:0)

我终于在这里找到了解决问题的方法 http://sonarqube.15.x6.nabble.com/sonar-dev-Where-can-I-find-new-issue-information-on-sonar-db-td5021022.html

// this annotation is important to be sure that relevant data on issues are up-to-date.
@DependsUpon(DecoratorBarriers.ISSUES_TRACKED)
public final class MyDecorator implements Decorator {
  private final ResourcePerspectives perspectives;

  public TechnicalDebtDecorator(ResourcePerspectives perspectives) {
    this.perspectives = perspectives;
  }

  public void decorate(Resource resource, DecoratorContext context) {
    Issuable issuable = perspectives.as(Issuable.class, resource);
    if (issuable != null) {
      List<Issue> issues = issuable.issues();
      // Issue has method isNew()
    }
  }
}