< Summary

Information
Class: RaidLoop.Client.ItemPresentationCatalog
Assembly: RaidLoop.Client
File(s): /home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Client/ItemPresentationCatalog.cs
Line coverage
75%
Covered lines: 6
Uncovered lines: 2
Coverable lines: 8
Total lines: 28
Line coverage: 75%
Branch coverage
75%
Covered branches: 6
Total branches: 8
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
GetLabel(...)75%9875%

File(s)

/home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Client/ItemPresentationCatalog.cs

#LineLine coverage
 1using System.Globalization;
 2using RaidLoop.Core;
 3
 4namespace RaidLoop.Client;
 5
 6public static class ItemPresentationCatalog
 7{
 8    public static string GetLabel(Item? item)
 9    {
 310        if (item is null)
 11        {
 012            return string.Empty;
 13        }
 14
 315        if (item.ItemDefId > 0)
 16        {
 317            var label = ItemResources.ResourceManager.GetString($"Items.{item.ItemDefId}", ItemResources.Culture ?? Cult
 318            if (!string.IsNullOrWhiteSpace(label))
 19            {
 220                return label;
 21            }
 22
 123            return item.ItemDefId.ToString(CultureInfo.InvariantCulture);
 24        }
 25
 026        return item.Name;
 27    }
 28}

Methods/Properties

GetLabel(RaidLoop.Core.Item)