File Coverage

blib/lib/SBOM/CycloneDX/Vulnerability/Reference.pm
Criterion Covered Total %
statement 20 23 86.9
branch n/a
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 28 32 87.5


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Vulnerability::Reference;
2              
3 1     1   3502 use 5.010001;
  1         5  
4 1     1   6 use strict;
  1         2  
  1         24  
5 1     1   4 use warnings;
  1         2  
  1         53  
6 1     1   6 use utf8;
  1         2  
  1         8  
7              
8 1     1   50 use Types::Standard qw(Str InstanceOf);
  1         3  
  1         8  
9              
10 1     1   2297 use Moo;
  1         2  
  1         8  
11 1     1   578 use namespace::autoclean;
  1         3  
  1         12  
12              
13             extends 'SBOM::CycloneDX::Base';
14              
15             has id => (is => 'rw', isa => Str, required => 1);
16             has source => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Vulnerability::Source'], required => 1);
17              
18             sub TO_JSON {
19              
20 0     0 1   my $self = shift;
21              
22 0           my $json = {id => $self->id, source => $self->source};
23              
24 0           return $json;
25              
26             }
27              
28             1;
29              
30             =encoding utf-8
31              
32             =head1 NAME
33              
34             SBOM::CycloneDX::Vulnerability::Reference - Vulnerability reference
35              
36             =head1 SYNOPSIS
37              
38             SBOM::CycloneDX::Vulnerability::Reference->new();
39              
40              
41             =head1 DESCRIPTION
42              
43             L provide the vulnerability reference object.
44              
45             =head2 METHODS
46              
47             L inherits all methods from L
48             and implements the following new ones.
49              
50             =over
51              
52             =item SBOM::CycloneDX::Vulnerability::Reference->new( %PARAMS )
53              
54             Properties:
55              
56             =over
57              
58             =item * C, An identifier that uniquely identifies the vulnerability.
59              
60             =item * C, The source that published the vulnerability.
61              
62             =back
63              
64             =item $reference->id
65              
66             =item $reference->source
67              
68             =back
69              
70              
71             =head1 SUPPORT
72              
73             =head2 Bugs / Feature Requests
74              
75             Please report any bugs or feature requests through the issue tracker
76             at L.
77             You will be notified automatically of any progress on your issue.
78              
79             =head2 Source Code
80              
81             This is open source software. The code repository is available for
82             public review and contribution under the terms of the license.
83              
84             L
85              
86             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
87              
88              
89             =head1 AUTHOR
90              
91             =over 4
92              
93             =item * Giuseppe Di Terlizzi
94              
95             =back
96              
97              
98             =head1 LICENSE AND COPYRIGHT
99              
100             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
101              
102             This is free software; you can redistribute it and/or modify it under
103             the same terms as the Perl 5 programming language system itself.
104              
105             =cut