title: Cognitive Complexity and its effect on the code
body: <p>W.r.t to one of the java projects, we recently started using SonarLint. Output of the code analysis shows too many critical code smell alerts. </p>
  
  <pre><code>Critical code smell: Refactor this method to reduce its Cognitive Complexity.
  </code></pre>
  
  <p>I have heard about Cyclomatic Complexity but not about Cognitive Complexity.
  My questions to the group:</p>
  
  <ul>
  <li>Is Cognitive Complexity an industry standard?</li>
  <li>Impacts of Cognitive Complexity on code apart from readability and maintainability.</li>
  <li>Does Cognitive Complexity apply only to methods or any other parts of code? </li>
  <li>Any specific criteria on which Cognitive Complexity depends on?</li>
  <li>Best practices to improve Cognitive Complexity of a code.</li>
  </ul>
  
  <p>I have gone through this <a href="https://blog.sonarsource.com/cognitive-complexity-because-testability-understandability" rel="noreferrer">link</a> but could not get answers to all my questions. </p>
  
  <p>Thanks in advance.</p>