Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sonar-cxx 0.9.3 doesn't show technical debt (issues) with sonar 4.5.x #519

Closed
Benoitlz opened this issue May 26, 2015 · 21 comments
Closed
Assignees
Milestone

Comments

@Benoitlz
Copy link

sonar-cxx 0.9.3 doesn't show technical debt (issues) with sonar 4.5.x analyzing cpp code.
My initial environment was Java 7, Sonar 4.5.2, sonar-cxx 0.9.2 is which I see the "Technical Debt" expressed in days.
I moved the environment to Java 8, Sonar 4.5.4, sonar-cxx 0.9.3 no "Technical Debt" displayed.
In this environment, if I put back sonar-cxx 0.9.2, run sonar-runner again, "Technical Debt" is displayed again.
Then in this environment, if I revert to sonar-cxx 0.9.3, run sonar-runner again, "Technical Debt" is NOT displayed.
I read issue #464. I see no difference in the sonar log file between 0.9.2 and 0.9.3.
Looking at http://docs.sonarqube.org/display/SONAR/Technical+Debt, I'm not sure that issues are not taken in account anymore (first line, third paragraph). All the Technical Debt in my projects comes from issues reported by Cppcheck.
Did I miss something or is something missing in 0.9.3 ?

@jmecosta
Copy link
Member

What issues are reported by the analysis?

On Tue, May 26, 2015, 17:32 Benoit Lanthemann [email protected]
wrote:

sonar-cxx 0.9.3 doesn't show technical debt (issues) with sonar 4.5.x
analyzing cpp code.
My initial environment was Java 7, Sonar 4.5.2, sonar-cxx 0.9.2 is which I
see the "Technical Debt" expressed in days.
I moved the environment to Java 8, Sonar 4.5.4, sonar-cxx 0.9.3 no
"Technical Debt" displayed.
In this environment, if I put back sonar-cxx 0.9.2, run sonar-runner
again, "Technical Debt" is displayed again.
Then in this environment, if I revert to sonar-cxx 0.9.3, run sonar-runner
again, "Technical Debt" is NOT displayed.
I read issue #464 #464. I see
no difference in the sonar log file between 0.9.2 and 0.9.3.
Looking at http://docs.sonarqube.org/display/SONAR/Technical+Debt, I'm
not sure that issues are not taken in account anymore (first line, third
paragraph). All the Technical Debt in my projects comes from issues
reported by Cppcheck.
Did I miss something or is something missing in 0.9.3 ?


Reply to this email directly or view it on GitHub
#519.

@Benoitlz
Copy link
Author

Thanks for your time!
I'm doing the tests with this issue: "Possible null pointer dereference" classified "major" (35 times)

@jmecosta jmecosta added this to the M 0.9.4 milestone May 26, 2015
@jmecosta jmecosta self-assigned this May 26, 2015
@jmecosta
Copy link
Member

cppcheck:nullPointer is not defined in sqale model. see here: https://github.com/wenns/sonar-cxx/blob/master/sonar-cxx-plugin/src/main/resources/com/sonar/sqale/cxx-model.xml

will be added for version 0.9.4

you can try with other rules, there should be debt

@Benoitlz
Copy link
Author

I extended my tests, still no Technical Debt computed. I have now the following issues:

  • Member variable is not initialized in the constructor
  • Buffer access out-of-bounds
  • Possible null pointer dereference
  • Wrong number of parameters given to printf()
  • Dereferencing variable after it is deallocated / released
  • Memory is freed twice
  • Memory leak

By the way in cxx-model.xml link above, I see nullPointer, memleak, doubleFree ...

@jmecosta
Copy link
Member

Ok that's odd, by any way did you mess up with database in past?

On Wed, May 27, 2015, 13:27 Benoit Lanthemann [email protected]
wrote:

I extended my tests, still no Technical Debt computed. I have now the
following issues:

  • Member variable is not initialized in the constructor
  • Buffer access out-of-bounds
  • Possible null pointer dereference
  • Wrong number of parameters given to printf()
    • Dereferencing variable after it is deallocated / released
    • Memory is freed twice
    • Memory leak

By the way in cxx-model.xml link above, I see nullPointer, memleak,
doubleFree ...


Reply to this email directly or view it on GitHub
#519 (comment).

@Benoitlz
Copy link
Author

I'm not sure what you mean by 'mess-up' ... I'm using mssql server, actually backed up my production instance and restored it on my test PC.
I have tried to change some of the Parameters in the SonarQube Admin settings -> Technical Debt parameter.
What still surprises me is that yesterday (which is after all the above), just by switching the plugin from 0.9.3 to 0.9.2, I got the Technical Debt displayed back ...

@jmecosta
Copy link
Member

How are you changing those debt parameters? Do you have the commercial
sqale plugin?

On Wed, May 27, 2015, 16:57 Benoit Lanthemann [email protected]
wrote:

I'm not sure what you mean by 'mess-up' ... I'm using mssql server,
actually backed up my production instance and restored it on my test PC.
I have tried to change some of the Parameters in the SonarQube Admin
settings -> Technical Debt parameter.
What still surprises me is that yesterday (which is after all the above),
just by switching the plugin from 0.9.3 to 0.9.2, I got the Technical Debt
displayed back ...


Reply to this email directly or view it on GitHub
#519 (comment).

@jmecosta
Copy link
Member

And can you install in a clean database. To rule out the analysis part

On Wed, May 27, 2015, 17:08 Jorge Costa [email protected] wrote:

How are you changing those debt parameters? Do you have the commercial
sqale plugin?

On Wed, May 27, 2015, 16:57 Benoit Lanthemann [email protected]
wrote:

I'm not sure what you mean by 'mess-up' ... I'm using mssql server,
actually backed up my production instance and restored it on my test PC.
I have tried to change some of the Parameters in the SonarQube Admin
settings -> Technical Debt parameter.
What still surprises me is that yesterday (which is after all the above),
just by switching the plugin from 0.9.3 to 0.9.2, I got the Technical Debt
displayed back ...


Reply to this email directly or view it on GitHub
#519 (comment).

@Benoitlz
Copy link
Author

No I don't have the commercial sqale plugin.
SonarQube Admin -> Settings -> Technical Debt -> Language specific parameter -> I added "CPP, 20, Lines of code", as well as Number of Working hours in a day: 8. Pls note that I've done all this after 0.9.3 failed to display debt and before my switches back and forth with 0.9.2

Today I used the "Provisionning" to remove all projects. Then I also deleted all databases using a script in SQL Server ... Was that enough? I'm not sure as the above "CPP, 20, Lines of code" did not go away!

Anyway after this still no Technical Debt ... Then I move to SonarQube 5.1, no change!

@jmecosta
Copy link
Member

I have not check this setting in the advance properties. But did you try
with a default database so without touching any settings. I would start
with the default database h2 run a analysis there. It should produce debt.

By the way what does this mean

CPP,20,lines of code

On Thu, May 28, 2015, 16:02 Benoit Lanthemann [email protected]
wrote:

No I don't have the commercial sqale plugin.
SonarQube Admin -> Settings -> Technical Debt -> Language specific
parameter -> I added "CPP, 20, Lines of code", as well as Number of Working
hours in a day: 8. Pls note that I've done all this after 0.9.3 failed to
display debt and before my switches back and forth with 0.9.2

Today I used the "Provisionning" to remove all projects. Then I also
deleted all databases using a script in SQL Server ... Was that enough? I'm
not sure as the above "CPP, 20, Lines of code" did not go away!

Anyway after this still no Technical Debt ... Then I move to SonarQube
5.1, no change!


Reply to this email directly or view it on GitHub
#519 (comment).

@jmecosta
Copy link
Member

CPP if this is the language of the plugin ours is c++, do you have the c++
paid plugin installed by any chance?

On Thu, May 28, 2015, 16:07 Jorge Costa [email protected] wrote:

I have not check this setting in the advance properties. But did you try
with a default database so without touching any settings. I would start
with the default database h2 run a analysis there. It should produce debt.

By the way what does this mean

CPP,20,lines of code

On Thu, May 28, 2015, 16:02 Benoit Lanthemann [email protected]
wrote:

No I don't have the commercial sqale plugin.
SonarQube Admin -> Settings -> Technical Debt -> Language specific
parameter -> I added "CPP, 20, Lines of code", as well as Number of Working
hours in a day: 8. Pls note that I've done all this after 0.9.3 failed to
display debt and before my switches back and forth with 0.9.2

Today I used the "Provisionning" to remove all projects. Then I also
deleted all databases using a script in SQL Server ... Was that enough? I'm
not sure as the above "CPP, 20, Lines of code" did not go away!

Anyway after this still no Technical Debt ... Then I move to SonarQube
5.1, no change!


Reply to this email directly or view it on GitHub
#519 (comment).

@Benoitlz
Copy link
Author

No I don't have the c++ paid plugin.
May be I should try c++,lines of code ? (I'm not sure how this works [we had good debt without touching this and 0.9.2], but assumed that for an issue that appeared in one line of code, it would add 30 minutes to the technical debt ).

Do you mean I should switch the database driver to the default one (not SQL Server) ?

@jmecosta
Copy link
Member

Yep but leave those settings untouched

On Thu, May 28, 2015, 16:21 Benoit Lanthemann [email protected]
wrote:

No I don't have the c++ paid plugin.
May be I should try c++,lines of code ? (I'm not sure how this works [we
had good debt without touching this and 0.9.2], but assumed that for an
issue that appeared in one line of code, it would add 30 minutes to the
technical debt ).

Do you mean I should switch the database driver to the default one (not
SQL Server) ?


Reply to this email directly or view it on GitHub
#519 (comment).

@Benoitlz
Copy link
Author

Tried with the default database (just switched in the config files, then analyze) ... no Debt Computed!
There are 36 Major issues (cppcheck nullPointer and memleak).

@jmecosta
Copy link
Member

both do not have debt associated with them.

image

other show like this:
image

and after checking some of my chars i also notice that those have been lost... i will investigate on my side,,,, this seems a major regression

@jmecosta
Copy link
Member

@Benoitlz i found the problem: can you confirm if this is working: https://bitbucket.org/jorge_costa/pluginsrepository/downloads/sonar-cxx-plugin-0.9.4-SNAPSHOT.jar

this is a big regression, @guwirth i think we need to release a bugfix release becasue all the sqale definitions are gone in new version.

reason is that core apparently does not read any more the definitions, instead we have to load them ourselfs. #521

@guwirth
Copy link
Collaborator

guwirth commented May 31, 2015

@jmecosta Is this closed with #521 ?

@jmecosta
Copy link
Member

jmecosta commented Jun 1, 2015

Lacks confirmation

On Mon, Jun 1, 2015, 00:05 Günter Wirth [email protected] wrote:

@jmecosta https://github.com/jmecosta Is this closed with #521
#521 ?


Reply to this email directly or view it on GitHub
#519 (comment).

@Benoitlz
Copy link
Author

Benoitlz commented Jun 1, 2015

Thanks for working on this issue.
Sorry, but the link 0.9.4-SNAPSHOT.jar does not work for me (looks like bitbucket.org is blocked by my organization).
I will try from home tonight.

Benoit Lanthemann

From: Jorge Costa [mailto:[email protected]]
Sent: 29 May, 2015 17:51
To: wenns/sonar-cxx
Cc: Benoit Lanthemann
Subject: Re: [sonar-cxx] sonar-cxx 0.9.3 doesn't show technical debt (issues) with sonar 4.5.x (#519)

@Benoitlzhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Benoitlz&d=BQMCaQ&c=uGuXJ43KPkPWEl2imVFDmZQlhQUET7pVRA2PDIOxgqw&r=zzJClB70YKkK3CkzdEILLOA7Rmz1n1lq_V4a7pGgcV8&m=-bjZNGIFM5uWGxILnyePUDrILSmPlrGzFWhfBjZa6iQ&s=7dFwekjMTyUTMY3stbfwyftu50eq8H3ZBwCBraKll8w&e= i found the problem: can you confirm if this is working: https://bitbucket.org/jorge_costa/pluginsrepository/downloads/sonar-cxx-plugin-0.9.4-SNAPSHOT.jarhttps://urldefense.proofpoint.com/v2/url?u=https-3A__bitbucket.org_jorge-5Fcosta_pluginsrepository_downloads_sonar-2Dcxx-2Dplugin-2D0.9.4-2DSNAPSHOT.jar&d=BQMCaQ&c=uGuXJ43KPkPWEl2imVFDmZQlhQUET7pVRA2PDIOxgqw&r=zzJClB70YKkK3CkzdEILLOA7Rmz1n1lq_V4a7pGgcV8&m=-bjZNGIFM5uWGxILnyePUDrILSmPlrGzFWhfBjZa6iQ&s=N9sr8K94Gg6nO0BMI3MUgb-w4m0t4FIHnq_or-V8nGM&e=

this is a big regression, @guwirthhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_guwirth&d=BQMCaQ&c=uGuXJ43KPkPWEl2imVFDmZQlhQUET7pVRA2PDIOxgqw&r=zzJClB70YKkK3CkzdEILLOA7Rmz1n1lq_V4a7pGgcV8&m=-bjZNGIFM5uWGxILnyePUDrILSmPlrGzFWhfBjZa6iQ&s=ETVm0Gom-rmf0vx3vkvcVUxhUPB7akVqAdS1DEEr48A&e= i think we need to release a bugfix release becasue all the sqale definitions are gone in new version.

reason is that core apparently does not read any more the definitions, instead we have to load them ourselfs. #521https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_wenns_sonar-2Dcxx_pull_521&d=BQMCaQ&c=uGuXJ43KPkPWEl2imVFDmZQlhQUET7pVRA2PDIOxgqw&r=zzJClB70YKkK3CkzdEILLOA7Rmz1n1lq_V4a7pGgcV8&m=-bjZNGIFM5uWGxILnyePUDrILSmPlrGzFWhfBjZa6iQ&s=fKy9-GlJ9hpQjJioHOuonXHnN0PMNSS2ccJIkOMLzvc&e=


Reply to this email directly or view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_wenns_sonar-2Dcxx_issues_519-23issuecomment-2D106854421&d=BQMCaQ&c=uGuXJ43KPkPWEl2imVFDmZQlhQUET7pVRA2PDIOxgqw&r=zzJClB70YKkK3CkzdEILLOA7Rmz1n1lq_V4a7pGgcV8&m=-bjZNGIFM5uWGxILnyePUDrILSmPlrGzFWhfBjZa6iQ&s=fU2MV-IQluJYJ-bs-tHz9Z_Wl4nYd3Rk6PcGwEKxYYM&e=.

@vic-trouble
Copy link

Hi

I'm having the same problem as @Benoitlz described and in my case installing the 0.9.4 preview helped technical debt to appear (I had to re-scan the project). My Sonar Server version is 5.1.

Thanks

Vic

@Benoitlz
Copy link
Author

Benoitlz commented Jun 2, 2015

0.9.4-SNAPSHOT.jar solves the problem of Technical Debt. t has now the same value as 0.9.3.
I tested with SonarQube 5.1, default and MSSQL databases.
Thanks for your help!

@jmecosta jmecosta closed this as completed Jun 3, 2015
@guwirth guwirth mentioned this issue Oct 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants