CycloneDX/Issue/Source.pm

filter: Statementstmt 82.7% 24 / 29 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 76.1% 32 / 42 CC 3 SCAR 14.6
CC
3
Cov
73%
TO_JSON
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.3
« CycloneDX/Component/Graphic.pm ↑ Summary CycloneDX/Vulnerability/Source.pm »
1 package SBOM::CycloneDX::Issue::Source;
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 Types::Standard qw(Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 extends 'SBOM::CycloneDX::Base';
14  
15 1 has name => (is => 'rw', isa => Str);
16 1 has url => (is => 'rw', isa => Str);
17  
18 sub TO_JSON {
19  
20 0 ▶ my $self = shift;
Subroutine TO_JSON: not called CC=3 SCAR=24.8
Pod documented
21  
22 0 my $json = {};
23  
24 0 ▶ $json->{name} = $self->name if $self->name;
Branch: 1 branch
BranchTrueFalseTotal
if $self->name 0 0 0
25 0 ▶ $json->{url} = $self->url if $self->url;
Branch: 1 branch
BranchTrueFalseTotal
if $self->url 0 0 0
26  
27 0 return $json;
28  
29 }
30  
31 1 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<SBOM::CycloneDX::Issue::Source> provides the source of the issue where it is documented.
53  
54 =head2 METHODS
55  
56 L<SBOM::CycloneDX::Issue::Source> inherits all methods from L<SBOM::CycloneDX::Base>
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<name>, The name of the source.
68  
69 =item * C<url>, 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<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
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<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
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 <gdt@cpan.org>
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
« CycloneDX/Component/Graphic.pm ↑ Summary CycloneDX/Vulnerability/Source.pm »