CycloneDX/OrganizationalContact.pm

filter: Statementstmt 97.3% 36 / 37 Branchbran 70.0% 7 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 100% 1 / 1 totaltotal 91.3% 53 / 58 CC 6 SCAR 11.0
CC
6
Cov
91%
__ANON__
6.0
TO_JSON
5.0
BEGIN
1.0
CRAP 3.0
« CycloneDX/Metadata/Lifecycle.pm ↑ Summary CycloneDX/OrganizationalEntity.pm »
1 package SBOM::CycloneDX::OrganizationalContact;
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::BomRef;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 16 ▶use Types::Standard qw(Str InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 16 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 16 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 16 extends 'SBOM::CycloneDX::Base';
15  
16 has bom_ref => (
17 is => 'rw',
18 isa => InstanceOf ['SBOM::CycloneDX::BomRef'],
19 0 ▶ coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::BomRef->new($_[0]) }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 0 0
20 16 );
21  
22 16 has name => (is => 'rw', isa => Str);
23 16 has email => (is => 'rw', isa => Str);
24 16 has phone => (is => 'rw', isa => Str);
25  
26 177 ▶sub TO_JSON {
Subroutine TO_JSON: called CC=5 SCAR=16.1
Pod documented
27  
28 177 my $self = shift;
29  
30 177 my $json = {};
31  
32 177 ▶ $json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
Branch: 1 branch
BranchTrueFalseTotal
if $self->bom_ref 0 177 177
33 177 ▶ $json->{name} = $self->name if $self->name;
Branch: 1 branch
BranchTrueFalseTotal
if $self->name 18 159 177
34 177 ▶ $json->{email} = $self->email if $self->email;
Branch: 1 branch
BranchTrueFalseTotal
if $self->email 18 159 177
35 177 ▶ $json->{phone} = $self->phone if $self->phone;
Branch: 1 branch
BranchTrueFalseTotal
if $self->phone 18 159 177
36  
37 177 return $json;
38  
39 }
40  
41 16 1;
42  
43 =encoding utf-8
44  
45 =head1 NAME
46  
47 SBOM::CycloneDX::OrganizationalContact - Organizational Contact
48  
49 =head1 SYNOPSIS
50  
51 SBOM::CycloneDX::OrganizationalContact->new();
52  
53  
54 =head1 DESCRIPTION
55  
56 L<SBOM::CycloneDX::OrganizationalContact> provides the organizational contact object.
57  
58 =head2 METHODS
59  
60 L<SBOM::CycloneDX::OrganizationalContact> inherits all methods from L<SBOM::CycloneDX::Base>
61 and implements the following new ones.
62  
63 =over
64  
65 =item SBOM::CycloneDX::OrganizationalContact->new( %PARAMS )
66  
67 Properties:
68  
69 =over
70  
71 =item * C<bom_ref>, An identifier which can be used to reference the object
72 elsewhere in the BOM. Every bom-ref must be unique within the BOM.
73 Value SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid
74 conflicts with BOM-Links.
75  
76 =item * C<email>, The email address of the contact.
77  
78 =item * C<name>, The name of a contact
79  
80 =item * C<phone>, The phone number of the contact.
81  
82 =back
83  
84 =item $organizational_contact->bom_ref
85  
86 =item $organizational_contact->email
87  
88 =item $organizational_contact->name
89  
90 =item $organizational_contact->phone
91  
92 =back
93  
94  
95 =head1 SUPPORT
96  
97 =head2 Bugs / Feature Requests
98  
99 Please report any bugs or feature requests through the issue tracker
100 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
101 You will be notified automatically of any progress on your issue.
102  
103 =head2 Source Code
104  
105 This is open source software. The code repository is available for
106 public review and contribution under the terms of the license.
107  
108 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
109  
110 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
111  
112  
113 =head1 AUTHOR
114  
115 =over 4
116  
117 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
118  
119 =back
120  
121  
122 =head1 LICENSE AND COPYRIGHT
123  
124 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
125  
126 This is free software; you can redistribute it and/or modify it under
127 the same terms as the Perl 5 programming language system itself.
128  
129 =cut
« CycloneDX/Metadata/Lifecycle.pm ↑ Summary CycloneDX/OrganizationalEntity.pm »