File Coverage

blib/lib/SBOM/CycloneDX/Declarations/Data.pm
Criterion Covered Total %
statement 26 35 74.2
branch 0 10 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 56 64.2


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Declarations::Data;
2              
3 1     1   2074 use 5.010001;
  1         6  
4 1     1   6 use strict;
  1         2  
  1         27  
5 1     1   6 use warnings;
  1         3  
  1         64  
6 1     1   7 use utf8;
  1         1  
  1         11  
7              
8 1     1   46 use SBOM::CycloneDX::List;
  1         3  
  1         54  
9              
10 1     1   5 use Types::Standard qw(Str InstanceOf);
  1         3  
  1         13  
11 1     1   2592 use Types::TypeTiny qw(ArrayLike);
  1         4  
  1         12  
12              
13 1     1   869 use Moo;
  1         3  
  1         16  
14 1     1   616 use namespace::autoclean;
  1         4  
  1         19  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has name => (is => 'rw', isa => Str);
19             has contents => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Declarations::Contents']);
20             has classification => (is => 'rw', isa => Str);
21             has sensitive_data => (is => 'rw', isa => ArrayLike [Str], default => sub { SBOM::CycloneDX::List->new });
22             has governance => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::DataGovernance']);
23              
24              
25             sub TO_JSON {
26              
27 0     0 1   my $self = shift;
28              
29 0           my $json = {};
30              
31 0 0         $json->{name} = $self->name if $self->name;
32 0 0         $json->{contents} = $self->contents if $self->contents;
33 0 0         $json->{classification} = $self->classification if $self->classification;
34 0 0         $json->{sensitiveData} = $self->sensitive_data if @{$self->sensitive_data};
  0            
35 0 0         $json->{governance} = $self->governance if $self->governance;
36              
37 0           return $json;
38              
39             }
40              
41             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 provides the output or analysis that
57             supports claims.
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::Declarations::Data->new( %PARAMS )
67              
68             Properties:
69              
70             =over
71              
72             =item * C,
73              
74             =item * C, The contents or references to the contents of the data
75             being described.
76              
77             =item * C, Data Governance
78              
79             =item * C, The name of the data.
80              
81             =item * C, 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.
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
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
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