I am looking to create .net code analysis tool based on custom rules.
i am going to use reflection to read entire code. Is there any way to read number of line consumed in class or method using reflection or any other assembly.

I am thinking to use some opensource tool so i can do modification in it but unable to find it on Google. 

Suggestions are welcome!
thx