File Coverage

blib/lib/SBOM/CycloneDX/Vulnerability/Credits.pm
Criterion Covered Total %
statement 23 30 76.6
branch 0 4 0.0
condition n/a
subroutine 8 9 88.8
pod 1 1 100.0
total 32 44 72.7


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