Halliday (2008: 158):
Lexical density can be measured as the number of lexical items (“content words”) per ranking clause. (A “ranking clause” is one that is functioning as a clause, independent or dependent; not “rank-shifted” to become part of something else.) Since it is a comparative measure, it does not matter exactly where the line between content words and function words is drawn, provided it is drawn consistently for all the texts under study.