CycloneDX/Note.pm

filter: Statementstmt 85.7% 24 / 28 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 82.0% 32 / 39 CC 2 SCAR 7.5
CC
2
Cov
80%
TO_JSON
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« CycloneDX/Advisory.pm ↑ Summary CycloneDX/Property.pm »
1 package SBOM::CycloneDX::Note;
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(StrMatch InstanceOf);
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 locale => (is => 'rw', isa => StrMatch [qr{^([a-z]{2})(-[A-Z]{2})?$}]);
16 1 has text => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Attachment'], required => 1);
17  
18 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=2 SCAR=17.9
Pod documented
19  
20 0 my $self = shift;
21  
22 0 my $json = {text => $self->text};
23  
24 0 ▶ $json->{locale} = $self->locale if $self->locale;
Branch: 1 branch
BranchTrueFalseTotal
if $self->locale 0 0 0
25  
26 0 return $json;
27  
28 }
29  
30 1 1;
31  
32 =encoding utf-8
33  
34 =head1 NAME
35  
36 SBOM::CycloneDX::Note - A note containing the locale and content
37  
38 =head1 SYNOPSIS
39  
40 $note = SBOM::CycloneDX::Note->new(
41 locale => 'en_US',
42 text => SBOM::CycloneDX::Attachment->new(
43 file => '/path/note.txt'
44 )
45 );
46  
47  
48 =head1 DESCRIPTION
49  
50 L<SBOM::CycloneDX::Note> provides a note containing the locale and content.
51  
52 =head2 METHODS
53  
54 L<SBOM::CycloneDX::Note> inherits all methods from L<SBOM::CycloneDX::Base>
55 and implements the following new ones.
56  
57 =over
58  
59 =item SBOM::CycloneDX::Note->new( %PARAMS )
60  
61 Properties:
62  
63 =over
64  
65 =item * C<locale>, The ISO-639 (or higher) language code and optional ISO-3166
66 (or higher) country code.
67  
68 =item * C<text>, Specifies the full content of the release note.
69 See L<SBOM::CycloneDX::Attachment>.
70  
71 =back
72  
73 =item $note->locale
74  
75 =item $note->text
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/Advisory.pm ↑ Summary CycloneDX/Property.pm »