开发者

NDepend query methods/types in framework assembly being used by other assemblies/types

I am trying to determine which types or methods in a base framework assembly are being used by other assemblies in the application system. I cannot seem to find a straight-cut query to do that.

What i have to do is first determine which assemblies are directly using the framework assembly, then manually list them in a second query

SELECT TYPES FROM ASSEMBLIES "IBM.Data.DB2"
WHERE IsDirectlyUsedBy "ASSEMBLY:FirstDirectUsedByAssebmly"
OR IsDirectlyUsedBy "ASSEMBLY:SecondDirectUsedByAssebmly"
OR IsDirectlyUsedBy "ASSEMBLY:ThirdDirectUsedByAssebmly"
OR IsDirectlyUsedBy "ASSEMBLY:FourthDirectUsedByAssebmly"

Is there a better/faster way to query for this?

Additionally, the query results are focused on the matched types only. The Dependency graph or matrix exported only shows details of those. I do not know how to render a graph that shows those types or methods plus show the dependent types/methods from other assemblies that are consuming them?

UPDATE

I cannot use a query like

SELECT METHODS/TYPES WHERE IsPublic AND !CouldBeInternal

because the results return very queer results of using obfuscated types within the IBM.Data.DB2 assembly.

SELECT TYPES
FROM ASSEMBLIES "IBM.Data.DB2"
WHERE IsPublic AND !CouldBeInternal


48 items 

--------------------------------------------------+--------------+
types                                             |# IL instructi|
                                                  |ons           |
--------------------------------------------------+--------------+
IBM.Data.DB2.ae+m                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+x                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+f                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+ac           开发者_如何学JAVA                     |0             |
                                                  |              |
IBM.Data.DB2.ae+aa                                |0             |
                                                  |              |
IBM.Data.DB2.ae+u                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+z                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+e                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+b                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+g                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+ab                                |0             |
                                                  |              |
IBM.Data.DB2.ae+h                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+r                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+p                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+ad                                |0             |
                                                  |              |
IBM.Data.DB2.ae+i                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+j                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+t                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+af                                |0             |
                                                  |              |
IBM.Data.DB2.ae+k                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+l                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+y                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+a                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+q                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+n                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+d                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+c                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+ae                                |0             |
                                                  |              |
IBM.Data.DB2.ae+o                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+w                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+s                                 |0             |
                                                  |              |
IBM.Data.DB2.ae+v                                 |0             |
                                                  |              |
IBM.Data.DB2.DB2Command                           |2 527         |
                                                  |              |
IBM.Data.DB2.DB2Connection                        |3 246         |
                                                  |              |
IBM.Data.DB2.DB2DataAdapter                       |520           |
                                                  |              |
IBM.Data.DB2.DB2DataReader                        |4 220         |
                                                  |              |
IBM.Data.DB2.DB2_UDF_PLATFORM                     |0             |
                                                  |              |
IBM.Data.DB2.DB2Enumerator+DB2EnumInstance        |19            |
                                                  |              |
IBM.Data.DB2.DB2Enumerator+DB2EnumDatabase        |15            |
                                                  |              |
IBM.Data.DB2.DB2Error                             |98            |
                                                  |              |
IBM.Data.DB2.DB2ErrorCollection                   |55            |
                                                  |              |
IBM.Data.DB2.DB2Exception                         |185           |
                                                  |              |
IBM.Data.DB2.DB2Parameter                         |1 853         |
                                                  |              |
IBM.Data.DB2.DB2ParameterCollection               |1 383         |
                                                  |              |
IBM.Data.DB2.DB2RowUpdatedEventHandler            |0             |
                                                  |              |
IBM.Data.DB2.DB2RowUpdatedEventArgs               |14            |
                                                  |              |
IBM.Data.DB2.DB2Type                              |0             |
                                                  |              |
IBM.Data.DB2.DB2XmlReader                         |500           |
                                                  |              |
--------------------------------------------------+--------------+
Sum:                                              |14 635        |
                                                  |              |
Average:                                          |304.9         |
                                                  |              |
Minimum:                                          |0             |
                                                  |              |
Maximum:                                          |4 220         |
                                                  |              |
Standard deviation:                               |868.22        |
                                                  |              |
Variance:                                         |753 808       |
                                                  |              |
--------------------------------------------------+--------------+

Our code does not use those types and enums directly.


This query returns the methods (respectively the types), that are public and could not be internal. Hence, it returns the methods/types that are indeed used outside of their declaring assembly.

SELECT METHODS/TYPES WHERE IsPublic AND !CouldBeInternal
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜