Skip to content

Raw Model

Description

This is the raw model that is exported by the extract command and is based on the interfaces described in the Model Section

Entities

Repository

interface Repository
{
  Version: string;
  Solutions: SolutionModel[];
  Projects: ProjectModel[]
}

Solution

interface Solution
{
    FilePath: string;
    ProjectsPaths: string[];
    Metadata: Dictionary<string, Dictionary<string, string>>
}

Project

interface ProjectModel
{
    Language: string;
    Name: string;
    FilePath: string;
    ProjectReferences: string[];
    Namespaces: NamespaceModel[];
    CompilationUnits: ICompilationUnitType[];
    Metadata: Dictionary<string, Dictionary<string, string>>
}
Language can be either: C# or Visual Basic

Namespace

interface NamespaceModel 
{
    Name: string;
    ClassNames: string[];
}

Compilation Unit

Up until now, the presented models were common to all programming languages. Starting from the compilation unit type, all the interface types are implemented in a dedicated project for each programming language. By doing so, the extractors can keep the same interface across the model, yet still be able to store the particular features of each programming language.

interface CompilationUnitType
{
    FilePath: string;
    ClassTypes: IClassType[];
    Imports: IImportType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}
interface CompilationUnitType
{
    FilePath: string;
    ClassTypes: IClassType[];
    Imports: IImportType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}

Class

interface ClassModel 
{
    ClassType: string;
    Mame: string;
    GenericParameters: IGenericParameterType[];
    FilePath: string;
    AccessModifier: string;
    Modifier: string;
    ContainingNamespaceName: string;
    ContainingClassName: string;
    BaseTypes: IBaseType[];
    Imports: IImportType[];
    Fields: FieldType[];
    Properties: PropertyType[];
    Constructors: IConstructorType[];
    Methods: IMethodType[];
    Destructor?: IDestructorType;
    Attributes: IAttributeType[];
    Metrics: MetricModel[];
    Loc: LinesOfCode;
}
interface ClassModel 
{
    ClassType: string;
    Name: string;
    GenericParameters: IGenericParameterType[];
    FilePath: string; 
    AccessModifier: string;
    Modifier: string;
    ContainingNamespaceName: string;
    ContainingModuleName: string;
    ContainingClassName: string;
    BaseTypes: IBaseType[];
    Imports: IImportType[]; 
    Fields: FieldType[];
    Properties: PropertyType[];
    Constructors: ConstructorType[];
    Methods: MethodType[]; 
    Destructor?: IDestructorType;
    Attributes: AttributeType[];
    Metrics: MetricModel[];
    Loc: LinesOfCode;
}

ClassType can be either: class, interface or struct

Enum

interface EnumModel
{
    ClassType: string;
    Mame: string;
    FilePath: string;
    Type: string;
    Labels: IEnumLabelType[];
    AccessModifier: string;
    Modifier: string;
    ContainingNamespaceName: string;
    ContainingClassName: string;
    BaseTypes: IBaseType[];
    Imports: IImportType[]; 
    Attributes: IAttributeType[];
    Metrics: MetricModel[];
    Loc: LinesOfCode;
}
interface EnumModel 
{
    ClassType: string;
    Mame: string;
    FilePath: string;
    Type: string;
    Labels: IEnumLabelType[];
    AccessModifier: string;
    Modifier: string;
    ContainingNamespaceName: string;
    ContainingModuleName: string;
    ContainingClassName: string;
    BaseTypes: IBaseType[];
    Imports: IImportType[]; 
    Attributes: IAttributeType[];
    Metrics: MetricModel[];
    Loc: LinesOfCode;
}

ClassType is enum

Enum Label

interface EnumLabel 
{
    Name: string; 
    Attributes: IAttributeType[]; 
}
interface EnumLabel
{
    Name: string; 
    Attributes: IAttributeType[]; 
}

Delegate

interface DelegateModel 
{
    ClassType: string;
    Mame: string;
    FilePath: string;
    GenericParameters: IGenericParameterType[];
    AccessModifier: string;
    Modifier: string;
    ContainingNamespaceName: string;
    ContainingClassName: string;
    BaseTypes: IBaseType[];
    ParameterTypes: IParameterType[];
    ReturnValue: IReturnValueType;
    Imports: IImportType[]; 
    Attributes: IAttributeType[];
    Metrics: MetricModel[];
    Loc: LinesOfCode;
}
interface DelegateModel 
{
    ClassType: string;
    Mame: string;
    FilePath: string;
    GenericParameters: IGenericParameterType[];
    AccessModifier: string;
    Modifier: string;
    ContainingNamespaceName: string;
    ContainingModuleName: string;
    ContainingClassName: string;
    BaseTypes: IBaseType[];
    ParameterTypes: IParameterType[];
    ReturnValue: IReturnValueType;
    Imports: IImportType[]; 
    Attributes: IAttributeType[];
    Metrics: MetricModel[];
    Loc: LinesOfCode;
}

ClassType is delegate

Import

interface Import 
{
    Name: string; 
    IsStatic: bool;
    Alias: string;
    AliasType: string;
}
interface Import 
{
    Name: string; 
    IsStatic: bool;
    Alias: string;
    AliasType: string;
}

AliasType can have one of the following values: - None - Namespace - Class - NotDetermined

Base Type

interface BaseType 
{
    Type: IEntityType; 
    Kind: string; 
}
interface BaseType 
{
    Type: IEntityType; 
    Kind: string; 
}

Kind can be either: class or interface

Entity Type

interface EntityType 
{
    Name: string; 
    FullType: GenericType;
    IsExtern: bool;
}
interface EntityType
{
    Name: string; 
    FullType: GenericType;
    IsExtern: bool; 
}

Generic Type

interface GenericType
{
    Name: string;
    ContainedTypes: GenericType[];
    IsNullable: bool;
}

Attribute

interface Attribute 
{
    Name: string; 
    Type: IEntityType;
    ParameterTypes: IParameterTypes[];
    Target: string;
}
interface Attribute 
{
    Name: string; 
    Type: IEntityType;
    ParameterTypes: IParameterTypes[];
    Target: string;
}

Target can be one of the following: - method - type - field - property - param - return

Field

interface Field 
{
    Name: string; 
    Type: IEntityType;
    Modifier: string;
    AccessModifier: string;
    IsEvent: bool;
    IsNullable: bool;
    Attributes: IAttributeType[];
    Metrics: MetricModel[]
}
interface Field 
{
    Name: string; 
    Type: IEntityType;
    Modifier: string;
    AccessModifier: string;
    IsNullable: bool;
    Attributes: IAttributeType[];
    Metrics: MetricModel[]
}

Property

interface Property 
{
    Name: string; 
    Type: IEntityType;
    Modifier: string;
    AccessModifier: string;
    IsEvent: bool;
    IsNullable: bool;
    CyclomaticComplexity: number;
    Accessors: IAccessorMethodType[];
    Loc: LinesOfCode;
    Attributes: IAttributeType[];
    Metrics: MetricModel[]
}
interface Property 
{
    Name: string; 
    Type: IEntityType;
    Modifier: string;
    AccessModifier: string;
    IsNullable: bool;
    CyclomaticComplexity: number;
    Accessors: IAccessorMethodType[];
    Loc: LinesOfCode;
    Attributes: IAttributeType[];
    Metrics: MetricModel[]
}

Accessor Method

interface AccessorMethod 
{
    Name: string;
    ReturnValue: IReturnValueType;
    ParameterTypes: IParameterType[];
    AccessModifier: string;
    Modifier: string;
    Attributes: IAttributeType[];
    CalledMethods: IMethodCallType[];
    AccessedFields: AccessField[];
    CyclomaticComplexity: number;
    LocalVariableTypes: ILocalVariableType[];
    LocalFunctions: IMethodType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}
interface AccessorMethod 
{
    Name: string;
    ReturnValue: IReturnValueType;
    ParameterTypes: IParameterType[];
    AccessModifier: string;
    Modifier: string;
    Attributes: IAttributeType[];
    CalledMethods: IMethodCallType[];
    AccessedFields: AccessField[];
    CyclomaticComplexity: number;
    LocalVariableTypes: ILocalVariableType[];
    LocalFunctions: IMethodType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}

Method

interface Method 
{
    Name: string;
    ReturnValue: IReturnValueType;
    ParameterTypes: IParameterType[];
    GenericParameters: IGenericParameterType[];
    AccessModifier: string;
    Modifier: string;
    Attributes: IAttributeType[];
    CalledMethods: IMethodCallType[];
    AccessedFields: AccessField[];
    CyclomaticComplexity: number;
    LocalVariableTypes: ILocalVariableType[];
    LocalFunctions: IMethodType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}
interface Method 
{
    Name: string;
    ReturnValue: IReturnValueType;
    ParameterTypes: IParameterType[];
    GenericParameters: IGenericParameterType[];
    AccessModifier: string;
    Modifier: string;
    Attributes: IAttributeType[];
    CalledMethods: IMethodCallType[];
    AccessedFields: AccessField[];
    CyclomaticComplexity: number;
    LocalVariableTypes: ILocalVariableType[];
    LocalFunctions: IMethodType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}

Constructor

interface Constructor 
{
    Name: string;
    ParameterTypes: IParameterType[];
    AccessModifier: string;
    Modifier: string;
    Attributes: IAttributeType[];
    CalledMethods: IMethodCallType[];
    AccessedFields: AccessField[];
    CyclomaticComplexity: number;
    LocalVariableTypes: ILocalVariableType[];
    LocalFunctions: IMethodType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}
interface Constructor 
{
    Name: string;
    ParameterTypes: IParameterType[];
    AccessModifier: string;
    Modifier: string;
    Attributes: IAttributeType[];
    CalledMethods: IMethodCallType[];
    AccessedFields: AccessField[];
    CyclomaticComplexity: number;
    LocalVariableTypes: ILocalVariableType[];
    LocalFunctions: IMethodType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}

Destructor

interface Destructor 
{
    Name: string;
    ParameterTypes: IParameterType[];
    AccessModifier: string;
    Modifier: string;
    Attributes: IAttributeType[];
    CalledMethods: IMethodCallType[];
    AccessedFields: AccessField[];
    CyclomaticComplexity: number;
    LocalVariableTypes: ILocalVariableType[];
    LocalFunctions: IMethodType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}
interface Destructor 
{
    Name: string;
    ParameterTypes: IParameterType[];
    AccessModifier: string;
    Modifier: string;
    Attributes: IAttributeType[];
    CalledMethods: IMethodCallType[];
    AccessedFields: AccessField[];
    CyclomaticComplexity: number;
    LocalVariableTypes: ILocalVariableType[];
    LocalFunctions: IMethodType[];
    Loc: LinesOfCode;
    Metrics: MetricModel[];
}

Parameter

interface Parameter 
{
    Type: EntityType; 
    Modifier: string;
    DefaultValue?: string;
    IsNullable: bool;
    Attributes: IAttributeType[];
}
interface Parameter 
{
    Type: EntityType; 
    Modifier: string;
    DefaultValue?: string;
    IsNullable: bool;
    Attributes: IAttributeType[]; 
}

Generic Parameter

interface GenericParameter 
{
    Name: string;
    Modifier: string;
    Constraints: EntityType[];
    Attributes: IAttributeType[];
}
interface GenericParameter 
{
    Name: string;
    Modifier: string;
    Constraints: EntityType[];
    Attributes: IAttributeType[];
}

Return Value

interface ReturnValue
{
    Type: IEntityType;
    Modifier: string;
    IsNullable: bool;
    Attributes: IAttributeType[];
}
interface ReturnValue 
{
    Type: IEntityType;
    Modifier: string;
    IsNullable: bool;
    Attributes: IAttributeType[];
}

Accessed Field

interface AccessedField
{
    Name: string;
    DefinitionClassName: string;
    LocationClassName: string;
    Kind: number;
}

Kind can be either 0 (Getter) or 1 (Setter)

DefinitionClassName is used for the base class and LocationClassName is used for the derived class

Called Method

interface MethodCall
{
    Name: string;
    DefinitionClassName: string;
    LocationClassName: string;
    MethodDefinitionNames: string[];
    GenericParameters: EntitTye[];
    ParameterTypes: IParameterType[];
}
interface MethodCall
{
    Name: string;
    DefinitionClassName: string;
    LocationClassName: string;
    MethodDefinitionNames: string[];
    GenericParameters: EntitTye[];
    ParameterTypes: IParameterType[];
}

Local Variable

interface LocalVariable
{
    Name: string;
    Type: IEntityType;
    Modifier: string;
    IsNullable: bool;
}
interface LocalVariable
{
    Name: string;
    Type: IEntityType;
    Modifier: string;
    IsNullable: bool;
}

Metric Model

interface MetricModel
{
    Name: string;
    ExtractorName: string;
    ValueType: string;
    Value?: object;
}

Lines of Code

interface LinesOfCode
{
    SourceLines: number;
    CommentedLines: number;
    EmptyLines: number;
}