< Summary

Information
Class: Spdx3.Model.Core.Classes.PackageVerificationCode
Assembly: Spdx3
File(s): /home/runner/work/Spdx3/Spdx3/Spdx3/Model/Core/Classes/PackageVerificationCode.cs
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 48
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_Algorithm()100%11100%
get_HashValue()100%11100%
get_PackageVerificationCodeExcludedFile()100%11100%
.ctor()100%11100%
.ctor(...)100%11100%
Validate()100%11100%

File(s)

/home/runner/work/Spdx3/Spdx3/Spdx3/Model/Core/Classes/PackageVerificationCode.cs

#LineLine coverage
 1using System.Diagnostics.CodeAnalysis;
 2using System.Text.Json.Serialization;
 3using Spdx3.Model.Core.Enums;
 4using Spdx3.Serialization;
 5using Spdx3.Utility;
 6
 7namespace Spdx3.Model.Core.Classes;
 8
 9/// <summary>
 10///     A verification method for software packages.
 11///     See https://spdx.github.io/spdx-spec/v3.0.1/model/Core/Classes/PackageVerificationCode/
 12/// </summary>
 13public class PackageVerificationCode : IntegrityMethod
 14{
 15    [JsonPropertyName("algorithm")]
 16    [JsonConverter(typeof(SpdxModelConverterFactory))]
 2017    public HashAlgorithm Algorithm { get; set; }
 18
 19    [JsonPropertyName("hashValue")]
 20    [JsonConverter(typeof(SpdxModelConverterFactory))]
 2021    public string HashValue { get; set; }
 22
 23    [JsonPropertyName("packageVerificationCodeExcludedFile")]
 24    [JsonConverter(typeof(SpdxModelConverterFactory))]
 1525    public IList<string> PackageVerificationCodeExcludedFile { get; } = new List<string>();
 26
 27    // protected internal no-parm constructor required for deserialization
 28    // ReSharper disable once UnusedMember.Global
 29#pragma warning disable CS8618, CS9264
 230    protected internal PackageVerificationCode()
 31    {
 232    }
 33#pragma warning restore CS8618, CS9264
 34
 35    [SetsRequiredMembers]
 536    public PackageVerificationCode(Catalog catalog, HashAlgorithm algorithm, string hashValue) : base(catalog)
 37    {
 538        Algorithm = algorithm;
 539        HashValue = hashValue;
 540    }
 41
 42    public override void Validate()
 43    {
 544        base.Validate();
 445        ValidateRequiredProperty(nameof(Algorithm));
 446        ValidateRequiredProperty(nameof(HashValue));
 247    }
 48}