Re: Source code analyzer for unused method detection?

2003-10-06 Thread Paul Libbrecht
I would support this request, which, if I understand well, hasn't been 
answered yet.
It is clear that many extra things will be caught (e.g. servlet's 
doGet) by such a report but this is not really a problem and such a 
tool should support being configured to avoid declaring it as unused.

It would help us, at least.

Paul

On Dimanche, octo 5, 2003, at 23:34 Europe/Paris, Tim Anderson wrote:

...which is why having the facility included in the build reports
would make it so useful - cf. checkstyle, pmd etc.
-Original Message-
From: David Zeleznik [mailto:[EMAIL PROTECTED]
Sent: Monday, 6 October 2003 7:26 AM
To: Maven Users List; [EMAIL PROTECTED]
Subject: RE: Source code analyzer for unused method detection?
This is a standard feature of most code obfuscators that operate at 
the
bytecode level, not on the source code. In particular, we use DashO 
to do
exactly this (in addition to other munging). However, as others
have stated,
in the face of instrospection, reflection, dynamic proxies, etc.
you cannot
expect a completely automated solution. Determining an accurate list 
of
unused non-public methods in a large software system is not something 
to
tackle casually and will require a serious investment in developer 
effort.
In addition, any future changes to the code will require a fresh 
analysis
effort.

--
David Zeleznik
Principal Architect
ILOG - Changing the rules of business
mailto:[EMAIL PROTECTED]
http://www.ilog.com
--

-Original Message-
From: Tim Anderson [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 05, 2003 1:48 AM
To: Maven Users List
Subject: Source code analyzer for unused method detection?
Hi,
does anyone know of a code analyzer which can detect unused 
methods?
The PMD plugin only reports on unused private methods - I'm
looking for one
which can also do public or protected methods.

Thanks,

Tim



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Source code analyzer for unused method detection?

2003-10-06 Thread Berin Loritsch
Siegfried Goeschl wrote:

Oops,

considering dynamic class loading and reflection it is actually impossible ...

Cheers,

Siegfried Goeschl


I can second that--but I can go one further.

Due to the type of design and true separation of implementation/interface with
Avalon style components, each component appears to be completely separate.  So,
while we might be able to tell if an interface method is called, it will almost
always be by something that no tool can directly trace.
The only way to tell in systems like that is to perform a certain type of
profiling.  There are three types of profiling, and most people are only
familiar with performance profiling.  The other types are memory profiling
and coverage profiling.
Profiling requires that the application be run through a JVM with profiling
extensions added, and output the results of the run to some output file (unless
you have a commercial tool that give you a GUI at runtime).  The normal
extensions included with the sun JVM will allow you to examine the garbage
collection and performance aspects, but memory fails me if it can do coverage
testing.
Adding an extension requires some C/C++ development, which is platform
dependant.  However, you will even be able to test for orphan private methods.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Source code analyzer for unused method detection?

2003-10-06 Thread Paul Libbrecht
Nooo... I think users of such a tool would accept to write by hand the 
methods that should be considered as entry-points to the package!

Paul

On Lundi, octo 6, 2003, at 14:48 Europe/Paris, Berin Loritsch wrote:

Siegfried Goeschl wrote:

Oops,
considering dynamic class loading and reflection it is actually 
impossible ...
Cheers,
Siegfried Goeschl


I can second that--but I can go one further.

Due to the type of design and true separation of 
implementation/interface with
Avalon style components, each component appears to be completely 
separate.  So,
while we might be able to tell if an interface method is called, it 
will almost
always be by something that no tool can directly trace.

The only way to tell in systems like that is to perform a certain type 
of
profiling.  There are three types of profiling, and most people are 
only
familiar with performance profiling.  The other types are memory 
profiling
and coverage profiling.

Profiling requires that the application be run through a JVM with 
profiling
extensions added, and output the results of the run to some output 
file (unless
you have a commercial tool that give you a GUI at runtime).  The normal
extensions included with the sun JVM will allow you to examine the 
garbage
collection and performance aspects, but memory fails me if it can do 
coverage
testing.

Adding an extension requires some C/C++ development, which is platform
dependant.  However, you will even be able to test for orphan private 
methods.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Source code analyzer for unused method detection?

2003-10-06 Thread Berin Loritsch
Paul Libbrecht wrote:

Nooo... I think users of such a tool would accept to write by hand the 
methods that should be considered as entry-points to the package!

I am not advocating that this project build such an animal.  All I am
saying is that when you have every piece as truly isolated as possible,
you can't authoritatively tell what is used and not used unless you
run it in the application.
You can manually define certain interfaces to be the entry-points for
a set of components, but what if one of the methods on the interface is
never called once in the system?
There is no ideal solution.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Source code analyzer for unused method detection?

2003-10-06 Thread Steve Garcia
We use Clover (and there is a plugin for it last time I checked) which gives
you a bunch of statistics (method completion, statement completion, and
conditional completion) on code coverage in your source directory.  These
statistics are bsed on your unit test coverage.


-Original Message-
From: Tim Anderson
To: Maven Users List
Sent: 10/5/2003 5:04 AM
Subject: RE: Source code analyzer for unused method detection?

The results wouldn't be all that meaningful on reusable components,
but at the application level, it would be useful to 
detect cruft.

-Tim

 -Original Message-
 From: Vincent Massol [mailto:[EMAIL PROTECTED]
 Sent: Sunday, 5 October 2003 6:09 PM
 To: 'Maven Users List'
 Subject: RE: Source code analyzer for unused method detection?
 
 
 Hi Tim,
 
 How do you know a public method is not used by external code?
  
 -Vincent
 
  -Original Message-
  From: Tim Anderson [mailto:[EMAIL PROTECTED]
  Sent: 05 October 2003 07:48
  To: Maven Users List
  Subject: Source code analyzer for unused method detection?
  
  Hi,
  does anyone know of a code analyzer which can detect unused
 methods?
  The PMD plugin only reports on unused private methods - I'm looking
 for
  one
  which can also do public or protected methods.
  
  Thanks,
  
  Tim
  
  
  
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Source code analyzer for unused method detection?

2003-10-06 Thread Steve Garcia
Clover actually reports on all method/statement/conditional level usage in
your code.  You first have to instrument your code and all that means is
running your source through the Clover filter which adds clover java lines
after every statement in your class.  Then when you run your units against
that instrumented code a small clover database is updated with statistics on
which statements were hit.  

I think it's a great product and raises the quality of my unit tests.

-Original Message-
From: Siegfried Goeschl
To: Maven Users List
Sent: 10/5/2003 8:42 AM
Subject: Re: Source code analyzer for unused method detection?

Oops,

considering dynamic class loading and reflection it is actually
impossible ...

Cheers,

Siegfried Goeschl



On Sunday 05 October 2003 17:27, Siegfried Goeschl wrote:
 It is actually not easy to detect an unused method due inheritance and
 polymorphism since the class of the instance you use is determined at
 runtime.

 If you have some time to spend you can either search the web (there
are
 many static source code analyzers out there and tell us your
findings!!) or
 use a code profiler such as CLOVER or JProbe .

 Cheers,

 Siegfried Goeschl

 On Sunday 05 October 2003 14:04, Tim Anderson wrote:
  The results wouldn't be all that meaningful on reusable components,
  but at the application level, it would be useful to
  detect cruft.
 
  -Tim
 
   -Original Message-
   From: Vincent Massol [mailto:[EMAIL PROTECTED]
   Sent: Sunday, 5 October 2003 6:09 PM
   To: 'Maven Users List'
   Subject: RE: Source code analyzer for unused method detection?
  
  
   Hi Tim,
  
   How do you know a public method is not used by external code?
  
   -Vincent
  
-Original Message-
From: Tim Anderson [mailto:[EMAIL PROTECTED]
Sent: 05 October 2003 07:48
To: Maven Users List
Subject: Source code analyzer for unused method detection?
   
Hi,
does anyone know of a code analyzer which can detect unused
  
   methods?
  
The PMD plugin only reports on unused private methods - I'm
looking
  
   for
  
one
which can also do public or protected methods.
   
Thanks,
   
Tim
   
   
   
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
  
-
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
 
-
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Source code analyzer for unused method detection?

2003-10-06 Thread Paul Libbrecht
Berin Loritsch wrote:
Paul Libbrecht wrote:

Nooo... I think users of such a tool would accept to write by hand the 
methods that should be considered as entry-points to the package!

I am not advocating that this project build such an animal.  All I am
saying is that when you have every piece as truly isolated as possible,
you can't authoritatively tell what is used and not used unless you
run it in the application.
You can manually define certain interfaces to be the entry-points for
a set of components, but what if one of the methods on the interface is
never called once in the system?
There is no ideal solution.
Well, if you're developing a component, you choose to make it public or 
not... it's about the same choice...

Paul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Source code analyzer for unused method detection?

2003-10-05 Thread Vincent Massol
Hi Tim,

How do you know a public method is not used by external code?
 
-Vincent

 -Original Message-
 From: Tim Anderson [mailto:[EMAIL PROTECTED]
 Sent: 05 October 2003 07:48
 To: Maven Users List
 Subject: Source code analyzer for unused method detection?
 
 Hi,
 does anyone know of a code analyzer which can detect unused
methods?
 The PMD plugin only reports on unused private methods - I'm looking
for
 one
 which can also do public or protected methods.
 
 Thanks,
 
 Tim
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Source code analyzer for unused method detection?

2003-10-05 Thread Tim Anderson
The results wouldn't be all that meaningful on reusable components,
but at the application level, it would be useful to 
detect cruft.

-Tim

 -Original Message-
 From: Vincent Massol [mailto:[EMAIL PROTECTED]
 Sent: Sunday, 5 October 2003 6:09 PM
 To: 'Maven Users List'
 Subject: RE: Source code analyzer for unused method detection?
 
 
 Hi Tim,
 
 How do you know a public method is not used by external code?
  
 -Vincent
 
  -Original Message-
  From: Tim Anderson [mailto:[EMAIL PROTECTED]
  Sent: 05 October 2003 07:48
  To: Maven Users List
  Subject: Source code analyzer for unused method detection?
  
  Hi,
  does anyone know of a code analyzer which can detect unused
 methods?
  The PMD plugin only reports on unused private methods - I'm looking
 for
  one
  which can also do public or protected methods.
  
  Thanks,
  
  Tim
  
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Source code analyzer for unused method detection?

2003-10-05 Thread Siegfried Goeschl
It is actually not easy to detect an unused method due inheritance and 
polymorphism since the class of the instance you use is determined at 
runtime.

If you have some time to spend you can either search the web (there are many 
static source code analyzers out there and tell us your findings!!) or use a 
code profiler such as CLOVER or JProbe .

Cheers,

Siegfried Goeschl


On Sunday 05 October 2003 14:04, Tim Anderson wrote:
 The results wouldn't be all that meaningful on reusable components,
 but at the application level, it would be useful to
 detect cruft.

 -Tim

  -Original Message-
  From: Vincent Massol [mailto:[EMAIL PROTECTED]
  Sent: Sunday, 5 October 2003 6:09 PM
  To: 'Maven Users List'
  Subject: RE: Source code analyzer for unused method detection?
 
 
  Hi Tim,
 
  How do you know a public method is not used by external code?
 
  -Vincent
 
   -Original Message-
   From: Tim Anderson [mailto:[EMAIL PROTECTED]
   Sent: 05 October 2003 07:48
   To: Maven Users List
   Subject: Source code analyzer for unused method detection?
  
   Hi,
   does anyone know of a code analyzer which can detect unused
 
  methods?
 
   The PMD plugin only reports on unused private methods - I'm looking
 
  for
 
   one
   which can also do public or protected methods.
  
   Thanks,
  
   Tim
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Source code analyzer for unused method detection?

2003-10-05 Thread Siegfried Goeschl
Oops,

considering dynamic class loading and reflection it is actually impossible ...

Cheers,

Siegfried Goeschl



On Sunday 05 October 2003 17:27, Siegfried Goeschl wrote:
 It is actually not easy to detect an unused method due inheritance and
 polymorphism since the class of the instance you use is determined at
 runtime.

 If you have some time to spend you can either search the web (there are
 many static source code analyzers out there and tell us your findings!!) or
 use a code profiler such as CLOVER or JProbe .

 Cheers,

 Siegfried Goeschl

 On Sunday 05 October 2003 14:04, Tim Anderson wrote:
  The results wouldn't be all that meaningful on reusable components,
  but at the application level, it would be useful to
  detect cruft.
 
  -Tim
 
   -Original Message-
   From: Vincent Massol [mailto:[EMAIL PROTECTED]
   Sent: Sunday, 5 October 2003 6:09 PM
   To: 'Maven Users List'
   Subject: RE: Source code analyzer for unused method detection?
  
  
   Hi Tim,
  
   How do you know a public method is not used by external code?
  
   -Vincent
  
-Original Message-
From: Tim Anderson [mailto:[EMAIL PROTECTED]
Sent: 05 October 2003 07:48
To: Maven Users List
Subject: Source code analyzer for unused method detection?
   
Hi,
does anyone know of a code analyzer which can detect unused
  
   methods?
  
The PMD plugin only reports on unused private methods - I'm looking
  
   for
  
one
which can also do public or protected methods.
   
Thanks,
   
Tim
   
   
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Source code analyzer for unused method detection?

2003-10-05 Thread Tim Anderson
Not impossible, just imperfect.
Several byte code obfuscators provide the facility to
remove unused methods from jars - presumably they face
the same issues. 

-Tim 

 -Original Message-
 From: Siegfried Goeschl [mailto:[EMAIL PROTECTED]
 Sent: Monday, 6 October 2003 1:43 AM
 To: Maven Users List
 Subject: Re: Source code analyzer for unused method detection?
 
 
 Oops,
 
 considering dynamic class loading and reflection it is actually 
 impossible ...
 
 Cheers,
 
 Siegfried Goeschl
 
 
 
 On Sunday 05 October 2003 17:27, Siegfried Goeschl wrote:
  It is actually not easy to detect an unused method due inheritance and
  polymorphism since the class of the instance you use is determined at
  runtime.
 
  If you have some time to spend you can either search the web (there are
  many static source code analyzers out there and tell us your 
 findings!!) or
  use a code profiler such as CLOVER or JProbe .
 
  Cheers,
 
  Siegfried Goeschl
 
  On Sunday 05 October 2003 14:04, Tim Anderson wrote:
   The results wouldn't be all that meaningful on reusable components,
   but at the application level, it would be useful to
   detect cruft.
  
   -Tim
  
-Original Message-
From: Vincent Massol [mailto:[EMAIL PROTECTED]
Sent: Sunday, 5 October 2003 6:09 PM
To: 'Maven Users List'
Subject: RE: Source code analyzer for unused method detection?
   
   
Hi Tim,
   
How do you know a public method is not used by external code?
   
-Vincent
   
 -Original Message-
 From: Tim Anderson [mailto:[EMAIL PROTECTED]
 Sent: 05 October 2003 07:48
 To: Maven Users List
 Subject: Source code analyzer for unused method detection?

 Hi,
 does anyone know of a code analyzer which can detect unused
   
methods?
   
 The PMD plugin only reports on unused private methods - 
 I'm looking
   
for
   
 one
 which can also do public or protected methods.

 Thanks,

 Tim



 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   

 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Source code analyzer for unused method detection?

2003-10-05 Thread David Zeleznik
This is a standard feature of most code obfuscators that operate at the
bytecode level, not on the source code. In particular, we use DashO to do
exactly this (in addition to other munging). However, as others have stated,
in the face of instrospection, reflection, dynamic proxies, etc. you cannot
expect a completely automated solution. Determining an accurate list of
unused non-public methods in a large software system is not something to
tackle casually and will require a serious investment in developer effort.
In addition, any future changes to the code will require a fresh analysis
effort.

--
David Zeleznik
Principal Architect
ILOG - Changing the rules of business
mailto:[EMAIL PROTECTED]
http://www.ilog.com
--


 -Original Message-
 From: Tim Anderson [mailto:[EMAIL PROTECTED]
 Sent: Sunday, October 05, 2003 1:48 AM
 To: Maven Users List
 Subject: Source code analyzer for unused method detection?


 Hi,
 does anyone know of a code analyzer which can detect unused methods?
 The PMD plugin only reports on unused private methods - I'm
 looking for one
 which can also do public or protected methods.

 Thanks,

 Tim



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Source code analyzer for unused method detection?

2003-10-05 Thread Tim Anderson
...which is why having the facility included in the build reports
would make it so useful - cf. checkstyle, pmd etc.

 -Original Message-
 From: David Zeleznik [mailto:[EMAIL PROTECTED]
 Sent: Monday, 6 October 2003 7:26 AM
 To: Maven Users List; [EMAIL PROTECTED]
 Subject: RE: Source code analyzer for unused method detection?


 This is a standard feature of most code obfuscators that operate at the
 bytecode level, not on the source code. In particular, we use DashO to do
 exactly this (in addition to other munging). However, as others
 have stated,
 in the face of instrospection, reflection, dynamic proxies, etc.
 you cannot
 expect a completely automated solution. Determining an accurate list of
 unused non-public methods in a large software system is not something to
 tackle casually and will require a serious investment in developer effort.
 In addition, any future changes to the code will require a fresh analysis
 effort.

 --
 David Zeleznik
 Principal Architect
 ILOG - Changing the rules of business
 mailto:[EMAIL PROTECTED]
 http://www.ilog.com
 --


  -Original Message-
  From: Tim Anderson [mailto:[EMAIL PROTECTED]
  Sent: Sunday, October 05, 2003 1:48 AM
  To: Maven Users List
  Subject: Source code analyzer for unused method detection?
 
 
  Hi,
  does anyone know of a code analyzer which can detect unused methods?
  The PMD plugin only reports on unused private methods - I'm
  looking for one
  which can also do public or protected methods.
 
  Thanks,
 
  Tim
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Source code analyzer for unused method detection?

2003-10-05 Thread Jim Dixon
On Sun, 5 Oct 2003, Tim Anderson wrote:

 does anyone know of a code analyzer which can detect unused methods?
 The PMD plugin only reports on unused private methods - I'm looking for one
 which can also do public or protected methods.

IBM's JAX product did this, but it has been folded into WebSphere and
I can no longer google a downloadable version.  It used to be available
from IBM DeveloperWorks.

--
Jim Dixon  [EMAIL PROTECTED]   tel +44 117 982 0786  mobile +44 797 373 7881


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Source code analyzer for unused method detection?

2003-10-04 Thread Tim Anderson
Hi,
does anyone know of a code analyzer which can detect unused methods?
The PMD plugin only reports on unused private methods - I'm looking for one
which can also do public or protected methods.

Thanks,

Tim



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]