ソースコードの複雑さ、不具合のリスクを定量化したコードメトリクス1というものがあります。 コードメトリクスは計算方法によっていくつか種類があり、メジャーなものだと以下のものがあります。 Cyclomatic Complexity(循環的複雑度) Cognitive Complexity(認知的複雑度) Maintainability Index(保守容易性指数) Lines of Code(コードの行数) これらのコードメトリクスを計算し、CodeLensに表示するVisual Studio拡張機能2を作成しました。 tackme31/howmessy: How messy is your code? 以下のようにコードメトリクスをもとにコードが複雑かどうかを判定し、CodeLensに表示してくれます(デフォルトではCognitive Complexityをもとに計算します)。 今のところ