in reply to Perl Analyzer?
Have you tried B::Lint?
What do you mean by "subs that are declared and never used"? Do you mean a prototype without the actual sub or sub that's present but never referenced?
I suspect that autoloader would make it difficult to determine whether a used module's sub is never actually used or not; different data may result in different paths through the module's code, so the sub may be called when $x = 1.0 but not when $x = 1.5.
The bit about "subs that contain very similar code" is likely impossible to do programmatically. First, it's non-trivial to define "similar" code: functionally identical code may look quite different, and compile to something quite different. Secondly, there may be very sensible reasons why sub move and sub draw differ only in that one sets variable $pencolor = 0; and the other sets $pencolor = -1; (once, long ago, I wrote a FORTRAN-77 library to emulate the Tektronix PLOT-10 package; it had quite few subroutines that differed in just that way).
My suggestion for the "subs that contain similar code" is to print the (named) subs individually, get a bunch of highlighters, and apply judgement.
emc
Outside of a dog, a book is man's best friend. Inside of a dog it's too dark to read.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Analyzer?
by Anonymous Monk on Aug 04, 2006 at 21:54 UTC | |
|
Re^2: Perl Analyzer?
by Coldstone (Acolyte) on Aug 15, 2006 at 22:17 UTC | |
by swampyankee (Parson) on Aug 17, 2006 at 03:27 UTC | |
by adrianh (Chancellor) on Aug 17, 2006 at 07:06 UTC |