sonarlint

Built-in string formatting vs string concatenation as logging parameter

霸气de小男生 提交于 2019-12-03 10:19:39
I'm using SonarLint that shows me an issue in the following line. LOGGER.debug("Comparing objects: " + object1 + " and " + object2); Side-note: The method that contains this line might get called quite often. The description for this issue is "Preconditions" and logging arguments should not require evaluation (squid:S2629) Passing message arguments that require further evaluation into a Guava com.google.common.base.Preconditions check can result in a performance penalty. That's because whether or not they're needed, each argument must be resolved before the method is actually called. Similarly

How do you customize SonarLint rules in IntelliJ IDEA?

橙三吉。 提交于 2019-12-03 06:42:10
问题 Is it possible to have SonarLint for IntelliJ IDEA enforce only the rules I have enabled on my Sonar server? 回答1: 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

Disable Sonarlint automatic scan for Eclipse Remote Systems Explorer

耗尽温柔 提交于 2019-12-01 20:33:07
How can I disable the SonarLint automatic scan in Eclipse for the Remote Systems Explorer plugin? Background: I recently installed the SonarLint plugin for Eclipse, because a client I work for uses Sonar for code quality. And love the direct reporting of bugs and code smells. Now I try to do some work for another client, which doesn't use Sonar, and has a old legacy project. Which I have connect to via SFTP so I use the Remote Systems Explorer for that. But when I open any file I can see notices all over the place. To keep every clean and separated I have setup different workspaces for each

SonarLint for Eclipse : Configure a custom SonarQube & language profile?

爷,独闯天下 提交于 2019-12-01 19:41:40
Currently SonarLint for Eclipse uses https://update.sonarlint.org/ as SonarQube instance. Is there a way to configure a custom SonarQube url (with user authentication) for using your own default language profile ? Could be very useful when you want more rules or you have configured some exclusions (mainly for external JavaScript libraries like JQuery, ...) Alix Lourme Too quick question, same here about IntelliJ, but with Eclipse answer. This feature will be supported in v2.0 ( SLE-26 ). However, there is a workaround ... Disclaimer : This workaround is not supported by SonarSource , this is

SonarLint for Eclipse : Configure a custom SonarQube & language profile?

喜你入骨 提交于 2019-12-01 19:10:35
问题 Currently SonarLint for Eclipse uses https://update.sonarlint.org/ as SonarQube instance. Is there a way to configure a custom SonarQube url (with user authentication) for using your own default language profile ? Could be very useful when you want more rules or you have configured some exclusions (mainly for external JavaScript libraries like JQuery, ...) 回答1: Too quick question, same here about IntelliJ, but with Eclipse answer. This feature will be supported in v2.0 (SLE-26). However,

SonarLint V3: Fields in a “Serializable” class should either be transient or serializable for List interface

主宰稳场 提交于 2019-12-01 19:04:48
My question is very similar to this except that this issue I have encountered in SonarLint V3 (squid:S1948). My code is : public class Page<T> implements Serializable { Summary summary; List<T> elements; public Page() { summary = new Summary(); } public List<T> getItemsReceived() { return elements; } public void setItemsReceived(List<T> list) { this.elements = list; } public Summary getSummary() { return summary; } public void setSummary(Summary summary) { this.summary = summary; } } The Summary Object implements serializable. public class Summary implements Serializable { int offset; int

Unable to trigger SonarLint Analysis on whole Project

ⅰ亾dé卋堺 提交于 2019-12-01 14:18:28
问题 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 ? 回答1: Since SonarLint v2.8, it's possible to analyze all files in the project. Open the SonarLint Tool Window , go to the

Can I configure the used ruleset for SonarLint

牧云@^-^@ 提交于 2019-12-01 05:52:28
Can I disable / enable the set of rules that are shown by SonarLint for VS? How? A similar question was already asked in Is there some graphical way to create my own configuration file on SonarLint? but I wasn't able to follow the answer, i.e. did not find the Project/References/Analyzers node in the Solution Explorer, to be able to edit the active rule set file. Can you help me out on this one? Here is how to open the active rule set of a project: From there, you'll be able to enable and disable rules: The path to the rule set file to be used is saved within your .csproj file under the

Exclude JS files from SonarLint

倖福魔咒の 提交于 2019-12-01 05:20:16
I use SonarLint in my Eclipse to analyze JAVA web project. How to exclude js files from SonarLint analysis? It is because when I open js file, SonarLint starts to slow down the Eclipse performance. Used version: SonarLint for Eclipse 1.0.0.20151015-1547-RELEASE Thanks Go to Window->Preferences, SonarLint->Scanner Properties and add the properties: sonar.exclusions=**/*.js sonar.test.exclusions=**/*.js More information about this: http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus SonarLint will still be triggered but it will skip all files that are JS source files. You can tune the

Can I configure the used ruleset for SonarLint

雨燕双飞 提交于 2019-12-01 03:47:14
问题 Can I disable / enable the set of rules that are shown by SonarLint for VS? How? A similar question was already asked in Is there some graphical way to create my own configuration file on SonarLint? but I wasn't able to follow the answer, i.e. did not find the Project/References/Analyzers node in the Solution Explorer, to be able to edit the active rule set file. Can you help me out on this one? 回答1: Here is how to open the active rule set of a project: From there, you'll be able to enable