How to turn off SonarLint automatic triggering on IntelliJ IDEA - intellij-idea

Is there some way of turning-off automatic SonarLint analysis in Intellij IDEA?
I have some 10,000 to 20,000 lines-of-code classes (don't ask, not my fault, trying to refactor). Every time I edit even a single character in the class, the SonarLint plugin makes IDEA unusable for a few minutes.
It is not possible to save the "Automatically trigger analysis" checkbox in the unchecked state in Other Settings > SonarLint General Settings. Is there some other solution to my problem? I really want to use the plugin. I just can't use it in automatic mode.

For intellij:
Go to File -> Settings
New window will open
In new window
Expand tools -> locate SonarLint and click on it.
Under settings tab of SonarLint -> uncheck the box 'Automatically trigger Analysis'.

Go to File -> Settings -> Other Settings -> SonarLint General Settings then
uncheck the Automatically trigger analysis check box

There was a bug in SonarLint for IntelliJ that prevented the configuration to be properly saved.
It was fixed in the latest version 2.3.2:
https://jira.sonarsource.com/browse/SLI-106
About the performance, please make sure you are using the Java analyzer 4.2, as you might be experiencing this problem: https://jira.sonarsource.com/browse/SLI-100.
It is embedded in the latest SonarLint, but if you use the connected mode, you also need to check which version of the Java analyzer is installed in the SonarQube server.
We are always trying to improve performance, so feel free to open a topic in the SonarLint Google group with the verbose analysis log so that we can investigate why it takes so long to analyze the file.

In Android Studio 3.5.2:
Go to File -> Settings -> Tools -> SonarLint -> Settings(Tab) then uncheck the Automatically trigger analysis check box.

Related

How can a disabled SonarLint rule be re-enabled in IntelliJ?

I disabled a SonarLint rule in IntelliJ, and then decided that it was a mistake. I disabled the rule using the popup in the editor:
What is the easiest and safest way to re-enable the rule?
The file sonarlint.xml in ~/Library/Application Support/JetBrains/<product><version>/options/ (on Mac, similar for other platforms) holds the information about the disabled rules. I can probably edit it manually, but it would feel safer with a GUI tool to do it.
Is there a better way to re-enable the rule?
I found it. The setting is in Preferences -> Tools -> SonarLint, and NOT in the sub-section Tools -> SonarLint -> Project Settings, where I had looked previously.
Easiest in my case, was to filter the settings by "Show Only Changed":

IntelliJ Run Configuration Broken by an Incompatible Plugin I Can't Uninstall?

I had been developing an application on a trial version of IntelliJ 2016 Ultimate. Since the trial version ran out, I resumed work using the Community Edition. However, trying to launch my application yielded the following error:
Unknown run configuration type #com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory
"No problem" I thought, just an incompatible plugin that was installed with Ultimate that I don't really need anyway. I opened the Plugins section of the Preferences menu, but I can't find the plugin in question. Below is a partial screenshot of the plugin list where I would expect to see the plugin listed in the error message.
The configuration can also not be edited from the Run/Debug Configurations menu, but lists the Run Configuration error as: "Broken configuration due to unavailable plugin or invalid configuration data."
Am I really unable to uninstall the Ultimate plugin preventing my run configuration from working from the Community Edition? What can I do to fix this if so?
It's have been a long time since this question was launched but it might be useful for new searches.
I got the same error with Dart and Flutter.
Just go to Menu >> File >> Settings. Then type plugins on the search box. Check if your plugins need to be updated (in my case Dart and Flutter). I the screenshot I had clicked in the "update" green button. So it turns into "Restart IDE" text. It should fix the problem once you restart the IDE.
To the best of my knowledge the community edition of IDEA will not load and run plugins that are not compatible with it. Moreover, by default, the community edition uses a different configuration directory than the Ultimate edition. So unless you modified the config directory to use, the community version should not be picking up the Ultimate Edition's plugins. Based on the error you show, I think the issue is you simply need to delete that Run configuration. The error is saying that that Run configuration wants to use a Plugin (The Tomcat Plugin) that is not available (i.e. not installed).
If you still want to confirm what plugins are installed, you can manually uninstall a plugin by removing it from the plugins directory. Note that some plugins are simply a standalone JAR, in the plugins directory, others are sub-directories within the plugins directory. Just delete the JAR or sub-directory.
That plugins directory is the idea config directory. See Directories used by the IDE to store settings, caches, plugins and logs for information on its location. On windows for example, by default it will be:
Ultimate: C:\Users\UserName\.IntelliJIdea2016\config\plugins
Community: C:\Users\UserName\..IdeaIC2016\config\plugins
UPDATE
I forgot to mention... bundled plugins are in ${idea-install-directory}/plugins. So for the ultimate edition, the Tomcat plugin is in ${idea-install-directory}/plugins/Tomcat. That is why, as you mentioned in your comment below, you are not seeing that plugin in the user installed plugin directory I mentioned above.
updating flutter and android studio worked in my
case
Simple upgrade Dart plugin..
Go to Settings/Plugins/Browse Repositories and search dart (Language) and upgrade
this will work.
I had a similar worded issue "Run Configuration Error: Broken configuration due to unavailable plugin or invalid configuration data."
In the bottom right part of the Rider IDE, you will see a popup that says
"Plugin supporting feature (Run Configuration[UNITY_ATTACH_AND_PLAY]) is currently disabled."
Click enable plugins, and restart when Rider asks you to do so.
If this does not work, remember that one possible reason is the issues with macOS indexing (my Macbook started to malfunction after its battery hit 0). A way to check is to try and search a file from the top right corner(). If you can not find existing files, this means macOS messed up with indexing.
To solve it, click Apple icon on top left side and go to System Preferences -> Spotlight -> Privacy Tab -> Add all folders to the "won't index" box -> Remove everything you have added so they get reindexed.
https://www.techradar.com/how-to/software/operating-systems/how-to-fix-a-mac-s-broken-find-function-1298964
Lastly, go to Rider and hit File -> Invalidate Caches and Restart.

Unable to trigger SonarLint Analysis on whole Project

I have installed the latest sonarLint plugins with Intellij 2016.1.2.
Analyze on the fly works fine. However, I can't find in the IntelliJ "Analyze" tab any "Analyze with SonarLint". In the SonarLint window>issues tab, I can only see scope "current file" or "opened files". I don't see any Project scope.
So my question is how to trigger the analysis on my whole project ?
Since SonarLint v2.8, it's possible to analyze all files in the project.
Open the SonarLint Tool Window, go to the Project files tab, and click in the "play" button.
There is also an action to which you can assign a shortcut.
More information here: https://www.sonarlint.org/intellij/howto.html
The easiest two ways to do project analyze:
Choose Analyze | Analyze with SonarLint
Press Ctrl + Shift + S
As #Duarte - SonarSource Team suggests Sonar-Lint has a different purpose. It is intended to use to analyze for code changes in current file(s). i.e. it cannot perform analysis which needs to compare 2 files. (ex: finding duplicates, coverage etc.)
For your purpose that best way to achieve is running SonarQube with preview mode.
Update:
As per this, the preview mode has been deprocated in v 6.6 and will be dropped in future.
they stated many times that their intent is to support only new issue being introduced running an on-fly analysis on files being changed.
If you wanna run a full analysis you should use the SonarQubeCommunity plugin or visit your remote Sonar Server.
If you wanna gather only coverage information within your IDE, use the Jacoco plugin.
However there is an open feature request to browse those issues directly in the SonarLint plugin: https://jira.sonarsource.com/browse/SLE-54
Yes, that screenshot is confusing, but that feature was previously available.
Since version 2.8 analysis of all files in the project is possible.

How do you customize SonarLint rules in IntelliJ IDEA?

Is it possible to have SonarLint for IntelliJ IDEA enforce only the rules I have enabled on my Sonar server?
As it is now possible with the current release of SonarLint (I'm using version 3.0.0.2041), people might be interested in the solution.
File -> Settings -> Other Settings -> SonarLint General Settings
Click on the green + in "SonarQube servers" :
Enter a name (ex : SonarQube / localhost)
Select SonarQube and enter URL like http://localhost:9000
Authentication : select your user token or your login/pwd
Click on Finish
Click on "Update binding" to synchronize with the SonarQube server
Go to SonarLint Project Settings and bind your project to the SonarQube project
Thus, when you open your files, SonarLint will automatically retrieve the SonarQube server's issues.
SonarLint 1.0 for Eclipse and IntelliJ do not allow to edit the quality profile (or set of rules) to be used for the analysis. Moreover, SonarLint 1.x works completely independently of a SonarQube server (having a SonarQube server is not a requirement), and therefore does not have the ability to reuse a quality profile defined there.
SonarLint 2.0 will have an optional mode that connects to a SonarQube server, and will offer this feature - but this isn't available yet.
For Android Studio Chipmunk , Dolphin 2022, Bumblebee and Arctic Fox
File >> Settings >> Tools >> SonarLint >> Rules
Then select your project language and any rule then check/uncheck it, you can edit its options (if exist)
These connections settings for SonarLint in the latest version of IntelliJ (2020.2) are in the Preferences window at Tools>SonarLint>Project Settings.

Enable Perforce in all IntelliJ windows

For some reason, Perforce is working on one project window but not the other. Does anybody know what I have do to make intellij recognize that the current project uses perforce. I have checked the Settings -> Version Control -> Perforce settings. Settings are good, I was able to connect.
I am lost, any help is appreciated.
VCS -> Enable VCS Integration
Note that the this option is not visible if VCS Integration is already enabled.