1

After upgrading Sonar to a newer version (5.6.1), we had our Public Api Documentation measure crash down to 40%

Looking on Sonar website, I found that there is a configuration key that define if the Getters & Setters are counted in the documentated Api : "sonar.squid.analyse.property.accessors"

http://docs.sonarqube.org/display/SONARQUBE50/Metrics+-+Public+API

But I cannot find where to check or update it from the Sonar Interface. So if anyone can shed some light ?

TheBakker
  • 2,852
  • 2
  • 28
  • 49

2 Answers2

0

First, the documentation you reference is the archived docs for an old version, 5.0, and not necessarily relevant to the version you're using.

Second, I'll bet that when you upgraded the platform, you upgraded the Java plugin too. 5.6.1 shipped with Java Plugin version 3.13.1, but you appear to be using version 4.0 or beyond. It was in 4.0 that the plugin stopped paying attention to accessors and removed the sonar.squid.analyse.property.accessors property: SONARJAVA-398

So yes, when it stopped paying attention to accessors, that would have changed your Undocumented API numbers.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • Thanks for your reply. I'm using Java plugin 4.1. I saw on your ticket that the parameter sonar.squid.analyse.property.accessors seems to have been removed because of complexity computation. Is it possible that this had the side effect to always take into account getters & setters for documented public api ? Or do you see any other reason why my project would have had its Public documented api % go from 98% to 47% right after updating Sonar and its plugins version ? – TheBakker Sep 21 '16 at 16:15
  • Greetings, I see you have edited your message and added that in fact it will now take into calculation the getters & setters. Are you sure it's the desired behavior ? It seems strange to go the opposite of the previous default value? – TheBakker Sep 22 '16 at 08:13
0

Ok after bothering the sonar people through Jira and google group, they have aknowledged the issue and created a ticket.

https://jira.sonarsource.com/browse/SONARJAVA-1857

Have to wait 4.3 of the java plugin though.

TheBakker
  • 2,852
  • 2
  • 28
  • 49