Refactor this method to reduce its Cognitive Complexity from 21 to the 15 allowed. How to refactor and reduce the complexity

A little information on how cognitive complexity works and why you should keep it low First of all it is important to understand how “Cognitive Complexity” works as compared to “Cyclomatic Complexity“. Cognitive complexity takes into account the complexity perceived by the human brain. This is why it does not simply indicate the number of … Read more

Built-in string formatting vs string concatenation as logging parameter

I believe you have your answer there. Concatenation is calculated beforehand the condition check. So if you call your logging framework 10K times conditionally and all of them evaluates to false, you will be concatenating 10K times with no reason. Also check this topic. And check Icaro’s answer’s comments. Take a look to StringBuilder too.

How to suppress warning for a specific method with Intellij SonarLint plugin

You can use //NOSONAR or @SuppressWarnings() but you need to specify the rule. From the SonarQube documentation: The //NOSONAR tag is useful to deactivate all rules at a given line but is not suitable to deactivate all rules (or only a given rule) for all the lines of a method or a class. This is … Read more

SonarQube And SonarLint difference

SonarLint lives only in the IDE (IntelliJ, Eclipse and Visual Studio). Its purpose is to give instantaneous feedback as you type your code. For this, it concentrates on what code you are adding or updating. SonarQube is a central server that processes full analyses (triggered by the various SonarQube Scanners). Its purpose is to give … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)