CycloneDX/License/Licensee.pm

filter: Statementstmt 100% 41 / 41 Branchbran 50.0% 3 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 13 / 13 Podpod 50.0% 1 / 2 totaltotal 88.0% 59 / 67 CC 5 SCAR 6.1
CC
5
Cov
90%
BUILD
3.7
TO_JSON
3.1
BEGIN
1.0
CRAP 1.8
« CycloneDX/Vulnerability/Affect.pm ↑ Summary CycloneDX/Definitions.pm »
1 package SBOM::CycloneDX::License::Licensee;
2  
3 16 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 16 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 16 ▶use SBOM::CycloneDX::OrganizationalEntity;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 16 ▶use SBOM::CycloneDX::OrganizationalContact;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 16 ▶use Types::Standard qw(InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 16 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 16 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 16 extends 'SBOM::CycloneDX::Base';
17  
18 66 ▶sub BUILD {
Subroutine BUILD: called CC=3 SCAR=13.1
Pod undocumented
19 66 my ($self, $args) = @_;
20 Carp::croak('"organization" and "individual" cannot be used at the same time')
21 66 ▶ if exists $args->{organization} && exists $args->{individual};
Branch: 1 branch
BranchTrueFalseTotal
if exists $args->{"organization"} and exists $args->{"individual"} 0 66 66
Condition33%1/3
exists $args->{"organization"} and exists $args->{"individual"}
!ll&&!rl&&r
6600
MC/DC0%0/2
exists $args->{"organization"} and exists $args->{"individual"}
exists $args->{"organization"} exists $args->{"individual"}
Truth table33%1/3
A and B
A= exists $args->{"organization"}B= exists $args->{"individual"}
ABresult
0X0
100
111
22 }
23  
24 has organization => (
25 is => 'rw',
26 isa => InstanceOf ['SBOM::CycloneDX::OrganizationalEntity'],
27 66 ▶ default => sub { SBOM::CycloneDX::OrganizationalEntity->new }
Subroutine __ANON__: called CC=1 SCAR=0.0
28 16 );
29  
30 has individual => (
31 is => 'rw',
32 isa => InstanceOf ['SBOM::CycloneDX::OrganizationalContact'],
33 66 ▶ default => sub { SBOM::CycloneDX::OrganizationalContact->new }
Subroutine __ANON__: called CC=1 SCAR=0.0
34 16 );
35  
36 159 ▶sub TO_JSON {
Subroutine TO_JSON: called CC=3 SCAR=11.2
Pod documented
37  
38 159 my $self = shift;
39  
40 159 my $json = {};
41  
42 159 ▶ $json->{organization} = $self->organization if %{$self->organization->TO_JSON};
Branch: 1 branch
BranchTrueFalseTotal
if %{$self->organization->TO_JSON;} 0 159 159
43 159 ▶ $json->{individual} = $self->individual if %{$self->individual->TO_JSON};
Branch: 1 branch
BranchTrueFalseTotal
if %{$self->individual->TO_JSON;} 0 159 159
44  
45 159 return $json;
46  
47 }
48  
49 16 1;
50  
51 =encoding utf-8
52  
53 =head1 NAME
54  
55 SBOM::CycloneDX::License::Licensee - Licensee
56  
57 =head1 SYNOPSIS
58  
59 SBOM::CycloneDX::License::Licensee->new();
60  
61  
62 =head1 DESCRIPTION
63  
64 L<SBOM::CycloneDX::License::Licensee> provides the individual or organization for
65 which a license was granted to
66  
67 =head2 METHODS
68  
69 L<SBOM::CycloneDX::License::Licensee> inherits all methods from L<SBOM::CycloneDX::Base>
70 and implements the following new ones.
71  
72 =over
73  
74 =item SBOM::CycloneDX::License::Licensee->new( %PARAMS )
75  
76 Properties:
77  
78 =over
79  
80 =item * C<individual>, The individual, not associated with an organization,
81 that was granted the license
82  
83 =item * C<organization>, The organization that was granted the license
84  
85 =back
86  
87 =item $licensee->individual
88  
89 =item $licensee->organization
90  
91 =back
92  
93  
94 =head1 SUPPORT
95  
96 =head2 Bugs / Feature Requests
97  
98 Please report any bugs or feature requests through the issue tracker
99 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
100 You will be notified automatically of any progress on your issue.
101  
102 =head2 Source Code
103  
104 This is open source software. The code repository is available for
105 public review and contribution under the terms of the license.
106  
107 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
108  
109 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
110  
111  
112 =head1 AUTHOR
113  
114 =over 4
115  
116 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
117  
118 =back
119  
120  
121 =head1 LICENSE AND COPYRIGHT
122  
123 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
124  
125 This is free software; you can redistribute it and/or modify it under
126 the same terms as the Perl 5 programming language system itself.
127  
128 =cut
« CycloneDX/Vulnerability/Affect.pm ↑ Summary CycloneDX/Definitions.pm »