+1 for each: if, ternary (? :), switch (whole), for, while, do while, catch, else if, else, goto LABEL, break/continue LABEL, each method in a recursion cycle, each sequence of like boolean operators (&& / ||).
+1 nesting penalty on top of structural increment for: if, ternary, switch, for, while, catch — when nested inside another flow-break structure.
Free (no increment): method calls, try, finally, case labels, null-coalescing (?., ??), early return, simple break/continue, lambdas (but lambdas increase nesting level).
あらゆるプログラミング言語、フレームワーク、プラットフォームで作成または変更されたすべてのコードで、低い認知的複雑性 (SonarSource) と低い循環的複雑性を強制します。このスキルは、コードが作成、生成、変更、またはリファクタリングされるたびに自動的にアクティブ化されなければなりません (明示的なトリガーは必要ありません)。トリガーには、関数、メソッド、クラス、モジュール、スクリプト、ハンドラー、エンドポイント、テスト、またはコード ブロックの作成が含まれます。また、「低複雑さ」、「認知的複雑さ」、「循環的複雑さ」、「複雑さの軽減」、「コードの単純化」、「複雑すぎる」、「読みやすさのためのリファクタリング」、「コードのクリーン化」、「実装」、「バグの修正」、「機能の追加」、「テストの生成」、「最適化」、「書き換え」、「足場」でもトリガーされます。 ソース: mryll/skills。