how to enable verbose logs in sonarlint eclipse

1,584 views
Skip to first unread message

bogguri...@gmail.com

unread,
Nov 30, 2017, 12:17:52 AM11/30/17
to SonarLint
Hi,
I installed sonarlint in my eclipse.but sonarlint analysis results are different with sonarqube server analysis results.
One rule which is showing in sonarqube server in the same file in eclipse it is not showing.
Is it sonarLint bug or what?
I wanted to enable verbose logs for sonarlint, to see analysis results.Where is that option?

Julien HENRY

unread,
Nov 30, 2017, 3:40:13 AM11/30/17
to bogguri...@gmail.com, SonarLint
Hi,

If this rule is coming from a non SonarSource analyzer (PMD/Findbugs/Checkstyle) then this is expected to not be reported by SonarLint.

To enable verbose/analysis logs, open SonarLint Console in Eclipse, and there is a menu in the toolbar.

++

Julien Henry | SonarSource

Developer

https://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/227dd3ba-0c97-42bb-8a47-502665e67a2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Julien HENRY

unread,
Nov 30, 2017, 4:53:55 AM11/30/17
to Sravani Mohan, SonarLint
OK, then it should be reported by SonarLint.

Could you please enable verbose + analysis logs, then reopen the file in Eclipse and show us the log output?

Julien Henry | SonarSource

Developer

https://sonarsource.com


2017-11-30 10:20 GMT+01:00 Sravani Mohan <bogguri...@gmail.com>:
Hi Henry,

Thank you for your valuable response.

But my rule is not coming from non SonarSource analyzer((PMD/Findbugs/Checkstyle) as said by you rule is started with squid: , Means it is coming from SonarJava rule.
Then it should also come in sonarlint but not happening. Doesn't this rule reported by SonarLint? Could you please clear my issue it will be greatly helpful to me.Thanks in advance.

FYR : I  am getting below blocker in sonarqube server, but in eclipse.I have highlighted the rule in image.

Inline image 1

On Thu, Nov 30, 2017 at 2:33 PM, Julien HENRY <julien...@sonarsource.com> wrote:
Open the rule description, and look for it's key. If the key looks like squid:xxxx then this is a SonarJava rule. If the key looks like pmd:xxx or checkstyle:xxx or findbugs:xxx then...

You can also filter rules by repository:

Julien Henry | SonarSource

Developer

https://sonarsource.com


2017-11-30 9:57 GMT+01:00 Sravani Mohan <bogguri...@gmail.com>:
Hi,

How can I know whether the rule is coming from a non SonarSource analyzer (PMD/Findbugs/Checkstyle). Could you please let me how to check it in sonarqube server.
And also is there any way to see list of sonarlint rules in eclipse.

Sravani Mohan

unread,
Nov 30, 2017, 5:08:18 AM11/30/17
to Julien HENRY, SonarLint
Sorry Henry,

Could you please educate me how to enable it, I can see only eclipse console, and analyzation logs are coming in this.Is that only you are talking about?
 
FYR:
Inline image 1

Sravani Mohan

unread,
Nov 30, 2017, 5:50:13 AM11/30/17
to Julien HENRY, SonarLint
Hi Henry,

I have enabled verbose and analysis logs and analyzed only for that class.
Now I am getting few logs sharing with you below.

Trigger: MANUAL
SonarLint analysis of file /TTT_Reloaded/ttt/eDynamo/servlets/remoteexplorer/RemoteDownloadServletToCVS.java...
Connected mode (using configuration of 'uirnr' in server 'hldbtest.global.triniti.com')
Starting analysis with configuration:
[
  moduleKey: uirnr
  baseDir: D:\workspace\TTT_Reloaded
  workDir: D:\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\TTT_Reloaded\org.sonarlint.eclipse.core
  extraProperties: {sonar.java.source=1.6, sonar.java.target=1.6, sonar.libraries=C:\Program Files (x86)\Java\jdk1.6.0_33\jre\lib\resources.jar,sonar.binaries=D:/workspace/TTT_Reloaded, sonar.java.binaries=D:/workspace/TTT_Reloaded, sonar.java.test.binaries=D:/workspace/TTT_Reloaded}
  inputFiles: [
    D:\workspace\TTT_Reloaded\ttt\eDynamo\servlets\remoteexplorer\RemoteDownloadServletToCVS.java (UTF-8)
  ]
]

Extension com.B.plsql.XYZ.A.B.E was blacklisted as it is not used by SonarLint
Extension com.B.plsql.XYZ.A.C$_A was blacklisted as it is not used by SonarLint
Available languages:
  * Java => "java"
  * JavaScript => "js"
  * PL/SQL => "plsql"
Start analysis
Declared extensions of language Java were converted to java: **/*.java,**/*.jav
Declared extensions of language JavaScript were converted to js: **/*.js
Declared extensions of language PL/SQL were converted to plsql: **/*.sql,**/*.pks,**/*.pkb,**/*.pck
Quality profiles:
  * java: java-sonar-way-41848 (272 rules)
  * js: js-sonar-way-67486 (90 rules)
  * plsql: plsql-on-semi-51127 (164 rules)
Index files
Language of file 'file:/D:/workspace/TTT_Reloaded/ttt/eDynamo/servlets/remoteexplorer/RemoteDownloadServletToCVS.java' is detected to be 'java'
Setting filesystem encoding: UTF-8
1 files indexed
'JavaScript Squid Sensor' skipped because there is no related file in current project
'PL/SQL Sensor' skipped because there is no related file in current project
Execute Sensor: JavaSquidSensor
Configured Java source version (sonar.java.source): 6
JavaClasspath initialization
JavaClasspath initialization (done) | time=6ms
JavaTestClasspath initialization
JavaTestClasspath initialization (done) | time=5ms
Java Main Files AST scan
1 source files to be analyzed


Java Main Files AST scan (done) | time=307ms
1/1 source files have been analyzed
Java Test Files AST scan
0 source files to be analyzed
Java Test Files AST scan (done) | time=0ms
Execute Sensor: XmlFileSensor
0/0 source files have been analyzed
Found 15 issue(s)
Download server issues for /TTT_Reloaded/ttt/eDynamo/servlets/remoteexplorer/RemoteDownloadServletToCVS.java
Done in 1058 ms

Sravani Mohan

unread,
Dec 1, 2017, 4:34:22 AM12/1/17
to Julien HENRY, SonarLint
Hi Henry,

Could you please look at logs what I shared with you as I could not identify the problem.

Julien HENRY

unread,
Dec 1, 2017, 5:10:35 AM12/1/17
to Sravani Mohan, SonarLint
Hi,

I think your problem comes from classpath configuration. Some rules in SonarJava need the classpath to be accurate.

You project classpath look strange:
sonar.java.binaries=D:/workspace/TTT_Reloaded
sonar.java.test.binaries=D:/workspace/TTT_Reloaded

sonar.java.libraries is missing.

Are you manually passing some properties in SonarLint configuration? Is your project a regular JDT project?

++


Julien Henry | SonarSource

Developer

https://sonarsource.com


Sravani Mohan

unread,
Dec 1, 2017, 5:33:20 AM12/1/17
to Julien HENRY, SonarLint
Hi,
Thanks for the reply.
I am not passing any properties in SonarLint configuration.
Some rules in SonarJava need the classpath to be accurate.Means what is there any jars that make sonarlint to not work properly?
Actually, I have many jars in the classpath for my project in eclipse.I need them to make my code work.
That's why I haven't sent you all props in the logs.
So sending now.

Inline image 1




Julien HENRY

unread,
Dec 1, 2017, 6:16:07 AM12/1/17
to Sravani Mohan, SonarLint
Looks better :)

Can you precise the version of the SonarJava plugin installed on your SonarQube server?

Julien Henry | SonarSource

Developer

https://sonarsource.com


Sravani Mohan

unread,
Dec 1, 2017, 6:27:12 AM12/1/17
to Julien HENRY, SonarLint
Hi,

In eclipse sinarLint version is :

Inline image 2

In Sonarqube server version is:

Inline image 3

Julien HENRY

unread,
Dec 1, 2017, 6:34:59 AM12/1/17
to Sravani Mohan, SonarLint
Thanks, but I was asking for the version of the Java analyzer. You can get it by opening <your SQ server>/deploy/plugins/index.txt in a web browser.

Julien Henry | SonarSource

Developer

https://sonarsource.com


Sravani Mohan

unread,
Dec 1, 2017, 6:38:19 AM12/1/17
to Julien HENRY, SonarLint
Thanks for correcting me.
Here is the version:

css,sonar-css-plugin-2.2.jar|e03f8ffd3319f66794c2878e0a225d03
Sonargraph,sonar-sonargraph-plugin-3.5.jar|4cf8161f417979f8f50be191bfbe5aae
JSON,sonar-json-plugin-2.2.jar|c0cb78e259a29ddef8c1cfc4cbca40d6
jdepend,sonar-jdepend-plugin-1.0.jar|8331c7735c00e36efd86825fb072d475
widgetlab,sonar-widget-lab-plugin-1.8.1.jar|9f6a4179853f4671723c7678be2a3c59
javascript,sonar-javascript-plugin-2.21.0.4409.jar|b1cff89181542ee5e51e7fe4daf01740
plsql,sonar-plsql-plugin-2.8.jar|4f11de940237a1264dfb9423bf73bf89
javaProperties,sonar-jproperties-plugin-2.5.jar|8283024701503f74a37830b4ecd83a0c
findbugs,sonar-findbugs-plugin-3.4.4.jar|7a7e23b8349f980b13a640ae1ea7d769
csharp,sonar-csharp-plugin-5.0.jar|0911903f4040052c50e89e60b9a62f0d
java,sonar-java-plugin-4.6.0.8784.jar|33da67fa1386192fa926fd549b9ebda3
groovy,sonar-groovy-plugin-1.4.jar|b95c03925e049840d4158f42da4b1ef9
sonargraphintegration,sonar-sonargraph-integration-2.0.1.jar|277c75888bd4b8b54a44c58eeee83120
web,sonar-web-plugin-2.5.0.476.jar|eb6b889f561d214b51c8c57e338f8dd0
xml,sonar-xml-plugin-1.4.1.jar|3c591fa8fcbf0ef13a036e7857a1b2e6
rci,sonar-rci-plugin-1.0.1.jar|6dd7a2019f5ffce549846ecc3548c7f7
timeline,sonar-timeline-plugin-1.5.jar|bbd6b21fb738281b5dd42e793d01bb5f
checkstyle,sonar-checkstyle-plugin-2.4.jar|b6d3b7b37e9fb46c54221fcba58f32d6
genericcoverage,sonar-generic-coverage-plugin-1.2.jar|df67b75487c5584ae48c342734f2bd2e

Julien HENRY

unread,
Dec 1, 2017, 7:45:02 AM12/1/17
to Sravani Mohan, SonarLint
Any chance you could try with a more recent version of the sonar-java-plugin? Or also you can try in standalone mode (unbind your project) and see if SonarLint is reporting the issue.

Julien Henry | SonarSource

Developer

https://sonarsource.com


Sravani Mohan

unread,
Dec 4, 2017, 12:20:18 AM12/4/17
to Julien HENRY, SonarLint
Hi Henry,

SonarLint is not reporting this issues, only Sonarqube server showing this blocker.I haven't tried any other sonar-java -plugin.
Reply all
Reply to author
Forward
0 new messages