Why is cyclomatic Complexity of Switch Block 2?
조회 수: 2 (최근 30일)
이전 댓글 표시
Switch Block has two possible outcomes: input 1 or input 3. The cyclomatic complexity of the block should have been 1 according to its defination in the documentation .
Why does the Simulink check API (slmetrics) return 2 instead of 1. Am i missing something ?
댓글 수: 0
채택된 답변
Fangjun Jiang
2020년 7월 20일
A Switch block is an equivilant of an if-else statement. Its cyclomatic complexity number is 2.
댓글 수: 3
Fangjun Jiang
2020년 7월 27일
Good point! Contact the Mathworks tech support and ask to explain the cases of a Switch block and a multi-port Switch block, i.e. what is N and "On". It seems the documetation has error.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Code Generation for ARM Cortex-M and ARM Cortex-A Processors에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!