6.5.4.1. Views¶
C#/.NET RFGs include:
a
Code Factsview,an
Assemblyview,an
Assembly Referencesview,an
Entriesview,a
Callview, andan
Includeview.
Analyses might enrich the RFG with further views (e.g., a Dead / Alive view).
Code Facts View¶
The Code Facts view of a C#/.NET RFG contains nodes for types and their
children, edges between them, and
Custom_Attribute edges from all assemblies in the RFG. These are structured
by
Namespace nodes.
Assembly View¶
The Assembly view of a C#/.NET RFG has the following structure:
At the top level, there is one
Assemblynode for each assembly used in the RFG.Each
Assemblycontains a namespace hierarchy including all types defined within the assembly and their children.All edges between types and their children, as well as
Custom_Attributeedges, are represented in theAssemblyview.
Both referenced assemblies and source assemblies (from referenced projects
and the main project itself) are represented in the Assembly view.
Caution
If no source assembly information was provided when creating the C#
package file (.cspkg) from which the RFG is generated, types not assigned to
an assembly are collected in a ‘default’
Assembly named
?.
Entries View¶
The Entries view of a C#/.NET RFG is similar to the one created for C or C++
projects: it
contains program entry points (such as the Main function of executables)
and entities that should be considered ‘initially alive’ by analyses such as dead
code analysis. By default, the view contains the entry point of each source assembly,
all static constructors, finalizers and explicit interface implementations, and all
non-abstract methods of referenced assemblies. For library projects, it also contains
all methods with the access modifier public, protected,
internal, or protected internal.
Call View¶
The Call view of a C#/.NET RFG is similar to the one created for C or C++
projects: its nodes represent routines, and edges between nodes A and B
indicate that A calls B. This view is useful for detecting call cycles in the program.
Assembly References View¶
The Assembly References view represents dependencies between reference
assemblies and source assemblies. It contains the following elements:
For each source or reference assembly represented in the RFG, the view contains a
Assemblynode; these are the same as the top-level nodes of theAssemblyview.A ‘default’
Assembly(named?), which may contain unresolved references, special types such as thedynamictype, or all types from source code if no source assembly information was provided.For each pair of assemblies A and B where A references B (e.g., by using one of its types or type members), there exists an edge A→B of type
Assembly_Referencein the view.No other elements are contained in the
Assembly Referencesview.
Include View¶
The Include view of a C#/.NET RFG is similar to the one created for C or C++
projects: its nodes represent directories and files whose contents form the source code
basis of the analyzed project.