< Summary

Information
Class: Spdx3.Utility.IncompleteObjectFactory
Assembly: Spdx3
File(s): /home/runner/work/Spdx3/Spdx3/Spdx3/Utility/IncompleteObjectFactory.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 17
Line coverage: 100%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Create()50%22100%

File(s)

/home/runner/work/Spdx3/Spdx3/Spdx3/Utility/IncompleteObjectFactory.cs

#LineLine coverage
 1using Spdx3.Model;
 2
 3namespace Spdx3.Utility;
 4
 5/// <summary>
 6/// The no-argument default constructors for the model classes are protected and internal.
 7/// In unusual circumstances, it may be necessary to create instances of the model classes without
 8/// all the protections for mandatory fields that the public constructors offer. This class and
 9/// the create method provide a way to circumvent all that (at your own peril!)
 10/// </summary>
 11public class IncompleteObjectFactory
 12{
 13    public static T Create<T>() where T : BaseModelClass
 14    {
 4515        return Activator.CreateInstance(typeof(T), true) as T ?? throw new InvalidOperationException();
 16    }
 17}

Methods/Properties

Create()