Text of codeql.github.com › codeql-query-help › csharp › cs-complex-block as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

Block with too many statements — CodeQL query help documentation

CodeQL query help documentation » CodeQL query help for C# » Block with too many statements ¶ ID: cs/complex-block Kind: problem Security severity: Severity: recommendation Precision: high Tags: - maintainability - complexity - testability Query suites: - csharp-security-and-quality.qls Click to see the query in the CodeQL repository Some blocks of code have too many complex statements (branching statements and loops).

These blocks are prime candidates for refactoring. Recommendation ¶ Consider whether it would be better to extract some of the complex statements to their own methods. References ¶ William C. Wake, Refactoring Workbook , Addison-Wesley Professional, 2004. Martin Fowler, Refactoring: Improving the Design of Existing Code , Addison-Wesley Professional, 1999. © GitHub, Inc. Terms Privacy