< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.Generators.GraphReducerEntry
Assembly: NexusLabs.Needlr.AgentFramework.Generators
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Generators/Models/GraphReducerEntry.cs
Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 54
Line coverage: 100%
Branch coverage
56%
Covered branches: 9
Total branches: 16
Branch coverage: 56.2%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_AgentTypeName()100%11100%
get_AgentClassName()100%11100%
get_GraphName()100%11100%
get_ReducerMethod()100%11100%
Equals(...)50%66100%
Equals(...)100%22100%
GetHashCode()50%88100%
op_Equality(...)100%11100%
op_Inequality(...)100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Generators/Models/GraphReducerEntry.cs

#LineLine coverage
 1// Copyright (c) NexusLabs. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5
 6namespace NexusLabs.Needlr.AgentFramework.Generators;
 7
 8internal readonly struct GraphReducerEntry : IEquatable<GraphReducerEntry>
 9{
 10    public GraphReducerEntry(
 11        string agentTypeName,
 12        string agentClassName,
 13        string graphName,
 14        string reducerMethod)
 15    {
 1016        AgentTypeName = agentTypeName;
 1017        AgentClassName = agentClassName;
 1018        GraphName = graphName;
 1019        ReducerMethod = reducerMethod;
 1020    }
 21
 3822    public string AgentTypeName { get; }
 1523    public string AgentClassName { get; }
 2024    public string GraphName { get; }
 1725    public string ReducerMethod { get; }
 26
 27    public bool Equals(GraphReducerEntry other) =>
 628        string.Equals(AgentTypeName, other.AgentTypeName, StringComparison.Ordinal) &&
 629        string.Equals(AgentClassName, other.AgentClassName, StringComparison.Ordinal) &&
 630        string.Equals(GraphName, other.GraphName, StringComparison.Ordinal) &&
 631        string.Equals(ReducerMethod, other.ReducerMethod, StringComparison.Ordinal);
 32
 33    public override bool Equals(object? obj) =>
 234        obj is GraphReducerEntry other && Equals(other);
 35
 36    public override int GetHashCode()
 37    {
 38        unchecked
 39        {
 240            var hash = 17;
 241            hash = hash * 31 + (AgentTypeName?.GetHashCode() ?? 0);
 242            hash = hash * 31 + (AgentClassName?.GetHashCode() ?? 0);
 243            hash = hash * 31 + (GraphName?.GetHashCode() ?? 0);
 244            hash = hash * 31 + (ReducerMethod?.GetHashCode() ?? 0);
 245            return hash;
 46        }
 47    }
 48
 49    public static bool operator ==(GraphReducerEntry left, GraphReducerEntry right) =>
 150        left.Equals(right);
 51
 52    public static bool operator !=(GraphReducerEntry left, GraphReducerEntry right) =>
 253        !left.Equals(right);
 54}