< Summary

Information
Class: Spdx3.Model.AI.Classes.AiPackage
Assembly: Spdx3
File(s): /home/runner/work/Spdx3/Spdx3/Spdx3/Model/AI/Classes/AiPackage.cs
Line coverage
100%
Covered lines: 36
Uncovered lines: 0
Coverable lines: 36
Total lines: 122
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_ReleaseTime()100%11100%
get_SuppliedBy()100%11100%
get_DownloadLocation()100%11100%
get_PackageVersion()100%11100%
get_PrimaryPurpose()100%11100%
get_AutonomyType()100%11100%
get_Domain()100%11100%
get_EnergyConsumption()100%11100%
get_HyperParameter()100%11100%
get_InformationAboutApplication()100%11100%
get_InformationAboutTraining()100%11100%
get_Limitation()100%11100%
get_Metric()100%11100%
get_MetricDecisionThreshold()100%11100%
get_ModelDataPreprocessing()100%11100%
get_ModelExplainability()100%11100%
get_SafetyRiskAssessment()100%11100%
get_StandardCompliance()100%11100%
get_TypeOfModel()100%11100%
get_UseSensitivePersonalInformation()100%11100%
.ctor()100%11100%
.ctor(...)100%11100%
Validate()100%11100%

File(s)

/home/runner/work/Spdx3/Spdx3/Spdx3/Model/AI/Classes/AiPackage.cs

#LineLine coverage
 1using System.Diagnostics.CodeAnalysis;
 2using System.Text.Json.Serialization;
 3using Spdx3.Model.AI.Enums;
 4using Spdx3.Model.Core.Classes;
 5using Spdx3.Model.Core.Enums;
 6using Spdx3.Model.Software.Classes;
 7using Spdx3.Model.Software.Enums;
 8using Spdx3.Serialization;
 9using Spdx3.Utility;
 10
 11namespace Spdx3.Model.AI.Classes;
 12
 13public class AiPackage : Package
 14{
 15    [JsonPropertyName("releaseTime")]
 16    [JsonConverter(typeof(SpdxModelConverterFactory))]
 717    public new required DateTimeOffset ReleaseTime { get; set; }
 18
 19    [JsonPropertyName("suppliedBy")]
 20    [JsonConverter(typeof(SpdxModelConverterFactory))]
 921    public new required Agent SuppliedBy { get; set; }
 22
 23    [JsonPropertyName("software_downloadLocation")]
 24    [JsonConverter(typeof(SpdxModelConverterFactory))]
 725    public new required Uri DownloadLocation { get; set; }
 26
 27    [JsonPropertyName("software_packageVersion")]
 28    [JsonConverter(typeof(SpdxModelConverterFactory))]
 729    public new required string PackageVersion { get; set; }
 30
 31    [JsonPropertyName("software_primaryPurpose")]
 32    [JsonConverter(typeof(SpdxModelConverterFactory))]
 733    public new required SoftwarePurpose PrimaryPurpose { get; set; }
 34
 35    [JsonPropertyName("ai_autonomyType")]
 36    [JsonConverter(typeof(SpdxModelConverterFactory))]
 237    public PresenceType? AutonomyType { get; set; }
 38
 39    [JsonPropertyName("ai_domain")]
 40    [JsonConverter(typeof(SpdxModelConverterFactory))]
 741    public IList<string> Domain { get; set; } = new List<string>();
 42
 43    [JsonPropertyName("ai_energyConsumption")]
 44    [JsonConverter(typeof(SpdxModelConverterFactory))]
 245    public EnergyConsumption? EnergyConsumption { get; set; }
 46
 47    [JsonPropertyName("ai_hyperparameter")]
 48    [JsonConverter(typeof(SpdxModelConverterFactory))]
 749    public IList<DictionaryEntry> HyperParameter { get; set; } = new List<DictionaryEntry>();
 50
 51    [JsonPropertyName("ai_informationAboutApplication")]
 52    [JsonConverter(typeof(SpdxModelConverterFactory))]
 253    public string? InformationAboutApplication { get; set; }
 54
 55    [JsonPropertyName("ai_informationAboutTraining")]
 56    [JsonConverter(typeof(SpdxModelConverterFactory))]
 257    public string? InformationAboutTraining { get; set; }
 58
 59    [JsonPropertyName("ai_limitation")]
 60    [JsonConverter(typeof(SpdxModelConverterFactory))]
 261    public string? Limitation { get; set; }
 62
 63    [JsonPropertyName("ai_metric")]
 64    [JsonConverter(typeof(SpdxModelConverterFactory))]
 765    public IList<DictionaryEntry> Metric { get; set; } = new List<DictionaryEntry>();
 66
 67    [JsonPropertyName("ai_metricDecisionThreshold")]
 68    [JsonConverter(typeof(SpdxModelConverterFactory))]
 769    public IList<DictionaryEntry> MetricDecisionThreshold { get; set; } = new List<DictionaryEntry>();
 70
 71    [JsonPropertyName("ai_modelDataPreprocessing")]
 72    [JsonConverter(typeof(SpdxModelConverterFactory))]
 773    public IList<string> ModelDataPreprocessing { get; set; } = new List<string>();
 74
 75    [JsonPropertyName("ai_modelExplainability")]
 76    [JsonConverter(typeof(SpdxModelConverterFactory))]
 777    public IList<string> ModelExplainability { get; set; } = new List<string>();
 78
 79    [JsonPropertyName("ai_safetyRiskAssessment")]
 80    [JsonConverter(typeof(SpdxModelConverterFactory))]
 281    public SafetyRiskAssessmentType? SafetyRiskAssessment { get; set; }
 82
 83    [JsonPropertyName("ai_standardCompliance")]
 84    [JsonConverter(typeof(SpdxModelConverterFactory))]
 785    public IList<string> StandardCompliance { get; set; } = new List<string>();
 86
 87    [JsonPropertyName("ai_typeOfModel")]
 88    [JsonConverter(typeof(SpdxModelConverterFactory))]
 789    public IList<string> TypeOfModel { get; set; } = new List<string>();
 90
 91    [JsonPropertyName("ai_useSensitivePersonalInformation")]
 92    [JsonConverter(typeof(SpdxModelConverterFactory))]
 293    public PresenceType? UseSensitivePersonalInformation { get; set; }
 94
 95    // protected internal no-parm constructor required for deserialization
 96#pragma warning disable CS8618, CS9264
 297    protected internal AiPackage()
 98    {
 299    }
 100#pragma warning restore CS8618, CS9264
 101
 102    [SetsRequiredMembers]
 103    public AiPackage(Catalog catalog, CreationInfo creationInfo, DateTimeOffset releaseTime, Agent suppliedBy,
 1104        Uri downloadLocation, string packageVersion, SoftwarePurpose primaryPurpose) : base(catalog, creationInfo)
 105    {
 1106        ReleaseTime = releaseTime;
 1107        SuppliedBy = suppliedBy;
 1108        DownloadLocation = downloadLocation;
 1109        PackageVersion = packageVersion;
 1110        PrimaryPurpose = primaryPurpose;
 1111    }
 112
 113    public override void Validate()
 114    {
 2115        base.Validate();
 1116        ValidateRequiredProperty(nameof(ReleaseTime));
 1117        ValidateRequiredProperty(nameof(SuppliedBy));
 1118        ValidateRequiredProperty(nameof(DownloadLocation));
 1119        ValidateRequiredProperty(nameof(PackageVersion));
 1120        ValidateRequiredProperty(nameof(PrimaryPurpose));
 1121    }
 122}