[sonar-dev] NOSONAR tag does not work with sonar-css

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[sonar-dev] NOSONAR tag does not work with sonar-css

Tamás Kende
Hi all,

it seems the NOSONAR comments do not work with css plugin even if the ast scanner:

and the test:


look fine (or not?). 

Any idea what is wrong?

Thanks

Cheers

Tamas
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] NOSONAR tag does not work with sonar-css

Dinesh Bolkensteyn-2
Hi Tamas,

That's not sufficient, you also need to update the sensor to save the lines at which there were nosonar comments.



On Mon, May 18, 2015 at 12:43 PM, Tamás Kende <[hidden email]> wrote:
Hi all,

it seems the NOSONAR comments do not work with css plugin even if the ast scanner:

and the test:


look fine (or not?). 

Any idea what is wrong?

Thanks

Cheers

Tamas

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] NOSONAR tag does not work with sonar-css

Tamás Kende
Hi Dinesh,

thanks for the tip, I still cannot make it work (from the CssSquidSensor#save):
for (SourceCode squidSourceFile : squidSourceFiles) {
SourceFile squidFile = (SourceFile) squidSourceFile;

File sonarFile = File.fromIOFile(new java.io.File(squidFile.getKey()), project);
  if (sonarFile != null) {
noSonarFilter.addComponent(sonarFile.getKey(), squidFile.getNoSonarTagLines());
}
it seems to me the key is wrong. The sonarFile.getEffectiveKey is null for me, and the squidFile.getKey() or the sonarFile.getKey has no effect, I still see issues reported on the web ui. The squidFile.getNoSonarTagLines returns with the line numbers. 

On Mon, May 18, 2015 at 12:53 PM, Dinesh Bolkensteyn <[hidden email]> wrote:
Hi Tamas,

That's not sufficient, you also need to update the sensor to save the lines at which there were nosonar comments.



On Mon, May 18, 2015 at 12:43 PM, Tamás Kende <[hidden email]> wrote:
Hi all,

it seems the NOSONAR comments do not work with css plugin even if the ast scanner:

and the test:


look fine (or not?). 

Any idea what is wrong?

Thanks

Cheers

Tamas


Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] NOSONAR tag does not work with sonar-css

Dinesh Bolkensteyn-2
Is there a ticket to fix the NOSONAR behavior? Feel free to assign it to me.

There are indeed 2 different NoSonarFilter implementations, one that will work with File (the old resource API), and a new one that works with InputFile.


On Mon, May 18, 2015 at 2:59 PM, Tamás Kende <[hidden email]> wrote:
Hi Dinesh,

thanks for the tip, I still cannot make it work (from the CssSquidSensor#save):
for (SourceCode squidSourceFile : squidSourceFiles) {
SourceFile squidFile = (SourceFile) squidSourceFile;

File sonarFile = File.fromIOFile(new java.io.File(squidFile.getKey()), project);
  if (sonarFile != null) {
noSonarFilter.addComponent(sonarFile.getKey(), squidFile.getNoSonarTagLines());
}
it seems to me the key is wrong. The sonarFile.getEffectiveKey is null for me, and the squidFile.getKey() or the sonarFile.getKey has no effect, I still see issues reported on the web ui. The squidFile.getNoSonarTagLines returns with the line numbers. 

On Mon, May 18, 2015 at 12:53 PM, Dinesh Bolkensteyn <[hidden email]> wrote:
Hi Tamas,

That's not sufficient, you also need to update the sensor to save the lines at which there were nosonar comments.



On Mon, May 18, 2015 at 12:43 PM, Tamás Kende <[hidden email]> wrote:
Hi all,

it seems the NOSONAR comments do not work with css plugin even if the ast scanner:

and the test:


look fine (or not?). 

Any idea what is wrong?

Thanks

Cheers

Tamas



Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] NOSONAR tag does not work with sonar-css

Tamás Kende
Thanks for the tip, its fixed now, I used the new version first not the deprecated one. 

On Mon, May 18, 2015 at 3:06 PM, Dinesh Bolkensteyn <[hidden email]> wrote:
Is there a ticket to fix the NOSONAR behavior? Feel free to assign it to me.

There are indeed 2 different NoSonarFilter implementations, one that will work with File (the old resource API), and a new one that works with InputFile.


On Mon, May 18, 2015 at 2:59 PM, Tamás Kende <[hidden email]> wrote:
Hi Dinesh,

thanks for the tip, I still cannot make it work (from the CssSquidSensor#save):
for (SourceCode squidSourceFile : squidSourceFiles) {
SourceFile squidFile = (SourceFile) squidSourceFile;

File sonarFile = File.fromIOFile(new java.io.File(squidFile.getKey()), project);
  if (sonarFile != null) {
noSonarFilter.addComponent(sonarFile.getKey(), squidFile.getNoSonarTagLines());
}
it seems to me the key is wrong. The sonarFile.getEffectiveKey is null for me, and the squidFile.getKey() or the sonarFile.getKey has no effect, I still see issues reported on the web ui. The squidFile.getNoSonarTagLines returns with the line numbers. 

On Mon, May 18, 2015 at 12:53 PM, Dinesh Bolkensteyn <[hidden email]> wrote:
Hi Tamas,

That's not sufficient, you also need to update the sensor to save the lines at which there were nosonar comments.



On Mon, May 18, 2015 at 12:43 PM, Tamás Kende <[hidden email]> wrote:
Hi all,

it seems the NOSONAR comments do not work with css plugin even if the ast scanner:

and the test:


look fine (or not?). 

Any idea what is wrong?

Thanks

Cheers

Tamas