java - Does SonarQube 5.6 executes Decorators in plugins developed with sonar-plugin-api version 4.5.2? -


i installed sonarqube 5.6, , download c# plugin.

i decide extend c# plugin, proceed download code of plugin installed (version 5.3.2).

the c# plugin project has reference sonar-plugin-api version 4.5.2

i add new metrics require calculated project level, therefore, , following documentation, create decorator.

public class csharpmydecorator implements decorator{     private static final logger log = loggerfactory.getlogger(csharpmydecorator.class);      @override     public boolean shouldexecuteonproject(project arg0) {         // todo auto-generated method stub         return true;     }      @override     public void decorate(resource resource, decoratorcontext context) {          log.info(resource.getname() + " project: " + scopes.isproject(resource) +" project not module:" + qualifiers.isproject(resource, false));           if (scopes.isproject(resource) && qualifiers.isproject(resource, false)) {             double files = 0d;             double percentage = 0d;             log.info("files: "+context.getmeasure(coremetrics.files).getvalue());              (measure measure : context.getchildrenmeasures(mymetrics.files_dont_pass_function_threshold)) {                 files += measure.getvalue();             }              percentage = files / context.getmeasure(coremetrics.files).getvalue();             context.savemeasure(mymetrics.perc_files_dont_pass_function_threshold, percentage);         }      }  } 

i add class in plugin :

public class csharpplugin extends sonarplugin {    public static final string language_key = "cs";   public static final string language_name = "c#";    public static final string file_suffixes_key = "sonar.cs.file.suffixes";   public static final string file_suffixes_defvalue = ".cs";    public static final string csharp_way_profile = "sonar way";    public static final string repository_key = "csharpsquid";   public static final string repository_name = "sonarqube";    public static final string ignore_header_comments = "sonar.cs.ignoreheadercomments";   public static final string number_function_threshold = "sonar.cs.numberfunctionthreshold";   public static final string number_loc_threshold = "sonar.cs.numberlocthreshold";    @override   public list getextensions() {     immutablelist.builder builder = immutablelist.builder();      builder.add(       csharp.class,       csharpsonarrulesdefinition.class,       csharpsonarwayprofile.class,       csharpcommonrulesengine.class,       csharpcommonrulesdecorator.class,       csharpsourcecodecolorizer.class,       rulerunnerextractor.class,       csharpsensor.class,       csharpcpdmapping.class,       sonarlintprofileexporter.class,       sonarlintfakeprofileimporter.class,       roslynprofileexporter.class,       mymetrics.class,       csharpmydecorator.class       );      builder.addall(csharpfxcopprovider.extensions());     builder.addall(csharpcodecoverageprovider.extensions());     builder.addall(csharpunittestresultsprovider.extensions());     builder.addall(csharpmsbuildintegrationprovider.extensions());     builder.addall(roslynprofileexporter.sonarlintrepositoryproperties());      return builder.build();   }  } 

when execute analysis, neither metrics created, nor measure stored.

reviewing log generated (i enabled verbose option), not found reference decorators execution. not log entries expected code in decorator.

i using msbuild.sonarqube.runner.exe version 2.0

why decorators not called? issue version of sonarqube?

the extension point decorator dropped in version 5.2 not designed 1 of wanted features of series 5.x : isolating scanners database.

more details can found @ http://docs.sonarqube.org/display/dev/api+changes , in group https://groups.google.com/forum/#!forum/sonarqube.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -