December 13, 2019, 11:57:32 pm
News: IF YOU ARE A MEMBER FROM THE ORIGINAL SITE AND CAN'T LOGIN. POST IN THE FEEDBACK FORUM (AS GUEST) AND AN ADMIN WILL ASSIST YOU TO ACCESS THE SITE!
Pages: [1]   Go Down
Author Topic: web site / web application "mapper"  (Read 5199 times)
simmo
Administrator
*

Stars: +3/-0
Offline Offline

Gender: Male
Posts: 8537



« on: July 31, 2012, 03:17:58 pm »

Basically I've got a mess that I started over 10 years ago and a few people contributed to the pile over the years.

I (the company I am working for rather) have a web server with a root directory full of crap and I'd like to sort the active crap from the crap that's just laying around  laugh1

On my first glance yesterday, I found a folder of some "personal"  (as in, wasn't work related) code I was working on in about 2003. I know that was a bad thing to do, it was just a simple asp page I was probably debugging for a friend, and these days I wouldn't ever imagine putting a non-work file on a work server, but there it was. I have reason to believe there are others on there, not necessarily by me, as well as different projects we may have started and shelved or even development directories that are no longer in use.

The main issue is, we all have the mentality of "I don't know what this switch does, so I'm just going to leave it alone." Which may be fine, I just hate clutter Another Tounge

sooooo... rather than step through all the active sites/apps tracing all the include files (and their include files etc), or taking the opposite route of finding what, if anything, links to a file, for each file, is there any decent way to go about this chore?
Logged

                 ..... .....

Jason Reed
Administrator
*

Stars: +4/-0
Offline Offline

Gender: Male
Posts: 4522


Pure Evil Administrator


WWW
« Reply #1 on: August 01, 2012, 03:43:44 am »

That's a good question, the problem is that I don't understand ASP format well enough to go about it.

What I might have done is built a small application that read each and every file and listed the imports and file names. This way you could try to see any files that don't have an import reference.

Is there any form of reflection in ASP where you could identify if a file is used anywhere else? How about in your development IDE (if you use one).
Logged

-- signature --

simmo
Administrator
*

Stars: +3/-0
Offline Offline

Gender: Male
Posts: 8537



« Reply #2 on: August 01, 2012, 12:37:02 pm »

That's a good question, the problem is that I don't understand ASP format well enough to go about it.
[snip]
Is there any form of reflection in ASP where you could identify if a file is used anywhere else? How about in your development IDE (if you use one).
Not real sure what you mean by reflection but if I understand correctly:
Asp classic has "response.redirect" when you want to go to a file, "include" which is just like pulling a javascript file using src, and execute when you want to process code in a file and return.


What I might have done is built a small application that read each and every file and listed the imports and file names. This way you could try to see any files that don't have an import reference.
That is a pretty good idea! I think I'll go about it almost like a web crawler, following links (searching for the tags mentioned above, as well as javascript & css externals). Those results can go into table with the fields "fileid" and "filename" (maybe "filepath" if I don't just include that as part of the name). I would need a second table with "fileid" and "parentid" since a file can have multiple parents (like master include files with database connection info). Files with children but no parents would be considered "start pages" like index.ext or default.ext

That does answer this thread, and I think solves my issue as much as any technical solution can. From here it will need human interaction to actually determine if a "orphan" piece of code or even a full blown system of files is actually in use.


Logged

                 ..... .....

wrack
Master of TMEOotAP
*

Stars: +3/-0
Offline Offline

Posts: 11116


Don't look back. Look in the mirror to look back.


WWW
« Reply #3 on: August 30, 2012, 06:59:49 am »

I am not sure if this can help you but...

http://www.ssw.com.au/ssw/LinkAuditor/
Logged

simmo
Administrator
*

Stars: +3/-0
Offline Offline

Gender: Male
Posts: 8537



« Reply #4 on: August 30, 2012, 12:50:05 pm »

That's pretty much the concept, except that would crawl links like a human or a web spider. I'm looking for the more underlying code, like include files, and filed being called by ajax.

Got pulled off of that project to work on something else, I forgot how "a.d.d." that company is  laugh1
Logged

                 ..... .....

wrack
Master of TMEOotAP
*

Stars: +3/-0
Offline Offline

Posts: 11116


Don't look back. Look in the mirror to look back.


WWW
« Reply #5 on: August 31, 2012, 12:33:53 am »

Yeah I imagine that would be your answer but I thought I might try mf_Dr_Evil

Kinda gets hard to do automatically what you want to achieve! I would take a snapshot to a staging site and start flicking switches...
Logged

simmo
Administrator
*

Stars: +3/-0
Offline Offline

Gender: Male
Posts: 8537



« Reply #6 on: September 01, 2012, 05:41:48 pm »

I would take a snapshot to a staging site and start flicking switches...

You are much braver than I  laugh1
Logged

                 ..... .....

wrack
Master of TMEOotAP
*

Stars: +3/-0
Offline Offline

Posts: 11116


Don't look back. Look in the mirror to look back.


WWW
« Reply #7 on: September 04, 2012, 01:37:07 am »

Gotta start somewhere mate  Evil
Logged

Jason Reed
Administrator
*

Stars: +4/-0
Offline Offline

Gender: Male
Posts: 4522


Pure Evil Administrator


WWW
« Reply #8 on: September 04, 2012, 09:05:40 am »

Welcome to the dark side of development vader
Logged

-- signature --

wrack
Master of TMEOotAP
*

Stars: +3/-0
Offline Offline

Posts: 11116


Don't look back. Look in the mirror to look back.


WWW
« Reply #9 on: September 07, 2012, 01:27:09 am »

I am even famous for that... Evil
Logged

Pages: [1]   Go Up
Print
 
Jump to: