Skip to content

メトリクス定義 ​

各メトリクスは、下の表のスコープで、ID ごとに個別に出力されます。計算できない値は 0 ではなく null になり、理由が unavailable に入ります。

計算方法が変わると、メトリクス定義のバージョンが変わります。解析結果には、計算に使ったバージョンが記録されます(run.metric_definition_version)。

メトリクス名前スコープ単位
size.locLOCfile, projectlines
size.slocSLOCfunction, file, projectlines
size.comment_locコメント行数file, projectlines
size.blank_loc空行数file, projectlines
size.comment_ratioコメント率file, projectratio
size.statement_count文の数function, file, projectcount
size.token_countトークン数function, file, projectcount
size.function_count関数の数file, projectcount
size.function_length関数の長さfunctionlines
size.avg_function_length平均関数長file, projectlines
size.max_function_length最大関数長file, projectlines
complexity.cyclomaticCyclomatic Complexityfunction, file, projectcount
complexity.branch_count分岐の数function, file, projectcount
complexity.conditional_count三項演算子の数function, file, projectcount
complexity.loop_countループの数function, file, projectcount
complexity.return_countreturn の数function, file, projectcount
complexity.jump_countジャンプの数function, file, projectcount
complexity.path_count経路数functioncount
complexity.cognitiveCognitive Complexityfunction, file, projectcount
nesting.max_depth最大ネスト深さfunction, file, projectlevels
nesting.avg_depth平均ネスト深さfunction, file, projectlevels
halstead.unique_operators演算子の種類数function, file, projectcount
halstead.unique_operands被演算子の種類数function, file, projectcount
halstead.total_operators演算子の総数function, file, projectcount
halstead.total_operands被演算子の総数function, file, projectcount
halstead.vocabulary語彙数function, file, projectcount
halstead.lengthプログラム長function, file, projectcount
halstead.volumeVolumefunction, file, projectbits
halstead.difficultyDifficultyfunction, file, projectratio
halstead.effortEffortfunction, file, projectcount
halstead.time推定プログラミング時間function, file, projectseconds
halstead.bugs推定バグ数function, file, projectcount
function.parameter_count引数の数functioncount
function.avg_parameter_count平均引数数file, projectcount
function.max_parameter_count最大引数数file, projectcount
function.expression_count式の数function, file, projectcount
function.call_count呼び出しの数function, file, projectcount
duplication.duplicate_block_count重複ブロック数file, projectcount
duplication.duplicate_token_count重複トークン数file, projectcount
duplication.duplication_ratio重複率file, projectratio
duplication.max_duplicate_length最長の重複file, projecttokens
dependency.fan_outFan-outfunctioncount
dependency.fan_inFan-infunctioncount
dependency.call_depth呼び出しの深さfunctioncalls
dependency.dependency_count依存の数file, projectcount
documentation.doc_locドキュメント行数functionlines
documentation.documented_function_countドキュメントのある関数の数file, projectcount
documentation.documentation_ratioドキュメント率file, projectratio
maintainability.indexMaintainability Indexfunction, fileindex
derived.cyclomatic_per_function関数あたりの Cyclomatic Complexityfile, projectratio
derived.tokens_per_locLOC あたりのトークン数file, projectratio
derived.statements_per_function関数あたりの文の数file, projectratio
derived.duplicate_tokens_per_slocSLOC あたりの重複トークン数file, projectratio