File Coverage

blib/lib/SBOM/CycloneDX/Issue/Source.pm
Criterion Covered Total %
statement 20 25 80.0
branch 0 4 0.0
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 28 38 73.6


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