Cyclomatic complexity with two IFs - why it is 3?
https://softwareengineering.stackexchange.com/questions/183950
-
05-11-2019 - |
Вопрос
I have read an article with following example:
void func()
{
if (condition1)
a = a + 1;
if (condition2)
a = a - 1;
}
It says the CC is 3 as there are three possible paths. How come? Why not 4? I Would expect TRUE,TRUE; FALSE,FALSE; TRUE, FALSE and FALSE, TRUE.
Does not matter what the statements are. CC=Ifs-EndPoints+2. It is always 3 for 2 IFs and one ending..
Нет правильного решения
Не связан с softwareengineering.stackexchange