File Coverage

blib/lib/SBOM/CycloneDX/Issue.pm
Criterion Covered Total %
statement 26 35 74.2
branch 0 10 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 56 64.2


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Issue;
2              
3 1     1   1165 use 5.010001;
  1         4  
4 1     1   5 use strict;
  1         2  
  1         17  
5 1     1   3 use warnings;
  1         1  
  1         36  
6 1     1   4 use utf8;
  1         1  
  1         5  
7              
8 1     1   34 use SBOM::CycloneDX::List;
  1         1  
  1         32  
9              
10 1     1   4 use Types::Standard qw(Str Enum InstanceOf);
  1         2  
  1         7  
11 1     1   1365 use Types::TypeTiny qw(ArrayLike);
  1         2  
  1         5  
12              
13 1     1   416 use Moo;
  1         2  
  1         6  
14 1     1   288 use namespace::autoclean;
  1         2  
  1         7  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has type => (is => 'rw', isa => Enum [qw(defect enhancement security)], required => 1);
19             has id => (is => 'rw', isa => Str);
20             has name => (is => 'rw', isa => Str);
21             has description => (is => 'rw', isa => Str);
22              
23             has source =>
24             (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Source'] | InstanceOf ['SBOM::CycloneDX::Issue::Source']);
25              
26             has references => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new });
27              
28             sub TO_JSON {
29              
30 0     0 1   my $self = shift;
31              
32 0           my $json = {type => $self->type};
33              
34 0 0         $json->{id} = $self->id if $self->id;
35 0 0         $json->{name} = $self->name if $self->name;
36 0 0         $json->{description} = $self->description if $self->description;
37 0 0         $json->{source} = $self->source if $self->source;
38 0 0         $json->{references} = $self->references if @{$self->references};
  0            
39              
40 0           return $json;
41              
42             }
43              
44             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 provides an individual issue that has been resolved.
67              
68             =head2 METHODS
69              
70             L inherits all methods from L
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, Specifies the type of issue (C, C or C)
82              
83             =item * C, The identifier of the issue assigned by the source of the issue
84              
85             =item * C, The name of the issue
86              
87             =item * C, A description of the issue
88              
89             =item * C, The source of the issue where it is documented. See L
90              
91             =item * C, 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.
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
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
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