Customize the rule "Cognitive Complexity of functions should not be too high (typescript: S3776)" to 25 in sonarlint

On the project that I have in my local machine, through the Sonarlint extension on visual studio code, I see that the following rule “Cognitive Complexity of functions should not be too high (typescript: S3776)” is set to 15, while the same project on SonarQube it has the same custom rule at 25. Why doesn’t it align with 25 in Sonarlint on Visual Studio Code? Is it possible to customize this rule locally? And if so, how do you do it?

Thanks for the support,

Good day,

Nicolò

Hello @Nicolo_Bracchi,

It’s unclear from your message if you’ve already configured your project to use connected mode.

When in connected mode, SonarLint will use the quality profile you have on SonarQube and apply the rule parameters. Please refer to our documentation on how to enable connected mode.

Let me know if it works for you.

Best,
Rita

Good morning, thanks for the answer. Yes I have configured my project to use connected mode, but when I execute the command “update all projects binding to sonarqube/sonarlint”, I get the following result in the sonarlint output:

[Warn - 09:06:05.111] Failed to request SonarLint notifications

[Warn - 09:06:05.111] java.lang.IllegalStateException: Error processing HTTP request

at org.sonarsource.sonarlint.ls.http.ApacheHttpClient.execute(ApacheHttpClient.java:92)

at org.sonarsource.sonarlint.ls.http.ApacheHttpClient.get(ApacheHttpClient.java:67)

at org.sonarsource.sonarlint.core.serverapi.ServerApiHelper.rawGet(ServerApiHelper.java:83)

at org.sonarsource.sonarlint.core.notifications.NotificationChecker.request(NotificationChecker.java:61)

at org.sonarsource.sonarlint.core.notifications.NotificationTimerTask.requestForServer(NotificationTimerTask.java:79)

at org.sonarsource.sonarlint.core.notifications.NotificationTimerTask.run(NotificationTimerTask.java:63)

at java.base/java.util.TimerThread.mainLoop(Unknown Source)

at java.base/java.util.TimerThread.run(Unknown Source)

Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Do you know how to fix it?

Nicolò

Good morning,

I see that you opened a thread for it – I’ve already forwarded it to someone from the team to take a look at. We will respond there.

Rita