Skip to main content
The analyzer is the first layer of CodeGraph. It parses your source code and extracts a graph of nodes (code entities) and edges (relationships between them).

How It Works

1

Open Solution

Roslyn opens your .sln file and compiles all projects
2

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:
CategoryTypeDescription
ContainerNamespaceLogical grouping of types
ContainerClassClass definition
ContainerStructValue type definition
ContainerInterfaceInterface contract
ContainerEnumEnumeration type
ContainerRecordRecord type (C# 9+)
MemberMethodMethod definition
MemberConstructorConstructor definition
MemberPropertyProperty definition
MemberFieldField definition
MemberEventEvent definition
MemberIndexerIndexer definition
MemberOperatorOperator overload
OtherParameterMethod/constructor parameter
OtherLocalVariableLocal variable
OtherEnumMemberEnum value
OtherDelegateDelegate type
OtherLambdaLambda expression

Edge Types

Edges represent relationships between nodes:
CategoryEdgeDescriptionExample
StructuralContainsParent contains childNamespaceClass
StructuralInheritsClass extends baseAdminUserUser
StructuralImplementsType implements interfaceUserServiceIUserService
StructuralOverridesMethod overrides baseDerived.DoWork()Base.DoWork()
CouplingCallsMethod invokes anotherCreateOrder()GetUser()
CouplingInstantiatesCreates instance via newHandlernew Service()
CouplingReferencesType/member referenceField 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:
{
  "id": "MyApp.Services.UserService",
  "name": "UserService",
  "type": "Class",
  "fullName": "MyApp.Services.UserService",
  "filePath": "/src/Services/UserService.cs",
  "namespace": "MyApp.Services",
  "visibility": "Public",
  "isAbstract": false,
  "isStatic": false,
  "isSealed": false
}

Properties by Type

  • fullName - Fully qualified name
  • visibility - Public, Internal, Private, Protected
  • isAbstract - Abstract class/method
  • isSealed - Sealed/final class
  • isStatic - Static class
  • baseType - Base class (for inheritance)
  • interfaces - Implemented interfaces
  • signature - Full method signature with parameters
  • returnType - Return type
  • visibility - Access modifier
  • isStatic - Static method
  • isAbstract - Abstract method
  • isVirtual - Virtual method
  • isOverride - Override method
  • isAsync - Async method
  • type - Property/field type
  • visibility - Access modifier
  • isStatic - Static member
  • isReadOnly - Read-only field or get-only property
  • isConst - Constant field
  • type - Parameter type
  • isRef - ref parameter
  • isOut - out parameter
  • isParams - params array
  • hasDefault - 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
This keeps the graph focused on your architecture, not the entire .NET ecosystem.

What’s Next?