Sonarqube Developer Version: How LoC is computed

Dear Sonar team,

From Sonarqube Metric Definition we have
Lines ( lines )
Number of physical lines (number of carriage returns).

Lines of code ( ncloc )
Number of physical lines that contain at least one character which is neither a whitespace nor a tabulation nor part of a comment.

Sonarqube license are base on LoC, what Sonarqube used as based on pricing (lines or ncloc)?
If it’s ncloc, do Sonarqube count inactive code by #ifdef or #if macro on C Language?

Hello @sopiana,

SonarQube pricing is based on ncloc
The definition of ncloc being what you mentioned above, for C/C++, all “branches” of conditional compilation (ie all branches of #ifdef or #if) are counted as LoC, even the potentially “inactive” branches (they can’t be inactive in all cases, if there’s a preprocessor directive it means that both branches may be compiled).

For macros, the LoC count happens before macro expansions so the block of code in the macro is counted only once (just like a function)

Olivier