Alaska Software Inc. - Unused functions and Procedures
Username: Password:
AuthorTopic: Unused functions and Procedures
Joe Carrick Unused functions and Procedures
on Sun, 20 Jul 2008 20:22:37 -0700
Is there a simple way to determine what functions and procedures are not 
used in a project.  IOW, if a function or procedure is not actually 
called anyplace in the  project I would like that to be  reported 
similar to declared but not used variables.

Essentially, I want to eliminate all superfluous procedures and 
functions.  I can manually go thru and search for calls to subroutines, 
but it's time consuming and tedious work.  Does something exist that 
does this or do I need to create my own Tool ?

Thanks, Joe
JorgeRe: Unused functions and Procedures
on Wed, 20 Aug 2008 14:35:50 -0300
Hello Joe
> Is there a simple way to determine what functions and procedures are not 
> used in a project.
you meant your procedures.... ?

you can to create a program in 2 parts
1 - you must read your prgs and read the sentences "Procedure" and 
"Function" then you add the words tha folow this sentences like a dictionary
2 - search in all prgs this words and count each find
all words with value 0 in its counter..........


regards

"Joe Carrick" <joe.carrick@dslextreme.com> escribi en el mensaje 
news:22fa18bb$49078f48$1dc@news.alaska-software.com...
> Is there a simple way to determine what functions and procedures are not 
> used in a project.  IOW, if a function or procedure is not actually called 
> anyplace in the  project I would like that to be  reported similar to 
> declared but not used variables.
>
> Essentially, I want to eliminate all superfluous procedures and functions. 
> I can manually go thru and search for calls to subroutines, but it's time 
> consuming and tedious work.  Does something exist that does this or do I 
> need to create my own Tool ?
>
> Thanks, Joe
>
>
>
>
Joe Carrick Re: Unused functions and Procedures
on Wed, 20 Aug 2008 11:03:41 -0700
Hi Jorge,

Basically, what you suggested would work except that the prg that 
contains a procedure or function might have more than 1 occurrence of 
the function/procedure name.  Using "count" as a test just isn't reliable.

The concept is pretty basic but could be adapted.

	1.  Eliminate any instances where it in a comment.
	2.  Eliminate any instances where the name is after "function" or 
"procedure".
	3.  Differentiate between public, private, and static functions/procedures.
	4.  Use the project file to identify what prg's to search.

With a large app containing an exe and several dll's, some of which 
reference other dll's, it can get pretty complicated.  What I was hoping 
was that either the preprocessor or VX might have this already built-in.

-Joe


Jorge wrote:
> Hello Joe
>> Is there a simple way to determine what functions and procedures are not 
>> used in a project.
> you meant your procedures.... ?
> 
> you can to create a program in 2 parts
> 1 - you must read your prgs and read the sentences "Procedure" and 
> "Function" then you add the words tha folow this sentences like a dictionary
> 2 - search in all prgs this words and count each find
> all words with value 0 in its counter..........
> 
> 
> regards
> 
> "Joe Carrick" <joe.carrick@dslextreme.com> escribió en el mensaje 
> news:22fa18bb$49078f48$1dc@news.alaska-software.com...
>> Is there a simple way to determine what functions and procedures are not 
>> used in a project.  IOW, if a function or procedure is not actually called 
>> anyplace in the  project I would like that to be  reported similar to 
>> declared but not used variables.
>>
>> Essentially, I want to eliminate all superfluous procedures and functions. 
>> I can manually go thru and search for calls to subroutines, but it's time 
>> consuming and tedious work.  Does something exist that does this or do I 
>> need to create my own Tool ?
>>
>> Thanks, Joe
>>
>>
>>
>>
> 
> 
>
JorgeRe: Unused functions and Procedures
on Wed, 20 Aug 2008 18:17:36 -0300
Hello Joe
Do you need that it develops the idea and says to you precisely the calls of 
all your files defined in your project?

I see that already you have considered to be some initial concetos who in 
view of the case can become more refined more

Good Luck

"Joe Carrick" <joe.carrick@dslextreme.com> escribi en el mensaje 
news:1cec5ca5$504f27b8$f40@news.alaska-software.com...
> Hi Jorge,
>
> Basically, what you suggested would work except that the prg that contains 
> a procedure or function might have more than 1 occurrence of the 
> function/procedure name.  Using "count" as a test just isn't reliable.
>
> The concept is pretty basic but could be adapted.
>
> 1.  Eliminate any instances where it in a comment.
> 2.  Eliminate any instances where the name is after "function" or 
> "procedure".
> 3.  Differentiate between public, private, and static 
> functions/procedures.
> 4.  Use the project file to identify what prg's to search.
>
> With a large app containing an exe and several dll's, some of which 
> reference other dll's, it can get pretty complicated.  What I was hoping 
> was that either the preprocessor or VX might have this already built-in.
>
> -Joe
>
>
> Jorge wrote:
>> Hello Joe
>>> Is there a simple way to determine what functions and procedures are not 
>>> used in a project.
>> you meant your procedures.... ?
>>
>> you can to create a program in 2 parts
>> 1 - you must read your prgs and read the sentences "Procedure" and 
>> "Function" then you add the words tha folow this sentences like a 
>> dictionary
>> 2 - search in all prgs this words and count each find
>> all words with value 0 in its counter..........
>>
>>
>> regards
>>
>> "Joe Carrick" <joe.carrick@dslextreme.com> escribi en el mensaje 
>> news:22fa18bb$49078f48$1dc@news.alaska-software.com...
>>> Is there a simple way to determine what functions and procedures are not 
>>> used in a project.  IOW, if a function or procedure is not actually 
>>> called anyplace in the  project I would like that to be  reported 
>>> similar to declared but not used variables.
>>>
>>> Essentially, I want to eliminate all superfluous procedures and 
>>> functions. I can manually go thru and search for calls to subroutines, 
>>> but it's time consuming and tedious work.  Does something exist that 
>>> does this or do I need to create my own Tool ?
>>>
>>> Thanks, Joe
>>>
>>>
>>>
>>>
>>
>>
>>
>
AUGE_OHRRe: Unused functions and Procedures
on Wed, 20 Aug 2008 22:20:47 +0200
hi,

> Is there a simple way to determine what functions and procedures are not 
> used in a project.  IOW, if a function or procedure is not actually called 
> anyplace in the  project I would like that to be  reported similar to 
> declared but not used variables.

did you try CLICK! ?
Olaf870 did some enhancement for Xbase++

greetings by OHR
Jimmy
Joe Carrick Re: Unused functions and Procedures
on Wed, 20 Aug 2008 14:00:23 -0700
I looked at it but it really isn't what I want.  Just too manual an 
approach.  I'm interested in something much more comprehensive and 
automatic.

-Joe

AUGE_OHR wrote:
> hi,
> 
>> Is there a simple way to determine what functions and procedures are not 
>> used in a project.  IOW, if a function or procedure is not actually called 
>> anyplace in the  project I would like that to be  reported similar to 
>> declared but not used variables.
> 
> did you try CLICK! ?
> Olaf870 did some enhancement for Xbase++
> 
> greetings by OHR
> Jimmy 
> 
>