CycloneDX/Declarations/Data.pm

filter: Statementstmt 76.7% 33 / 43 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.8% 9 / 11 Podpod 100% 1 / 1 totaltotal 66.1% 43 / 65 CC 6 SCAR 28.0
CC
6
Cov
62%
TO_JSON
42.0
__ANON__
1.1
BEGIN
1.0
CRAP 16.4
« CycloneDX/CryptoProperties.pm ↑ Summary CycloneDX/Issue.pm »
1 package SBOM::CycloneDX::Declarations::Data;
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 SBOM::CycloneDX::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Types::Standard qw(Str InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Types::TypeTiny qw(ArrayLike);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 extends 'SBOM::CycloneDX::Base';
17  
18 1 has name => (is => 'rw', isa => Str);
19 1 has contents => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Declarations::Contents']);
20 1 has classification => (is => 'rw', isa => Str);
21 0 ▶has sensitive_data => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new });
Subroutine __ANON__: not called CC=1 SCAR=1.2
22 1 has governance => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::DataGovernance']);
23  
24  
25 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=6 SCAR=37.4
Pod documented
26  
27 0 my $self = shift;
28  
29 0 my $json = {};
30  
31 0 ▶ $json->{name} = $self->name if $self->name;
Branch: 1 branch
BranchTrueFalseTotal
if $self->name 0 0 0
32 0 ▶ $json->{contents} = $self->contents if $self->contents;
Branch: 1 branch
BranchTrueFalseTotal
if $self->contents 0 0 0
33 0 ▶ $json->{classification} = $self->classification if $self->classification;
Branch: 1 branch
BranchTrueFalseTotal
if $self->classification 0 0 0
34 0 ▶ $json->{sensitiveData} = $self->sensitive_data if @{$self->sensitive_data};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->sensitive_data;} 0 0 0
35 0 ▶ $json->{governance} = $self->governance if $self->governance;
Branch: 1 branch
BranchTrueFalseTotal
if $self->governance 0 0 0
36  
37 0 return $json;
38  
39 }
40  
41 1 1;
42  
43 =encoding utf-8
44  
45 =head1 NAME
46  
47 SBOM::CycloneDX::Declarations::Data - Data
48  
49 =head1 SYNOPSIS
50  
51 SBOM::CycloneDX::Declarations::Data->new();
52  
53  
54 =head1 DESCRIPTION
55  
56 L<SBOM::CycloneDX::Declarations::Data> provides the output or analysis that
57 supports claims.
58  
59 =head2 METHODS
60  
61 L<SBOM::CycloneDX::Declarations::Data> inherits all methods from L<SBOM::CycloneDX::Base>
62 and implements the following new ones.
63  
64 =over
65  
66 =item SBOM::CycloneDX::Declarations::Data->new( %PARAMS )
67  
68 Properties:
69  
70 =over
71  
72 =item * C<classification>,
73  
74 =item * C<contents>, The contents or references to the contents of the data
75 being described.
76  
77 =item * C<governance>, Data Governance
78  
79 =item * C<name>, The name of the data.
80  
81 =item * C<sensitive_data>, A description of any sensitive data included.
82  
83 =back
84  
85 =item $data->classification
86  
87 =item $data->contents
88  
89 =item $data->governance
90  
91 =item $data->name
92  
93 =item $data->sensitive_data
94  
95 =back
96  
97  
98 =head1 SUPPORT
99  
100 =head2 Bugs / Feature Requests
101  
102 Please report any bugs or feature requests through the issue tracker
103 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
104 You will be notified automatically of any progress on your issue.
105  
106 =head2 Source Code
107  
108 This is open source software. The code repository is available for
109 public review and contribution under the terms of the license.
110  
111 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
112  
113 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
114  
115  
116 =head1 AUTHOR
117  
118 =over 4
119  
120 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
121  
122 =back
123  
124  
125 =head1 LICENSE AND COPYRIGHT
126  
127 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
128  
129 This is free software; you can redistribute it and/or modify it under
130 the same terms as the Perl 5 programming language system itself.
131  
132 =cut
« CycloneDX/CryptoProperties.pm ↑ Summary CycloneDX/Issue.pm »