Code Metrics
WhenPolyspace®Bug Finder™analyzes your code, you can choose to calculate statistics about your program. Use theCalculate code metrics (-code-metrics)
analysis option to activate code metric checking. To understand the different code metric results and how Bug Finder calculates them, see these reference pages.
Polyspace Results
Project Metrics
Number of Direct Recursions |
Number of instances of a function calling itself directly |
Number of Header Files |
Number of included header files |
Number of Files |
Number of source files |
Number of Recursions |
Number of call graph cycles over one or more functions |
File Metrics
Comment Density |
Ratio of number of comments to number of statements |
Estimated Function Coupling |
Measure of complexity between levels of call tree |
Number of Lines |
Total number of lines in a file |
Number of Lines Without Comment |
行数的代码不包括行comments or blank |
Function Metrics
Cyclomatic Complexity |
Number of linearly independent paths in function body |
Language Scope |
Language scope |
Number of Call Levels |
Maximum depth of nesting of control flow structures |
Number of Call Occurrences |
Number of calls in function body |
Number of Called Functions |
Number of distinct functions called within the body of a function |
Number of Calling Functions |
Number of distinct callers of a function |
Number of Executable Lines |
Number of executable lines in function body |
Number of Function Parameters |
Number of function arguments |
Number of Goto Statements |
Number ofgoto statements |
Number of Instructions |
Number of instructions per function |
Number of Lines Within Body |
Number of lines in function body |
Number of Local Non-Static Variables |
Total number of local variables in function |
Number of Local Static Variables |
Total number of local static variables in function |
Number of Paths |
Estimated static path count |
Number of Return Statements |
Number ofreturn statements in a function |
Topics
- HIS Code Complexity Metrics
See which code complexity metrics supported in Polyspace are part of the Hersteller Initiative Software (HIS) standard.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)