2

When facing new code I often spend time to figure out which classes and methods constitute core functionality in contrary to just ambient stuff. If code adheres to well known architectural design, have visible structure, descriptive names, documentation, unit tests etc. then the task is easier. However that is not always the case. Sometimes the code is just a pasta and God knows what is going on there.

I believe that there are some algorithms that could be use in order to roughly categorize code parts so that the developer can see important things in a glance without manual processing.

For example:

  1. In case of views and view models the tool could highlight bindings in the later so that the developer could see entry points.
  2. Using of methods and classes occurs at some level of invocation chain. Some methods have the opportunity to be invoked only deeply in logic (low priority). Others are invoked directly from user action handlers (high priority).

Is there a tool that will be able to filter or highlight classes and methods in Visual Studio depenging on the code importance?

It could look like the follows:

enter image description here

Under importance I understand here that for example the Main method has high importance because it's a root of everything else. You can go from Main method to any other method in the code. MethodL2 has low importance because it is just a leaf. Calculation of leaves importance should be also derived from they parents importance. I mean that an importance in this meaning is not only about the level of depth or occurencies.

Ryszard Dżegan
  • 24,366
  • 6
  • 38
  • 56
  • +1, following as it may be of interest – LittleSweetSeas Dec 06 '13 at 15:41
  • 2
    Well the obvious approach would be to use the comments system implemented in VS to document your classes. That will allow you to have some sort of documentation when using the class. The documentation can contain things that may help you identify the importance. Of course, when we refer to importance, it is the importance of an object to a programmer. Each programmer would, or may have categorized an object different from you. – Tweety Dec 06 '13 at 15:43
  • This also probably becomes difficult as you move out of the assembly, for the same reason its easy to determine an uncalled private method but not an uncalled public/protected method. – StingyJack Dec 06 '13 at 16:25
  • 1
    You could run it in a profiler and see which it spends the most time in, long time spent can correlate to higher in the invocation chain as if a method take time every method that calls it will also take time. – user1937198 Dec 06 '13 at 17:11

0 Answers0