Jump to content
PeterPanettone

IDE addin for project-wide uses clause report?

Recommended Posts

Does anybody know an IDE addin that can create a project-wide uses-clause report, i.e. a report containing all uses-clause unit-names from all units in the project (without doubles)?

 

For example:

 

Unit1 contains this uses clause:

uses Winapi.Messages, System.Variants, System.Classes, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, AdvEdit, AdvEdBtn;

 

Unit2 contains this uses clause:

uses Vcl.Controls, Vcl.Forms, Vcl.Dialogs, AdvGlowButton, Vcl.ExtCtrls;

 

The report would then contain: Winapi.Messages, System.Variants, System.Classes, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, AdvEdit, AdvEdBtn, Vcl.ExtCtrls, AdvGlowButton;

Edited by PeterPanettone

Share this post


Link to post

Pascal analyzer can do this (it has free lite version)

Quote

Usage (unknown, was unknown):
----------------------------------------------------------------------------

Module JwaBaseTypes uses:

  Units used in interface:

      System source not found
      Windows source not found

Module JwaSChannel uses:

  Units used in interface:

      System source not found
      Windows source not found
  ==> JwaBaseTypes unnecessary (used by unit with init)
      JwaWinCrypt in interface (used by unit with init)

Module JwaSspi uses:

  Units used in interface:

      System source not found
      Windows source not found
      JwaBaseTypes in interface (used by unit with init)

Module JwaWinCrypt uses:

  Units used in interface:

      System source not found
      Windows source not found
      JwaBaseTypes in interface (used by unit with init)

Module JwaWinError uses:

  Units used in interface:

      System source not found
      Windows source not found

Module SChannel.Utils uses:

  Units used in interface:

      System source not found
      Windows source not found
      SysUtils source not found
  ==> JwaBaseTypes unnecessary (used by unit with init)
  --> JwaWinError in implementation (used by unit with init)
      JwaWinCrypt in interface (used by unit with init)
      JwaSspi in interface (used by unit with init)
      JwaSChannel in interface (used by unit with init)

 


Modules that are referenced in the Delphi project file, but not used (unknown, was unknown):
--------------------------------------------------------------------------------------------

            (not examined because main file is not a project file)


Modules that are used but not added to the Delphi project file (unknown, was unknown):
--------------------------------------------------------------------------------------

JwaBaseTypes
JwaSChannel
JwaSspi
JwaWinCrypt
JwaWinError
System
SysUtils
Windows


References:
----------------------------------------------------------------------------

JwaBaseTypes references (2):

System, Windows

JwaBaseTypes is referenced by (4):

JwaSChannel, JwaSspi, JwaWinCrypt, SChannel.Utils

JwaSChannel references (4):

JwaBaseTypes, JwaWinCrypt, System, Windows

JwaSChannel is referenced by (1):

SChannel.Utils

JwaSspi references (3):

JwaBaseTypes, System, Windows

JwaSspi is referenced by (1):

SChannel.Utils

JwaWinCrypt references (3):

JwaBaseTypes, System, Windows

JwaWinCrypt is referenced by (2):

JwaSChannel, SChannel.Utils

JwaWinError references (2):

System, Windows

JwaWinError is referenced by (1):

SChannel.Utils

SChannel.Utils references (8):

JwaBaseTypes, JwaSChannel, JwaSspi, JwaWinCrypt, JwaWinError, System,
SysUtils, Windows


Optimal uses list:
----------------------------------------------------------------------------

JwaBaseTypes
JwaWinError
JwaWinCrypt
JwaSspi
JwaSChannel
SChannel.Utils


Runtime initialization order:
----------------------------------------------------------------------------

SChannel.Utils


Mutual unit references (0, was unknown):
----------------------------------------------------------------------------

            (none)


All modules (8, was unknown):
----------------------------------------------------------------------------

JwaBaseTypes
JwaSChannel
JwaSspi
JwaWinCrypt
JwaWinError
SChannel.Utils
SysUtils
Windows

 

The metric is under Reports > Reference > Uses

 

Alternatively, there's delphiunitsizes tool that grabs list of used units from the binary

Edited by Fr0sT.Brutal
  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×