Code lens is a new feature in Visual Studio 2013 which helps us to understand three important things about our code while we are coding inside Visual Studio.
All these three things (Impact, test and latest) are seen right above your class / method when you code in Visual Studio as shown in the below figure:
Impact: First thing code lens shows is when we change the code what is the impact of those changes. For instance, in the above figure, you can see it stating that if you make any changes to the log method, it will be impact 1 reference.
If you click on references further, it will also show which classes it’s referencing. With this, we come to know the level of impact this change will have further.
In the below screen, it’s stating that “
ConsoleApplication2” and “UnitTest1.cs” are the classes.
If you further click on “Show on Code Map” menu you should see a graphical representation of dependencies.
Test: Second important thing code lens tells is whether this method was unit tested or not. For instance, you can see it says 1 passing means this method was unit tested.
Latest: Third thing it tells whether this is a latest code or not. You can see the last menu which states this is not a latest code and you need to do a get latest from the server.
But now for the bad news nothing is free, code lens is currently available only in ultimate edition. Wish it was free as air….. ;-)
Below is a nice and short video of codelens created by www.questpond.com team.