![CRITICAL](https://sonarsource.github.io/sonar-github/severity-critical.png 'Severity: CRITICAL') Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed. [![rule](https://sonarsource.github.io/sonar-github/rule.png)](https://sonarcloud.io/coding_rules#rule_key=squid%3AS3776) 