Need to get number of lines per function

I need to make some analysis on my projects, which requires to get number of lines in each function, is that applicable ? if no are there any work arounds to make such a thing ?

Hi,

Welcome to the community!

This isn’t available out of the box, and the only way to do it is to kludge rule S138, “Functions and methods should not have too many lines of code”. This is a threshold rule, so you can edit how many is “too many”. Add it to your profiles, set the threshold to 0, and re-run analysis. You’ll get an issue for every function and can harvest the line counts from the issue messages.

 
HTH,
Ann

1 Like

Thanks for your answer, appreciate it.