Sign in to follow this  
Stiffler

Mapping a directory tree to another

Recommended Posts

A project with I'm currently involved with is in charge of generating code metrics for large code bases. The problem I'm having is developing a clean and accurate (enough) way to determine directory tree and file refactoring. For instance if you merge the DataTools folder with the ClientTools folder into "Tools". I need to have an easy way to detect or ask the user if this is the case. I would also need to handle if a large number of files were removed from a folder or renamed and the like. The current plus side is that the tool is an in-house for a well known software firm, thus the user would be the project manager and most likely (hopefully) competent. The way the system I must use was designed, in order for me to handle this refactored directory tree, I must modify the old directory tree to match the new and then run the existing differential report. This is where GDNet comes in. Is there any easy way to handle this differential of directory trees? I obviously can ask the user, "Was this folder merged from ...,..." or anything of the like, but I didn't know if there was existing algorithms or implementations that handle this sort of problem. I was also considering using some sort of pattern matching algorithm to directly map the old to the new however this would involve some amount of time to get right. Without a good algorithm I can just make tons of cases and have a convoluted mess that would work with the problem, however that is not very satisfying nor appealing. I realize this is a game programming forum, I've been around a while, so if you feel I'm completely out of place then please suggest a better forum. As it happens GD is the only programming forum I frequently browse. Any suggestions would be greatly appreciated.

Share this post


Link to post
Share on other sites
Quote:
Original post by Stiffler
A project with I'm currently involved with is in charge of generating code metrics for large code bases. The problem I'm having is developing a clean and accurate (enough) way to determine directory tree and file refactoring.

For instance if you merge the DataTools folder with the ClientTools folder into "Tools". I need to have an easy way to detect or ask the user if this is the case. I would also need to handle if a large number of files were removed from a folder or renamed and the like. The current plus side is that the tool is an in-house for a well known software firm, thus the user would be the project manager and most likely (hopefully) competent.

Could you not query the version control system for this information? It's designed to record that kind of thing (unless it's CVS).

Quote:

The way the system I must use was designed, in order for me to handle this refactored directory tree, I must modify the old directory tree to match the new and then run the existing differential report.

Why? That sentence was somewhat vague so you lost me here, I'm afraid. What system are you using? Are the metrics measuring tools related to this system you mention? Are you modifying the existing system for this project or doing something outside of it?

Quote:

Is there any easy way to handle this differential of directory trees? I obviously can ask the user, "Was this folder merged from ...,..." or anything of the like, but I didn't know if there was existing algorithms or implementations that handle this sort of problem. I was also considering using some sort of pattern matching algorithm to directly map the old to the new however this would involve some amount of time to get right.

Again, a lot of the hard work has been done for you by the VCS. The quality of information might vary between different systems, but could it be good enough for what you need?

Share this post


Link to post
Share on other sites
Quote:
Could you not query the version control system for this information? It's designed to record that kind of thing (unless it's CVS).


Wow, I never thought about doing this. SVN is used so definitely something I'm going to look into.

As for the metrics system we are using RSM by MSquared Technologies which is external to our system. The reason the directories must be altered to match is because how the baseline differential report works with RSM. First if creates a baseline report for both directories, then diff's the two reports. Thus if you rename one directory to another, RSM thinks that you deleted x files and then created x new files in this new directory.

Anyways, I will definitely look into using svn to help me map to the new directory structure/version.

Thanks a lot the_edd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this