Quantcast

[Sonar 2.11] Question on Sonar CPD Minimum tokens property

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Sonar 2.11] Question on Sonar CPD Minimum tokens property

racodond
Hi,
 
The following property is now deprecated: Minimum tokens
There's no way to specifiy this property in the new Sonar CPD? How does it work now?
 
Thank you
 
Regards,
 
David RACODON, Logica, Software Quality Center

Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Sonar 2.11] Question on Sonar CPD Minimum tokens property

Evgeny Mandrikov
Hi,

PMD CPD is token based, so "minimum tokens" makes sense for it.
For the moment Sonar CPD is able to detect duplicates of Type 1 - identical code fragments except for variations in whitespace, layout, comments and constants. And Sonar CPD is a statement and block based, so "minimum tokens" not used in it. Minimum size of a detectable duplication is 10 statements. According to our tests this gives a good precision, which in fact better than in PMD CPD.

On Tue, Oct 4, 2011 at 01:08, Racodon, David <[hidden email]> wrote:
Hi,
 
The following property is now deprecated: Minimum tokens
There's no way to specifiy this property in the new Sonar CPD? How does it work now?
 
Thank you
 
Regards,
 
David RACODON, Logica, Software Quality Center

Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [Sonar 2.11] Question on Sonar CPD Minimum tokens property

racodond

Hi Evgeny,

 

Thanks for this explanation and the threshold I was interested in (10 statements minimum).

 

Regards,

 

David Racodon | Logica | Software Quality Center Team Leader

 

De : Evgeny Mandrikov [mailto:[hidden email]]
Envoyé : mardi 4 octobre 2011 08:22
À : [hidden email]
Cc : Francois, David
Objet : Re: [sonar-user] [Sonar 2.11] Question on Sonar CPD Minimum tokens property

 

Hi,

 

PMD CPD is token based, so "minimum tokens" makes sense for it.

For the moment Sonar CPD is able to detect duplicates of Type 1 - identical code fragments except for variations in whitespace, layout, comments and constants. And Sonar CPD is a statement and block based, so "minimum tokens" not used in it. Minimum size of a detectable duplication is 10 statements. According to our tests this gives a good precision, which in fact better than in PMD CPD.

 

On Tue, Oct 4, 2011 at 01:08, Racodon, David <[hidden email]> wrote:

Hi,

 

The following property is now deprecated: Minimum tokens

There's no way to specifiy this property in the new Sonar CPD? How does it work now?

 

Thank you

 

Regards,

 

David RACODON, Logica, Software Quality Center


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



 

--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [Sonar 2.11] Question on Sonar CPD Minimum tokens property

Bernhard Pieber
Is this threshold configurable somehow?

Cheers,
Bernhard
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [Sonar 2.11] Question on Sonar CPD Minimum tokens property

Freddy Mallet
Hi Bernhard,

By default, a duplication is reported as soon as 10 successive java lines are duplicated, but you can tune this threshold with the property "sonar.cpd.java.minimumLines"

So for instance "mvn sonar:sonar -Dsonar.cpd.java.minimumLines=30" to report a duplication only when 30 successive java statements are duplicated.

Kind regards
-----
Sonar for Continuous Inspection



On Fri, Sep 7, 2012 at 5:19 PM, Bernhard Pieber <[hidden email]> wrote:
Is this threshold configurable somehow?

Cheers,
Bernhard



--
View this message in context: http://sonar.15.n6.nabble.com/Sonar-2-11-Question-on-Sonar-CPD-Minimum-tokens-property-tp3180323p5002809.html
Sent from the Sonar user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [Sonar 2.11] Question on Sonar CPD Minimum tokens property

Görge Albrecht
This post has NOT been accepted by the mailing list yet.
Hi Freddy,

thank you for your quick response.
Is there a documentation available for all possible sonar properties?

I added the the property to my sonar-project.properties like below without any effect.
sonar.cpd.java.minimumLines=3

Any ideas?

Thanks,
Görge
Loading...