Klocwork Analysis Metrics Issue not Clear

1000 Views Asked by At

I don't understand this issue:

Issue: HIS Metriken - Cyclomatic (CR-MET4): [function_name] 13>10

It appears in Klocwork analysis while checking the issues of Code: METRICS.E.HIS_Metriken___Cyclomatic__CR_MET4_

Can anyone support?

Thanks

1

There are 1 best solutions below

0
On

Do you see all those ifs, elses, loops in that function?
Those are the problem, you need to either design this function's logic more elegantly or split it into more functions with well-defined purposes.

By the way, I can only see that problematic function of yours because I am especially clairvoyant. For this kind of question you should normally show your code, just to be fair towards all those other users which cannot read your mind like I did.

Naaa, not really. The cyclomatic complexity is a measure for number of potential paths through your function. And that you have crossed the treshold of 10 by 3 means your function must be full of control structs, which create many paths.