How It Works
1
Open Solution
Roslyn opens your
.sln file and compiles all projects2
Traverse Symbols
Walk through namespaces, types, and members in the symbol tree
3
Extract Nodes
Create a node for each code entity with its properties
4
Extract Edges
Identify relationships between nodes (inheritance, calls, references)
Node Types
Nodes represent code entities in your codebase. CodeGraph extracts 18 different node types:| Category | Type | Description |
|---|---|---|
| Container | Namespace | Logical grouping of types |
| Container | Class | Class definition |
| Container | Struct | Value type definition |
| Container | Interface | Interface contract |
| Container | Enum | Enumeration type |
| Container | Record | Record type (C# 9+) |
| Member | Method | Method definition |
| Member | Constructor | Constructor definition |
| Member | Property | Property definition |
| Member | Field | Field definition |
| Member | Event | Event definition |
| Member | Indexer | Indexer definition |
| Member | Operator | Operator overload |
| Other | Parameter | Method/constructor parameter |
| Other | LocalVariable | Local variable |
| Other | EnumMember | Enum value |
| Other | Delegate | Delegate type |
| Other | Lambda | Lambda expression |
Edge Types
Edges represent relationships between nodes:| Category | Edge | Description | Example |
|---|---|---|---|
| Structural | Contains | Parent contains child | Namespace → Class |
| Structural | Inherits | Class extends base | AdminUser → User |
| Structural | Implements | Type implements interface | UserService → IUserService |
| Structural | Overrides | Method overrides base | Derived.DoWork() → Base.DoWork() |
| Coupling | Calls | Method invokes another | CreateOrder() → GetUser() |
| Coupling | Instantiates | Creates instance via new | Handler → new Service() |
| Coupling | References | Type/member reference | Field types, return types, parameters |
The
References edge captures type dependencies from field types, method return types, parameter types, and generic type arguments.Additional DataFlow edges (
Reads, Writes, Returns, Creates, Throws, DataFlowsTo) are planned. See the Roadmap for details.Node Properties
Each node carries properties extracted during analysis:Properties by Type
Types (Class, Struct, Interface, Record)
Types (Class, Struct, Interface, Record)
fullName- Fully qualified namevisibility- Public, Internal, Private, ProtectedisAbstract- Abstract class/methodisSealed- Sealed/final classisStatic- Static classbaseType- Base class (for inheritance)interfaces- Implemented interfaces
Methods & Constructors
Methods & Constructors
signature- Full method signature with parametersreturnType- Return typevisibility- Access modifierisStatic- Static methodisAbstract- Abstract methodisVirtual- Virtual methodisOverride- Override methodisAsync- Async method
Properties & Fields
Properties & Fields
type- Property/field typevisibility- Access modifierisStatic- Static memberisReadOnly- Read-only field or get-only propertyisConst- Constant field
Parameters
Parameters
type- Parameter typeisRef- ref parameterisOut- out parameterisParams- params arrayhasDefault- Has default value
Filtering
The analyzer only extracts source symbols:- Types and members defined in your code
- No BCL/Framework types (System.String, etc.)
- No compiler-generated members
- No implicit declarations