File Coverage

blib/lib/SBOM/CycloneDX/Declarations/Conformance.pm
Criterion Covered Total %
statement 26 33 78.7
branch 0 6 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 50 72.0


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Declarations::Conformance;
2              
3 1     1   2098 use 5.010001;
  1         5  
4 1     1   8 use strict;
  1         3  
  1         28  
5 1     1   4 use warnings;
  1         2  
  1         94  
6 1     1   9 use utf8;
  1         2  
  1         10  
7              
8 1     1   55 use SBOM::CycloneDX::List;
  1         2  
  1         52  
9              
10 1     1   6 use Types::Standard qw(Str Num);
  1         3  
  1         24  
11 1     1   2524 use Types::TypeTiny qw(ArrayLike);
  1         3  
  1         9  
12              
13 1     1   728 use Moo;
  1         4  
  1         13  
14 1     1   564 use namespace::autoclean;
  1         3  
  1         16  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has score => (is => 'rw', isa => Num);
19             has rationale => (is => 'rw', isa => Str);
20             has mitigation_strategies => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new });
21              
22              
23             sub TO_JSON {
24              
25 0     0 1   my $self = shift;
26              
27 0           my $json = {};
28              
29 0 0         $json->{score} = $self->score if $self->score;
30 0 0         $json->{rationale} = $self->rationale if $self->rationale;
31 0 0         $json->{mitigationStrategies} = $self->mitigation_strategies if @{$self->mitigation_strategies};
  0            
32              
33 0           return $json;
34              
35             }
36              
37             1;
38              
39             =encoding utf-8
40              
41             =head1 NAME
42              
43             SBOM::CycloneDX::Declarations::Conformance - Conformance
44              
45             =head1 SYNOPSIS
46              
47             SBOM::CycloneDX::Declarations::Conformance->new();
48              
49              
50             =head1 DESCRIPTION
51              
52             L provide the conformance of the claim
53             meeting a requirement.
54              
55             =head2 METHODS
56              
57             L inherits all methods from L
58             and implements the following new ones.
59              
60             =over
61              
62             =item SBOM::CycloneDX::Declarations::Conformance->new( %PARAMS )
63              
64             Properties:
65              
66             =over
67              
68             =item * C, The list of `bom-ref` to the evidence
69             provided describing the mitigation strategies.
70              
71             =item * C, The rationale for the conformance score.
72              
73             =item * C, The conformance of the claim between and inclusive of 0 and
74             1, where 1 is 100% conformance.
75              
76             =back
77              
78             =item $conformance->mitigation_strategies
79              
80             =item $conformance->rationale
81              
82             =item $conformance->score
83              
84             =back
85              
86              
87             =head1 SUPPORT
88              
89             =head2 Bugs / Feature Requests
90              
91             Please report any bugs or feature requests through the issue tracker
92             at L.
93             You will be notified automatically of any progress on your issue.
94              
95             =head2 Source Code
96              
97             This is open source software. The code repository is available for
98             public review and contribution under the terms of the license.
99              
100             L
101              
102             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
103              
104              
105             =head1 AUTHOR
106              
107             =over 4
108              
109             =item * Giuseppe Di Terlizzi
110              
111             =back
112              
113              
114             =head1 LICENSE AND COPYRIGHT
115              
116             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
117              
118             This is free software; you can redistribute it and/or modify it under
119             the same terms as the Perl 5 programming language system itself.
120              
121             =cut