How can I view the cyclomatic complexity values of functions that violate the cyclomatic complexity rule in Polyspace?
8 views (last 30 days)
Show older comments
MathWorks Support Team
on 12 Feb 2025
Answered: MathWorks Support Team
on 14 Mar 2025
I have configured Polyspace Bug Finder to check for violations of the Cyclomatic Complexity rule from the HIS metrics.
The report only shows the file name and the number of violations, like:
foo -> 2 violations
but I would like the report to show the function name and the actual value of cyclomatic complexity of the function, like:
function1() -> 20
function2() -> 30
How can I achieve this?
Accepted Answer
MathWorks Support Team
on 12 Feb 2025
This can be achieved by selecting Check Code Metrics in the configuration of your project.
It can be found under "Coding Standards & Code Metrics -> Code Metrics".
This option includes a check of the cyclomatic complexity of the code, which is the same check as the HIS metric, but outputs the function name and the actual value of cyclomatic complexity of the function.
Visit the Code Metrics documentation page for more information.
0 Comments
More Answers (0)
See Also
Categories
Find more on Code Metrics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!