0

In Windows -> Preferences -> SonarLint -> Rules Configuration -> Java -> (search cognitive complexity), while selecting the rule for cognitive complexity, I was able to set a negative value for the threshold.

enter image description here

I was able to successfully apply the change, and sonar warnings were also generated:

enter image description here

What is the purpose of allowing a negative threshold, or is this a bug?

Gautham M
  • 4,816
  • 3
  • 15
  • 37
  • So the UI allows to enter a negative value, which [according to the documentation](https://docs.codeclimate.com/docs/cognitive-complexity) and as you already found out yourself does not make sense. What prevents you [providing a patch](https://github.com/SonarSource/sonarlint-eclipse) for what you call a bug? – howlger Apr 06 '21 at 12:39
  • @howlger should bugs also be added under "Suggest new feature"? – Gautham M Apr 06 '21 at 13:38
  • 1
    Make a [pull request for your patch here](https://github.com/SonarSource/sonarlint-eclipse/pulls). – howlger Apr 06 '21 at 13:45

0 Answers0