Why this matters
Improves readability, testability, and reduces bug surface.
Split long methods into cohesive private helpers with clear names and single responsibilities.
Improves readability, testability, and reduces bug surface.
Side-by-side examples engineers can pattern-match during review.
public void Process(){ /* 200+ lines */ }public void Process(){ Validate(); var data = Load(); var result = Transform(data); Save(result); }void Big(){ /* ...long... */ }void Big(){ Step1(); Step2(); Step3(); }From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.