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