RobertFrank
RobertFrank

Reputation: 7394

Tool that shows unit dependencies for Delphi 2010 or Delphi 7 program

We're trying to untangle a hairball of 100's of units, removing some.

It would be helpful if there was tool that would show us what units were explicitly using unit X.

Penganza doesn't seem to have a report that does that. (Although it has lots of other useful reports.)

Can anyone suggest a tool or strategy for doing this, other than just hiding unit x and then hitting F9 ... repeatedly?

Upvotes: 4

Views: 5037

Answers (8)

norgepaul
norgepaul

Reputation: 6053

We've just released a freeware utility that does exactly what you need plus quite a bit more. It's called the Delphi Unit Dependency Scanner (DUDs) and you can download it here: http://www.easy-ip.net/delphi-unit-dependency-scanner.html

Sorry it's a bit late!

Upvotes: 1

mjn
mjn

Reputation: 36654

A newcomer in this field is the Delphi Plugin for Sonar. It does not list unit dependencies but can find unused files and "dead" code (and more).

Implemented features:

  1. Counting lines of code, statements, number of files
  2. Counting number of classes, number of packages, methods, accessors
  3. Counting number of public API (methods, classes and fields)
  4. Counting comments ratio, comment lines (including blank lines)
  5. CPD (code duplication, how many lines, block and in how many files)
  6. Code Complexity (per method, class, file; complexity distribution over methods, classes and files)
  7. LCOM4 and RFC
  8. Code colorization
  9. Unit tests reports
  10. Assembler syntax in grammar
  11. Include statement
  12. Parsing preprocessor statements
  13. Rules
  14. Code coverage reports
  15. Source code highlight for unit tests
  16. “Dead” code recognition
  17. Unused files recognition

Upvotes: 0

Marcio
Marcio

Reputation: 19

Headway Software's Structure 101g (and Restructure 101g) can do that really well, with the Delphi plugin.

Disclaimer: I wrote the flavors to analyze Delphi. I use them professionally, helping clients.

Upvotes: 1

Peter Turner
Peter Turner

Reputation: 11435

I was going to mention Icarus, but when I googled them I got this stack overflow answer, which you might want to check out.

Then again, sometimes I just like to delete my whole Unit Output Directory, then count my new DCU's, and that works too.

The reason you may like Icarus and not GExperts is that it doesn't rely on you to have properly maintained the uses statements in your project file.

Upvotes: 0

Chris Thornton
Chris Thornton

Reputation: 15817

Peganza Pascal Analyzer can do the work. I haven't worked with it much, but a former dev here wrote a system that uses PAL to do the analysis, then dumped the results into a database, and then there's a browser app that lets you enter a unit name and it returns the list of units affected, whether they would need to be rebuilt if the unit changed, or if the interface changed. We use lots of BPLs so you can sometimes change a unit and you don't have to re-build other binaries that use your unit, unless the interface changed. This saves us lots of work (hundreds of BPLs and EXEs).

Chris

Upvotes: 2

Jeroen Wiert Pluimers
Jeroen Wiert Pluimers

Reputation: 24493

MMX (Model Maker Code Explorer) has a nice unit dependency analyzer (it is especially good at detecting cycles).

For more details, see this answer.

--jeroen

Upvotes: 6

Lieven Keersmaekers
Lieven Keersmaekers

Reputation: 58451

From a similar question here

You might want to take a look at at CnPack.
CnPack includes a Uses cleaner wizard wich hasn't failed me yet.

Upvotes: 5

Ondrej Kelle
Ondrej Kelle

Reputation: 37211

GExperts can show Project Dependencies.

Upvotes: 4

Related Questions