While changing the rules configuration for Cognitive complexity in eclipse, a negative value is being accepted. Sonar warnings are also generated.
In eclipse
Windows -> Preferences -> SonarLint -> Rules Configuration -> Java -> (search cognitive complexity)
The below is a sample sonar warning generated: