CycloneDX/Issue.pm

filter: Statementstmt 77.2% 34 / 44 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.8% 9 / 11 Podpod 100% 1 / 1 totaltotal 66.6% 44 / 66 CC 6 SCAR 28.0
CC
6
Cov
63%
TO_JSON
42.0
__ANON__
1.1
BEGIN
1.0
CRAP 16.4
« CycloneDX/Declarations/Data.pm ↑ Summary CycloneDX/Composition.pm »
1 package SBOM::CycloneDX::Issue;
2  
3 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use SBOM::CycloneDX::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Types::Standard qw(Str Enum InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Types::TypeTiny qw(ArrayLike);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 extends 'SBOM::CycloneDX::Base';
17  
18 1 has type => (is => 'rw', isa => Enum [qw(defect enhancement security)], required => 1);
19 1 has id => (is => 'rw', isa => Str);
20 1 has name => (is => 'rw', isa => Str);
21 1 has description => (is => 'rw', isa => Str);
22  
23 1 has source =>
24 (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Source'] | InstanceOf ['SBOM::CycloneDX::Issue::Source']);
25  
26 0 ▶has references => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new });
Subroutine __ANON__: not called CC=1 SCAR=1.2
27  
28 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=6 SCAR=37.4
Pod documented
29  
30 0 my $self = shift;
31  
32 0 my $json = {type => $self->type};
33  
34 0 ▶ $json->{id} = $self->id if $self->id;
Branch: 1 branch
BranchTrueFalseTotal
if $self->id 0 0 0
35 0 ▶ $json->{name} = $self->name if $self->name;
Branch: 1 branch
BranchTrueFalseTotal
if $self->name 0 0 0
36 0 ▶ $json->{description} = $self->description if $self->description;
Branch: 1 branch
BranchTrueFalseTotal
if $self->description 0 0 0
37 0 ▶ $json->{source} = $self->source if $self->source;
Branch: 1 branch
BranchTrueFalseTotal
if $self->source 0 0 0
38 0 ▶ $json->{references} = $self->references if @{$self->references};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->references;} 0 0 0
39  
40 0 return $json;
41  
42 }
43  
44 1 1;
45  
46 =encoding utf-8
47  
48 =head1 NAME
49  
50 SBOM::CycloneDX::Issue - An individual issue that has been resolved
51  
52 =head1 SYNOPSIS
53  
54 $release_notes->resolves->add(
55 SBOM::CycloneDX::Issue->new(
56 type => 'security',
57 source => SBOM::CycloneDX::Source->new(
58 name => 'NVD',
59 url => 'https://nvd.nist.gov/vuln/detail/CVE-2021-44228'
60 )
61 )
62 );
63  
64 =head1 DESCRIPTION
65  
66 L<SBOM::CycloneDX::Issue> provides an individual issue that has been resolved.
67  
68 =head2 METHODS
69  
70 L<SBOM::CycloneDX::Issue> inherits all methods from L<SBOM::CycloneDX::Base>
71 and implements the following new ones.
72  
73 =over
74  
75 =item SBOM::CycloneDX::Issue->new( %PARAMS )
76  
77 Properties:
78  
79 =over
80  
81 =item * C<type>, Specifies the type of issue (C<defect>, C<enhancement> or C<security>)
82  
83 =item * C<id>, The identifier of the issue assigned by the source of the issue
84  
85 =item * C<name>, The name of the issue
86  
87 =item * C<description>, A description of the issue
88  
89 =item * C<source>, The source of the issue where it is documented. See L<SBOM::CycloneDX::Source>
90  
91 =item * C<references>, A collection of URL's for reference. Multiple URLs are allowed.
92  
93 =back
94  
95 =item $issue->type
96  
97 =item $issue->id
98  
99 =item $issue->name
100  
101 =item $issue->description
102  
103 =item $issue->source
104  
105 =item $issue->references
106  
107 =back
108  
109 =head1 SUPPORT
110  
111 =head2 Bugs / Feature Requests
112  
113 Please report any bugs or feature requests through the issue tracker
114 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
115 You will be notified automatically of any progress on your issue.
116  
117 =head2 Source Code
118  
119 This is open source software. The code repository is available for
120 public review and contribution under the terms of the license.
121  
122 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
123  
124 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
125  
126  
127 =head1 AUTHOR
128  
129 =over 4
130  
131 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
132  
133 =back
134  
135  
136 =head1 LICENSE AND COPYRIGHT
137  
138 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
139  
140 This is free software; you can redistribute it and/or modify it under
141 the same terms as the Perl 5 programming language system itself.
142  
143 =cut
« CycloneDX/Declarations/Data.pm ↑ Summary CycloneDX/Composition.pm »