473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

functions not used...

This question might be for another group, but since I use vb.net, I
thought I'd ask here....

I'm looking to clean up some code. Is there a development tool to tell
me which functions are not being used? I know that in C#, the compiler
will tell you which variables are not being used. However, I need this
for functions/methods/properties in VB.NET.

thanks,
Todd

Nov 21 '05 #1
4 1423
You can just search the whole project in VS.NET for that
function's/property's name. If you don't find anything that calls it, then
there you are.

<to********@hotmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
This question might be for another group, but since I use vb.net, I
thought I'd ask here....

I'm looking to clean up some code. Is there a development tool to tell
me which functions are not being used? I know that in C#, the compiler
will tell you which variables are not being used. However, I need this
for functions/methods/properties in VB.NET.

thanks,
Todd

Nov 21 '05 #2
There is a check in FxCop for Uncalled Private Code which can tell if a
private method is not used.

http://www.gotdotnet.com/team/fxcop/

hth,
Alan.

Nov 21 '05 #3
I would have tried this, but it's a huge project with about 150,000
lines of code. I didn't want to look at each method/property and then
do a search for its name.

Thanks anyways,
todd

Nov 21 '05 #4
Todd,
In addition to the other comments.

I don't know of a quick report that tells you if a function is used or not.
(other then the FxCop one).

When I have a function I suspect is not used or one that I want to get ride
of, I put the Obsolete attribute on it, if any errors or warnings are
produced I remove the attribute. If no errors & warnings are produced I go
ahead & remove the function.

Be mindful of public functions in class libraries, as users consuming your
class library may use the function. The Obsolete attribute has overloaded
parameters for error or warning along with what message to display.

Something like:

' cause an error with a specific message
<Obsolete("This function should not be used any more", True)> _
Public Function SomeOldFunction() As Boolean
Return False
End Function

' cause warning with a specific message
<Obsolete("This function should not be used any more")> _
Public Function SomeOldFunction() As Boolean
Return False
End Function

' cause an obsolete warning
<Obsolete()> _
Public Function SomeOldFunction() As Boolean
Return False
End Function
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
<to********@hotmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
| This question might be for another group, but since I use vb.net, I
| thought I'd ask here....
|
| I'm looking to clean up some code. Is there a development tool to tell
| me which functions are not being used? I know that in C#, the compiler
| will tell you which variables are not being used. However, I need this
| for functions/methods/properties in VB.NET.
|
| thanks,
| Todd
|
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

99
by: David MacQuigg | last post by:
I'm not getting any feedback on the most important benefit in my proposed "Ideas for Python 3" thread - the unification of methods and functions. Perhaps it was buried among too many other less...
0
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and...
1
by: db2sysc | last post by:
All, We have listed out the INBUILT Function differences between Sybase and DB2. Kindly provide your feedback or corrections and for CHANGES - DO WE NEED TO CODE our own UDFs?
22
by: TC | last post by:
I have an Access database application with a lot of custom row functions written in VBA. In other words, a lot of queries contain calculated fields which use functions defined in the modules. I...
23
by: Timothy Madden | last post by:
Hello all. I program C++ since a lot of time now and I still don't know this simple thing: what's the problem with local functions so they are not part of C++ ? There surely are many people...
12
by: sam_cit | last post by:
Hi Everyone, I have few questions on inline functions, when i declare a function as inline, is it for sure that the compiler would replace the function call with the actual body of the function?...
14
by: v4vijayakumar | last post by:
Why we need "virtual private member functions"? Why it is not an (compile time) error?
1
MMcCarthy
by: MMcCarthy | last post by:
Access has a number of built-in functions which can be generally used in queries or VBA code. Some of the more common ones are: Note: anything in square brackets is optional Date Functions ...
7
by: Immortal Nephi | last post by:
My project grows large when I put too many member functions into one class. The header file and source code file will have approximately 50,000 lines when one class contains thousand member...
6
KevinADC
by: KevinADC | last post by:
This snippet of code provides several examples of programming techniques that can be applied to most programs. using hashes to create unique results static variable recursive function...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.