DEV Community

John 'BBQ' Wollner
John 'BBQ' Wollner

Posted on

Code analysis tools

I've inherited a very large code base (.Net) which has been poorly structured with an emphasis on the 'copy and paste' design strategy. All of the people who knew the code are gone so there's no tribal knowledge either.

What I'm trying to achieve at a minimum is to identify where the common classes/namespaces are used so I can begin rationalizing the libraries, PA kages, etc.

Are there any tools out there for this kind of analysis? I can write scripts as a starting point, but I'd prefer a tool over investing in a more or less one time effort.

Latest comments (3)

Collapse
 
jwollner5 profile image
John 'BBQ' Wollner

UPDATE
I think I've figured out a cheap and cheerful way to get the job done based on a similar article I read this week. Starting with the parsing of all csproj files for all projects and extracting their references. I plan to load this into the new graph tables in MSSQL 2017 to begin establishing relationships. I I'm hoping that from that I can find the hot-spots to focus our efforts.

Collapse
 
stephanvs profile image
Stephan van Stekelenburg

Hi John,

You mention it's a .net codebase you inherited. I'm not sure if you're aware and if you are using Visual Studio, but if you have the Enterprise version, there is already tooling available to help you generate dependency diagrams for your solutions.

Under the 'Architecture' menu item (only available in Enterprise editions) there's an option to 'Generate code map for solution'. That will probably give you some insights into the relations between your projects and even lower levels such as class and individual methods.

If you need some assistance, let me know!

HTH,
Stephan

Collapse
 
jwollner5 profile image
John 'BBQ' Wollner

Unfortunately we are way too small to justify the cost of enterprise. I'm using ReSharper, but the code tree is so intertwined that a solution level analysis does not produce the data I need.

However, this issue has motivated me to create a toolkit for this type of work that I'm making my hobby project. I hope to post on it this summer