Quantcast

Technical Debt Plugin skips method complexity for non-Java languages

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

Technical Debt Plugin skips method complexity for non-Java languages

ms
Hi,

the SonarQube Technical Debt plug-in unfortunately seems to omit the method complexity value. The problem showed up in a comparison of the expected with the actually calculated Technical Debt value in a C# project.

Tracking down the issue I ended up in the "org.sonar.plugins.technicaldebt.ComplexityDebtDecorator": https://fisheye.codehaus.org/browse/sonar-plugins/trunk/technical-debt/src/main/java/org/sonar/plugins/technicaldebt/ComplexityDebtDecorator.java?r=6262

The problem seems to be line 90: Instead of adding the class complexity to the debt (means instead of using operator +=), the debt value is replaced with the class complexity value (operator = is used). Any debt that has been accumulated before (i.e. the method complexity values) is lost.

Best regards,
Matthias
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Technical Debt Plugin skips method complexity for non-Java languages

Freddy Mallet
Indeed Matthias, this is known limitation of this Technical Debt plugin to be only compatible with Java projects. Moreover the quality model implemented in this plugin is really too much simplistic. That's why we plan to quickly make SonarQube support the SQALE quality model out-of-the-box : http://jira.codehaus.org/browse/SONAR-4357 and to depreciate this Technical Debt plugin.

Kind regards,
Freddy


-----
SonarQube for Continuous Inspection


On Mon, Sep 2, 2013 at 9:27 PM, ms <[hidden email]> wrote:
Hi,

the SonarQube Technical Debt plug-in unfortunately seems to omit the method
complexity value. The problem showed up in a comparison of the expected with
the actually calculated Technical Debt value in a C# project.

Tracking down the issue I ended up in the
"org.sonar.plugins.technicaldebt.ComplexityDebtDecorator":
https://fisheye.codehaus.org/browse/sonar-plugins/trunk/technical-debt/src/main/java/org/sonar/plugins/technicaldebt/ComplexityDebtDecorator.java?r=6262

The problem seems to be line 90: Instead of adding the class complexity to
the debt (means instead of using operator +=), the debt value is replaced
with the class complexity value (operator = is used). Any debt that has been
accumulated before (i.e. the method complexity values) is lost.

Best regards,
Matthias



--
View this message in context: http://sonar.15.x6.nabble.com/Technical-Debt-Plugin-skips-method-complexity-for-non-Java-languages-tp5016569.html
Sent from the Sonar dev mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email



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

Re: [sonar-dev] Technical Debt Plugin skips method complexity for non-Java languages

ms
Hi,

> http://jira.codehaus.org/browse/SONAR-4357

good news!! But since this will be not available till version 4.1 at Christmas, is there a chance to get a quick fix for the plugin? As written above, it seems that only a "=" has to be replaced with a "+=".

With best regards,
Matthias
ms
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Technical Debt Plugin skips method complexity for non-Java languages

ms
Hi again,

I've tried the proposed change, but unfortunately it seems not to be sufficient. Maybe the method complexity is not counted in the "Scopes.isBlockUnit(resource)" condition (ComplexityDebtDecorator.java:74ff).  Any ideas are welcome!

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

Re: [sonar-dev] Technical Debt Plugin skips method complexity for non-Java languages

Waleri Enns
On 09/06/2013 12:17 PM, ms wrote:
> Hi again,
>
> I've tried the proposed change, but unfortunately it seems not to be
> sufficient. Maybe the method complexity is not counted in the
> "Scopes.isBlockUnit(resource)" condition
> (ComplexityDebtDecorator.java:74ff). Any ideas are welcome!

This '.isBlockUnit()' was already subject of other discussions AFAIR.
You may try to lookup the archives... From the top of my head: this
belongs to stuff which is only implemented by first class citizens (i.e.
Java and maybe C#).

>
> Matthias
>
>
>
>
> --
> View this message in context: http://sonar.15.x6.nabble.com/Technical-Debt-Plugin-skips-method-complexity-for-non-Java-languages-tp5016569p5016781.html
> Sent from the Sonar dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>      http://xircles.codehaus.org/manage_email
>
>


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

    http://xircles.codehaus.org/manage_email


Loading...