I have wondered about that for a while and finally got to count Moodle lines of code. The short answer is: Moodle has about 600k lines of code. This is excluding all 3-rd party libraries and counting only "real" code (no blanks and no comments). More details here: http://jmuras.com/blog/2013/number-of-lines-of-code-in-moodle-2-6 .
According to some very rough COCOMO calculations it would cost over $20 million to develop it now...
Tomek