6.5.4.3. Edges (Dependencies)¶
This section describes the types of edges that are extracted from source code and
referenced assemblies. We do only list edges that actually appear in one of the standard
views of C# RFGs (so e.g. the edge class
Call does not appear
in the list, but some of its subclasses do).
Assembly_Reference¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
Description
For two
Assembly nodes A₁ and A₂, an
edge A₁→ A₂ of type
Assembly_Reference represents that A₁ references A₂.
Cast_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
Cast_Of_Type
represents the fact that a cast to type T appears in the context of entity
e.
Catch¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An
Catch edge o→ E represents the fact
that in entity o there exists an exception handler for exceptions of type
E.
Note
Code Example
using System;
public class AClass
{
public class AnException : Exception
{}
public void Foo()
{
throw new AnException();
}
public void AMethod()
{
try
{
Foo();
}
catch (AnException e)
{ }
}
}
Example: Catch clause¶
Custom_Attribute¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e→ c of type
Custom_Attribute represents the fact that entity e is decorated by
an attribute, with c being the corresponding constructor of the attribute class
(see C# specification 4.0, 17).
Note
Code Example
public class AClass
{
[System.Obsolete("Use NewMethod() instead", false)]
public void OldMethod()
{}
public void NewMethod()
{}
}
Example of a custom attribute.¶
Default_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
Default_Of_Type represents the fact that method e contains a
default expression using type T as an operand.
Dispatching_Call¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
Every call to an instance method is represented by an edge of type
Dispatching_Call, with the source of the edge being the caller and the
target being the callee.
Note
Code Example
public class AClass
{
public static void AStaticMethod()
{ }
public void AnInstanceMethod()
{ }
public void AMethod()
{
AClass.AStaticMethod();
AnInstanceMethod();
}
}
Example: Static calls and dispatching calls.¶
Enclosing¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
Nodes of type
Enclosing represent either that
a type member is declared within a type,
a type is nested within another type,
a type is declared within a namespace,
a namespace contains several types of A; then the namespace with the types is enclosed in A,
an accessor is declared within a property or indexer or event.
Note
The
Enclosing edges indicate the hierarchical
containment of
Member and
Constant within
Type etc.
Enumerator_Use¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
Description
An
Enumerator_Use edge from an entity e to a
Constant constant C represents the fact that
C is accessed in the context of e.
Note
Code Example
public enum Color
{
Red,
Blue,
Green
}
public class ColorPicker
{
public Color GetStandard()
{
return Color.Red;
}
}
A method accessing an enumerator value.¶
Extend¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
For two nodes T₁ and T₂ representing a (generic or nongeneric) type,
an edge T₁→ T₂ of type
Extend
represents that T₂ is the direct base type of T₁.
Note
Code Example
public class Parent
{ }
public class AClass : Parent // direction AClass -> Parent
{ }
Example: Extend edges.¶
Implementation_Of¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
For a type node T and a node I representing a (generic or non-generic)
interface type, an edge T→ I of type
Implementation_Of indicates that T implements I. For a
method node m(T) defined in a type T and a method node m(I)
defined in an (generic or nongeneric) interface I, an edge
m(T) → m(I) of type
Implementation_Of indicates that m(T) is the implementation of
m(I) in T.
Note
Code Example
public interface IAnInterface
{
void DoIt();
}
public class AClass: IAnInterface
{
public void DoIt() {}
}
A class implements an interface.¶
Inherit¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
Description
Edges of type
Inherit are inserted if the following
scenario occurs: A type B inherits from a type A. A contains a
definition for an instance method m, and B does not override it. If in
the code a call b.m(…) occurs, where the static type of the caller is
B, a “copy” m(B) of m is placed within the node B, which
is then the target of the call, and an edge m → m(B)` of type
Inherit is inserted. The same applies in the case of
fields. This special treatment is necessary to support e.g. the reflexion analysis for
detecting architectural flaws.
Instance_Of¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An
Instance_Of edge e₁→ e₂
indicates that e₁ is a generic instance of e₂ (e₁, e₂
either represent both types or both methods).
Instantiate¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An
Instantiate e → T represents that
a generic instance of the generic type T is used in the context of e.
Local_Var_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
Local_Var_Of_Type represents the fact that entity e contains a
local variable declaration of type T.
Note
Code Example
public class AClass
{
public struct Pair
{
public int Left;
public int Right;
}
public void AMethod()
{
Pair aPair; // direction: AMethod -> Pair
}
}
Example: Edges specifying the type of a local variable.¶
Member_Address¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
An edge m→ e with e a node representing a member indicates that the address of e is taken in the context of m. These edges appear both in the Code Facts view and in the Assembly view.
Member_Set¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
Description
An edge m→ e of type
Member_Set with
e being a member node indicates that the member represented by e is
possibly set in the context of m.
Note
Code Example
public class X
{
public Y b;
}
public class Y
{
public Z c;
}
public class Z
{
public X a;
public void AMethod()
{
a.b.c = null;
}
}
Example: Setting a member.¶
Member_Use¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
Description
An edge m→ e of type
Member_Use with
e being a member node indicates that e is possibly read in the context
of m.
Note
Code Example
public class AClass
{
int AField;
public static int AMethod()
{
AClass a = new AClass();
return a.AField; // direction: AMethod -> AField
}
}
Example: Using a member.¶
Method_Address¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
Description
An edge m₁→ m₂ of type
Method_Address with m₂ a method node indicates that the address
of m₂ is taken in the context of entity m₁. This happens e.g. if a
method is used as an argument of a call.
Note
Code Example
public class AClass
{
public delegate void ADelegate();
public void Foo()
{ }
public void AMethod()
{
ADelegate f;
f = Foo; // direction AMethod -> Foo
}
}
Example: Taking a method address.¶
Nameof_Of_Member¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → M of type
Nameof_Of_Member represents the fact that method e contains a
nameof expression using member M as an operand.
Nameof_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
Nameof_Of_Type represents the fact that method e contains a
nameof expression using type T as an operand.
New_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
New_Of_Type
represents the fact that entity e contains a new() expression, instantiating
an object of type T.
Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
Of_Type represents
that the entity represented by e has type T.
Note
Code Example
public class AClass
{
public struct AStruct
{
}
private AStruct internalState;
}
Example: Edge representing the type of a field.¶
Override¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Description
For nodes m₁, m₂ representing methods, an edge m₁→ m₂
of type
Override indicates that m₂ is a direct
override of method m₁.
Parameter_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge m→ T of type
Parameter_Of_Type with m representing a method indicates that
m has a formal parameter of type T.
Note
Code Example
public class AClass
{
public class ANestedClass
{ }
public int AMethod(ANestedClass z)
{
return 1;
}
}
Example: Formal parameters.¶
Return_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge m→ T of type
Return_Type
with m representing a method indicates that T is the return type of
m.
Note
Code Example
public class AClass
{
public class ANestedClass
{ }
public ANestedClass AMethod() // direction: AMethod -> ANestedClass
{
return null;
}
}
Example: Return types.¶
Sizeof_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
Sizeof_Of_Type represents the fact that entity e contains a
sizeof expression using type T as operand.
Static_Call¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
Represents a call to a static method (either in source code or compiler-generated), and
in particular calls to constructors in the course of executing new operators
(similarly for base and this constructor initializers). The source of
the edge is the caller and the target is the callee.
Template_Argument¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
Template_Argument represents that T is used as a generic argument
in the context of entity e.
Note
Code Example
public struct AStruct<T>
{}
public class AClass<T>
{
AClass<AStruct<AStruct<int>>> AField;
}
Example: Generic types and generic instances.¶
Throw¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
Description
An edge e→ E of type
Throw represents the
fact that in the entity represented by e an exception of type E might be
thrown (by a throw statement).
Typeof_Of_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Description
An edge e → T of type
Typeof_Of_Type represents the fact that entity e contains a
typeof expression using type T as operand.
Underlying_Type¶

Possible Source and Target Nodes
Source type |
Target type |
Views |
|---|---|---|
|
|
|
Description
An edge e→ t of type
Underlying_Type
represents the fact that entity e has underlying type t.