CycloneDX/Metadata/DistributionConstraint.pm

filter: Statementstmt 86.6% 26 / 30 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 100% 1 / 1 totaltotal 83.3% 35 / 42 CC 2 SCAR 6.9
CC
2
Cov
81%
TO_JSON
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« CycloneDX/Vulnerability/Source.pm ↑ Summary CycloneDX/Vulnerability/Affect.pm »
1 package SBOM::CycloneDX::Metadata::DistributionConstraint;
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::Enum;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Types::Standard qw(Enum Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 extends 'SBOM::CycloneDX::Base';
16  
17 1 has tlp => (is => 'rw', default => 'CLEAR', isa => Enum [SBOM::CycloneDX::Enum->values('TLP_CLASSIFICATION')]);
18  
19 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=2 SCAR=17.9
Pod documented
20  
21 0 my $self = shift;
22  
23 0 my $json = {};
24  
25 0 ▶ $json->{tlp} = $self->tlp if $self->tlp;
Branch: 1 branch
BranchTrueFalseTotal
if $self->tlp 0 0 0
26  
27 0 return $json;
28  
29 }
30  
31 1 1;
32  
33 =encoding utf-8
34  
35 =head1 NAME
36  
37 SBOM::CycloneDX::Metadata::DistributionConstraint - Distribution Constraints
38  
39 =head1 SYNOPSIS
40  
41 SBOM::CycloneDX::Metadata::DistributionConstraint->new();
42  
43  
44 =head1 DESCRIPTION
45  
46 L<SBOM::CycloneDX::Metadata::DistributionConstraint> Conditions and
47 constraints governing the sharing and distribution of the data or
48 components described by this BOM.
49  
50 =head2 METHODS
51  
52 L<SBOM::CycloneDX::Metadata::DistributionConstraint> inherits all methods from L<SBOM::CycloneDX::Base>
53 and implements the following new ones.
54  
55 =over
56  
57 =item SBOM::CycloneDX::Metadata::DistributionConstraint->new( %PARAMS )
58  
59 Properties:
60  
61 =over
62  
63 =item * C<tlp>, The Traffic Light Protocol (TLP) classification that controls
64 the sharing and distribution of the data that the BOM describes.
65  
66 The default classification is C<CLEAR>.
67  
68 =back
69  
70 =item $distribution_constraint->tlp
71  
72 Traffic Light Protocol (TLP) is a classification system for identifying the
73 potential risk associated with artefact, including whether it is subject to
74 certain types of legal, financial, or technical threats. Refer to
75 L<https://www.first.org/tlp/> for further information.
76  
77 The default classification is C<CLEAR>.
78  
79 =over
80  
81 =item * C<CLEAR>, The information is not subject to any restrictions as regards
82 the sharing.
83  
84 =item * C<GREEN>, The information is subject to limited disclosure, and
85 recipients can share it within their community but not via publicly accessible
86 channels.
87  
88 =item * C<AMBER>, The information is subject to limited disclosure, and
89 recipients can only share it on a need-to-know basis within their organization
90 and with clients.
91  
92 =item * C<AMBER_AND_STRICT>, The information is subject to limited disclosure,
93 and recipients can only share it on a need-to-know basis within their
94 organization.
95  
96 =item * C<RED>, The information is subject to restricted distribution to
97 individual recipients only and must not be shared.
98  
99 =back
100  
101 =back
102  
103  
104 =head1 SUPPORT
105  
106 =head2 Bugs / Feature Requests
107  
108 Please report any bugs or feature requests through the issue tracker
109 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
110 You will be notified automatically of any progress on your issue.
111  
112 =head2 Source Code
113  
114 This is open source software. The code repository is available for
115 public review and contribution under the terms of the license.
116  
117 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
118  
119 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
120  
121  
122 =head1 AUTHOR
123  
124 =over 4
125  
126 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
127  
128 =back
129  
130  
131 =head1 LICENSE AND COPYRIGHT
132  
133 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
134  
135 This is free software; you can redistribute it and/or modify it under
136 the same terms as the Perl 5 programming language system itself.
137  
138 =cut
« CycloneDX/Vulnerability/Source.pm ↑ Summary CycloneDX/Vulnerability/Affect.pm »