Re: [cfaussie] Unused Files
Actually a tool like this would not be hard to write, the only downside is that it would take a very long time to run in CFML though. It would be a very good candidate as an extension to CFBuilder, the images would be just find all with known image extensions and search for known links in the files. Not found then flag it as such. Methods would be a matter of just getting the metadata for the CFC and then searching for that method being used. Not sure how long it would take on the size of a large application, like Dale is thinking of running it on, but it would be down to the amount of files and methods that would have to be recursed on each file. -- Regards, Andrew Scott WebSite: http://www.andyscott.id.au/ Google+: http://plus.google.com/108193156965451149543 On Thu, Dec 22, 2011 at 2:50 AM, charlie arehart wrote: > Besides the ideas shared so far, I have another couple of thoughts. That > said, neither is the perfect answer for you, nor is there one to be honest. > There’s been talk of such “code coverage” tools for CF, but to date none > exist (as far as I know). > > As for what CFM and assets are accessed, you could determine that somewhat > using web server logs. Of course, they don’t offer the absolute path, only > a web-relative one, and if you have multiple sites that could make things > harder. Of course, that won’t help you see CFCs called (from within CFML, > though you would see CFCs called remotely, such as via web services or from > ajax, etc.) > > You’d need to do such log analysis over a fairly long time period to > increase the confidence of your resulting conclusion. > > You could also get an approximation of calls to CFM and CFCs (including > internally called CFCs) by way of the cfclasses directory (within the > [CF]\wwwroot\WEB-INF\ directory). If you have the CF Admin set to “save > class files”, then whenever a CFM or CFC is called, a class file is created > for it (in the case of CFCs, a class is created for every method within the > CFC—not every method called, but every method that exists within it, which > will not help with your point 3 of course). > > As for the accuracy of the data that would show, you could base your > decision (on what to consider “has been used”) either by what you see in > that directory today (which may reflect months or years of calls), or you > may want to clear it out and run for some period of time to see a more > recent reflection of what’s called. > > ** ** > > /charlie > > ** > -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
RE: [cfaussie] Unused Files
Besides the ideas shared so far, I have another couple of thoughts. That said, neither is the perfect answer for you, nor is there one to be honest. There's been talk of such "code coverage" tools for CF, but to date none exist (as far as I know). As for what CFM and assets are accessed, you could determine that somewhat using web server logs. Of course, they don't offer the absolute path, only a web-relative one, and if you have multiple sites that could make things harder. Of course, that won't help you see CFCs called (from within CFML, though you would see CFCs called remotely, such as via web services or from ajax, etc.) You'd need to do such log analysis over a fairly long time period to increase the confidence of your resulting conclusion. You could also get an approximation of calls to CFM and CFCs (including internally called CFCs) by way of the cfclasses directory (within the [CF]\wwwroot\WEB-INF\ directory). If you have the CF Admin set to "save class files", then whenever a CFM or CFC is called, a class file is created for it (in the case of CFCs, a class is created for every method within the CFC-not every method called, but every method that exists within it, which will not help with your point 3 of course). As for the accuracy of the data that would show, you could base your decision (on what to consider "has been used") either by what you see in that directory today (which may reflect months or years of calls), or you may want to clear it out and run for some period of time to see a more recent reflection of what's called. /charlie From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of Dale Fraser Sent: Wednesday, December 21, 2011 5:35 AM To: cfaussie@googlegroups.com Subject: [cfaussie] Unused Files I'm looking for something that I can run that will tell me the following, I appreciate its getting harder down the list, but covering any of these points would be good 1. Unused cfm / cfc 2. Unused assets images etc 3. Methods Not called in cfc 4. Variables not used within methods The reason is we have a big legacy application that we are looking to move into the cloud, and I'd ideally only like to move things that are being used. Regards Dale Fraser http://dale.fraser.id.au http://cfmldocs.com http://learncf.com http://flexcf.com -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
RE: [cfaussie] Unused Files
I found this, But its pretty basic http://deadwood.riaforge.org/ Regards Dale Fraser http://dale.fraser.id.au http://cfmldocs.com http://learncf.com http://flexcf.com -Original Message- From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of Kym Kovan Sent: Wednesday, 21 December 2011 9:57 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Unused Files Hi Dale, how dynamic is the site? A modified sitemap tool might work for most of that if things are fairly static. Walk through the site building a huge map of all links and then see what you have that is not on the list. On 21/12/2011 9:34 PM, Dale Fraser wrote: > I'm looking for something that I can run that will tell me the > following, I appreciate its getting harder down the list, but covering > any of these points would be good > > 1.Unused cfm / cfc > > 2.Unused assets images etc > > 3.Methods Not called in cfc > > 4.Variables not used within methods > > The reason is we have a big legacy application that we are looking to > move into the cloud, and I'd ideally only like to move things that are > being used. > > Regards > > Dale Fraser > > -- Yours, Kym Kovan mbcomms.net.au -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
RE: [cfaussie] Unused Files
It's mostly code, cfm's and cfc's Its more of an application than a site, so I need something that can find if the .cfms are linked to included etc and if the cfc's are invoked or created I realise its not going to be perfect, figured I could write something like this but someone probably already has. Regards Dale Fraser http://dale.fraser.id.au http://cfmldocs.com http://learncf.com http://flexcf.com -Original Message- From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of Kym Kovan Sent: Wednesday, 21 December 2011 9:57 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Unused Files Hi Dale, how dynamic is the site? A modified sitemap tool might work for most of that if things are fairly static. Walk through the site building a huge map of all links and then see what you have that is not on the list. On 21/12/2011 9:34 PM, Dale Fraser wrote: > I'm looking for something that I can run that will tell me the > following, I appreciate its getting harder down the list, but covering > any of these points would be good > > 1.Unused cfm / cfc > > 2.Unused assets images etc > > 3.Methods Not called in cfc > > 4.Variables not used within methods > > The reason is we have a big legacy application that we are looking to > move into the cloud, and I'd ideally only like to move things that are > being used. > > Regards > > Dale Fraser > > -- Yours, Kym Kovan mbcomms.net.au -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
Re: [cfaussie] Unused Files
Hi Dale, how dynamic is the site? A modified sitemap tool might work for most of that if things are fairly static. Walk through the site building a huge map of all links and then see what you have that is not on the list. On 21/12/2011 9:34 PM, Dale Fraser wrote: I’m looking for something that I can run that will tell me the following, I appreciate its getting harder down the list, but covering any of these points would be good 1.Unused cfm / cfc 2.Unused assets images etc 3.Methods Not called in cfc 4.Variables not used within methods The reason is we have a big legacy application that we are looking to move into the cloud, and I’d ideally only like to move things that are being used. Regards Dale Fraser -- Yours, Kym Kovan mbcomms.net.au -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.