SonarLint should not be impacted by huge generated or insane source files

302 views
Skip to first unread message

Freddy Mallet

unread,
Aug 29, 2016, 10:58:52 AM8/29/16
to SonarLint
Hi Guys,

Based on the following question on StackOverflow : http://stackoverflow.com/questions/39175016/how-to-turn-off-sonarlint-automatic-triggering-on-intellij-idea and on the following core principle of SonarLint, I think something should be fixed  :  "SonarLint should just work out of the box"

When you're opening a huge/insane source file in your favorite IDE this might lead SonarLint to analyse this source file forever:
  • From a technical point of view, this is perfectly understandable that a huge source file requires a huge amount of time to be analyzed
  • But the developer doesn't care about that and doesn't want to be impacted -> which is also perfectly understandable
  • And requiring the developer to use the connected mode and to exclude this file from SonarQube in order to stop being impacted locally is for me not an acceptable solution
Why not implementing a solution like this one :
  1. When the analysis of a source file takes more than 10 seconds -> kill the analysis and report an error in the IDE error list saying that this source file can't be analyzed by SonarLint in a suitable amount of time -> please report this performance hotspot to SonarSource. 
  2. Keep locally this piece of information in memory and don't try to analyze again this source file as long as the IDE is not restarted
Any feedback is welcome
Freddy
--
Freddy MALLET | SonarSource
Product Director & Co-Founder
http://sonarsource.com

derek....@tpt.com

unread,
Aug 30, 2016, 5:34:46 PM8/30/16
to SonarLint
I'm the poster of the StackOverflow query.
In opinion, the use cases are
  1. you might want to kill a particular analysis, (this is already implemented)
  2. turn-off all analysis temporarily, 
  3. or turn-off analysis altogether and then trigger analysis by-hand. 
I need to perform this analysis prior to check-in as it is part of my team's commit checklist.
But, due to the length of some legacy files, I need to be able to trigger analysis. 
I definitely don't want the analysis to kill itself. The result would be that each keystroke would cause a 10-second analysis, followed by a thread kill.

duarte.meneses

unread,
Sep 1, 2016, 11:39:22 AM9/1/16
to SonarLint, derek....@tpt.com
I just noticed that you report in SOF that the option to disable the automatic analysis is not working.
I was able to easily reproduce and fix the bug, so it will work in the next version. You can track the fix here: https://jira.sonarsource.com/browse/SLI-106

Thanks for reporting it.

duarte.meneses

unread,
Sep 2, 2016, 12:08:03 PM9/2/16
to SonarLint, derek....@tpt.com
I've prepared a release candidate with the fix to the configuration of the automatic trigger (SLI-106).



Thanks
Reply all
Reply to author
Forward
0 new messages