メトリクス定義
各メトリクスは、下の表のスコープで、ID ごとに個別に出力されます。計算できない値は 0 ではなく null になり、理由が unavailable に入ります。
計算方法が変わると、メトリクス定義のバージョンが変わります。解析結果には、計算に使ったバージョンが記録されます(run.metric_definition_version)。
| メトリクス | 名前 | スコープ | 単位 |
|---|---|---|---|
size.loc | LOC | file, project | lines |
size.sloc | SLOC | function, file, project | lines |
size.comment_loc | コメント行数 | file, project | lines |
size.blank_loc | 空行数 | file, project | lines |
size.comment_ratio | コメント率 | file, project | ratio |
size.statement_count | 文の数 | function, file, project | count |
size.token_count | トークン数 | function, file, project | count |
size.function_count | 関数の数 | file, project | count |
size.function_length | 関数の長さ | function | lines |
size.avg_function_length | 平均関数長 | file, project | lines |
size.max_function_length | 最大関数長 | file, project | lines |
complexity.cyclomatic | Cyclomatic Complexity | function, file, project | count |
complexity.branch_count | 分岐の数 | function, file, project | count |
complexity.conditional_count | 三項演算子の数 | function, file, project | count |
complexity.loop_count | ループの数 | function, file, project | count |
complexity.return_count | return の数 | function, file, project | count |
complexity.jump_count | ジャンプの数 | function, file, project | count |
complexity.path_count | 経路数 | function | count |
complexity.cognitive | Cognitive Complexity | function, file, project | count |
nesting.max_depth | 最大ネスト深さ | function, file, project | levels |
nesting.avg_depth | 平均ネスト深さ | function, file, project | levels |
halstead.unique_operators | 演算子の種類数 | function, file, project | count |
halstead.unique_operands | 被演算子の種類数 | function, file, project | count |
halstead.total_operators | 演算子の総数 | function, file, project | count |
halstead.total_operands | 被演算子の総数 | function, file, project | count |
halstead.vocabulary | 語彙数 | function, file, project | count |
halstead.length | プログラム長 | function, file, project | count |
halstead.volume | Volume | function, file, project | bits |
halstead.difficulty | Difficulty | function, file, project | ratio |
halstead.effort | Effort | function, file, project | count |
halstead.time | 推定プログラミング時間 | function, file, project | seconds |
halstead.bugs | 推定バグ数 | function, file, project | count |
function.parameter_count | 引数の数 | function | count |
function.avg_parameter_count | 平均引数数 | file, project | count |
function.max_parameter_count | 最大引数数 | file, project | count |
function.expression_count | 式の数 | function, file, project | count |
function.call_count | 呼び出しの数 | function, file, project | count |
duplication.duplicate_block_count | 重複ブロック数 | file, project | count |
duplication.duplicate_token_count | 重複トークン数 | file, project | count |
duplication.duplication_ratio | 重複率 | file, project | ratio |
duplication.max_duplicate_length | 最長の重複 | file, project | tokens |
dependency.fan_out | Fan-out | function | count |
dependency.fan_in | Fan-in | function | count |
dependency.call_depth | 呼び出しの深さ | function | calls |
dependency.dependency_count | 依存の数 | file, project | count |
documentation.doc_loc | ドキュメント行数 | function | lines |
documentation.documented_function_count | ドキュメントのある関数の数 | file, project | count |
documentation.documentation_ratio | ドキュメント率 | file, project | ratio |
maintainability.index | Maintainability Index | function, file | index |
derived.cyclomatic_per_function | 関数あたりの Cyclomatic Complexity | file, project | ratio |
derived.tokens_per_loc | LOC あたりのトークン数 | file, project | ratio |
derived.statements_per_function | 関数あたりの文の数 | file, project | ratio |
derived.duplicate_tokens_per_sloc | SLOC あたりの重複トークン数 | file, project | ratio |