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

时间秒杀一切 提交于 2019-12-17 20:25:32

问题


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?


回答1:


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




回答2:


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




回答3:


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.




回答4:


GExperts can show Project Dependencies.




回答5:


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.




回答6:


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!




回答7:


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.




回答8:


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


来源:https://stackoverflow.com/questions/2904011/tool-that-shows-unit-dependencies-for-delphi-2010-or-delphi-7-program

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!