< Summary

Information
Class: NexusLabs.Needlr.Generators.Export.GraphServiceMetadata
Assembly: NexusLabs.Needlr.Generators
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Generators/Export/GraphModels.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 123
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_HasFactory()100%11100%
get_HasOptions()100%11100%
get_IsHostedService()100%11100%
get_IsDisposable()100%11100%
get_IsPlugin()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Generators/Export/GraphModels.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3
 4namespace NexusLabs.Needlr.Generators.Export;
 5
 6/// <summary>
 7/// Root model for the Needlr dependency graph export.
 8/// Serialized to needlr-graph.json for IDE tooling consumption.
 9/// </summary>
 10internal sealed class NeedlrGraph
 11{
 12    public string SchemaVersion { get; set; } = "1.0";
 13    public string GeneratedAt { get; set; } = DateTime.UtcNow.ToString("O");
 14    public string? ProjectPath { get; set; }
 15    public string? AssemblyName { get; set; }
 16    public List<GraphService> Services { get; set; } = new();
 17    public List<GraphDiagnostic> Diagnostics { get; set; } = new();
 18    public GraphStatistics Statistics { get; set; } = new();
 19}
 20
 21/// <summary>
 22/// Represents a discovered service in the dependency graph.
 23/// </summary>
 24internal sealed class GraphService
 25{
 26    public string Id { get; set; } = string.Empty;
 27    public string TypeName { get; set; } = string.Empty;
 28    public string FullTypeName { get; set; } = string.Empty;
 29    public string? AssemblyName { get; set; }
 30    public List<GraphInterface> Interfaces { get; set; } = new();
 31    public string Lifetime { get; set; } = string.Empty;
 32    public GraphLocation? Location { get; set; }
 33    public List<GraphDependency> Dependencies { get; set; } = new();
 34    public List<GraphDecorator> Decorators { get; set; } = new();
 35    public List<string> Interceptors { get; set; } = new();
 36    public List<string> Attributes { get; set; } = new();
 37    public List<string> ServiceKeys { get; set; } = new();
 38    public GraphServiceMetadata Metadata { get; set; } = new();
 39}
 40
 41/// <summary>
 42/// Represents an interface implemented by a service.
 43/// </summary>
 44internal sealed class GraphInterface
 45{
 46    public string Name { get; set; } = string.Empty;
 47    public string FullName { get; set; } = string.Empty;
 48    public GraphLocation? Location { get; set; }
 49}
 50
 51/// <summary>
 52/// Represents a source file location.
 53/// </summary>
 54internal sealed class GraphLocation
 55{
 56    public string? FilePath { get; set; }
 57    public int Line { get; set; }
 58    public int Column { get; set; }
 59}
 60
 61/// <summary>
 62/// Represents a dependency of a service.
 63/// </summary>
 64internal sealed class GraphDependency
 65{
 66    public string ParameterName { get; set; } = string.Empty;
 67    public string TypeName { get; set; } = string.Empty;
 68    public string FullTypeName { get; set; } = string.Empty;
 69    public string? ResolvedTo { get; set; }
 70    public string? ResolvedLifetime { get; set; }
 71    public bool IsKeyed { get; set; }
 72    public string? ServiceKey { get; set; }
 73}
 74
 75/// <summary>
 76/// Represents a decorator applied to a service.
 77/// </summary>
 78internal sealed class GraphDecorator
 79{
 80    public string TypeName { get; set; } = string.Empty;
 81    public int Order { get; set; }
 82}
 83
 84/// <summary>
 85/// Additional metadata about a service.
 86/// </summary>
 87internal sealed class GraphServiceMetadata
 88{
 485289    public bool HasFactory { get; set; }
 242690    public bool HasOptions { get; set; }
 485291    public bool IsHostedService { get; set; }
 485292    public bool IsDisposable { get; set; }
 485293    public bool IsPlugin { get; set; }
 94}
 95
 96/// <summary>
 97/// Represents a diagnostic (warning/error) from generation.
 98/// </summary>
 99internal sealed class GraphDiagnostic
 100{
 101    public string Id { get; set; } = string.Empty;
 102    public string Severity { get; set; } = string.Empty;
 103    public string Message { get; set; } = string.Empty;
 104    public GraphLocation? Location { get; set; }
 105    public List<string> RelatedServices { get; set; } = new();
 106}
 107
 108/// <summary>
 109/// Statistics about the generated graph.
 110/// </summary>
 111internal sealed class GraphStatistics
 112{
 113    public int TotalServices { get; set; }
 114    public int Singletons { get; set; }
 115    public int Scoped { get; set; }
 116    public int Transient { get; set; }
 117    public int Decorators { get; set; }
 118    public int Interceptors { get; set; }
 119    public int Factories { get; set; }
 120    public int Options { get; set; }
 121    public int HostedServices { get; set; }
 122    public int Plugins { get; set; }
 123}