Why Don't Metrics Always Add Up?

"Shouldn’t Comment Lines + Blank Lines + Code Lines = Total Lines?

And shouldn’t declarative statements and executable statements add up to the total number of statements as well?"

These are common types of assumptions associated with metrics - however, any given line can actually count towards multiple metrics, so the numbers are not necessarily unique.

For example:

int deltaChange = 5; //Delta needs a minimum variant of 5

This line is a code line and a comment line, so it counts as both. Likewise the statement is both declarative and executable, so would count in each of those metrics.