CycloneDX/Tools.pm

filter: Statementstmt 76.9% 30 / 39 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 9 / 12 Podpod 100% 1 / 1 totaltotal 71.4% 40 / 56 CC 3 SCAR 12.5
CC
3
Cov
70%
TO_JSON
12.0
__ANON__
2.0
__ANON__
2.0
CRAP 3.5
« CycloneDX/CryptoProperties/SecuredBy.pm ↑ Summary CycloneDX/Metadata/Lifecycle.pm »
1 package SBOM::CycloneDX::Tools;
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(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 has components => (
19 is => 'rw',
20 isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Component']],
21 0 ▶ default => sub { SBOM::CycloneDX::List->new }
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 1 );
23  
24 has services => (
25 is => 'rw',
26 isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Service']],
27 0 ▶ default => sub { SBOM::CycloneDX::List->new }
Subroutine __ANON__: not called CC=1 SCAR=6.9
28 1 );
29  
30 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=3 SCAR=24.8
Pod documented
31  
32 0 my $self = shift;
33  
34 0 my $json = {};
35  
36 0 ▶ $json->{components} = $self->components if @{$self->components};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->components;} 0 0 0
37 0 ▶ $json->{services} = $self->services if @{$self->services};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->services;} 0 0 0
38  
39 0 return $json;
40  
41 }
42  
43 1 1;
44  
45 =encoding utf-8
46  
47 =head1 NAME
48  
49 SBOM::CycloneDX::Tools - The tool(s) used in the creation, enrichment, and
50 validation of the BOM.
51  
52 =head1 SYNOPSIS
53  
54 $tools = SBOM::CycloneDX::Tools->new;
55  
56 $tools->components->add($component);
57  
58 =head1 DESCRIPTION
59  
60 L<SBOM::CycloneDX::Tools> used in the creation, enrichment, and validation of the BOM.
61  
62 =head2 METHODS
63  
64 L<SBOM::CycloneDX::Tools> inherits all methods from L<SBOM::CycloneDX::Base>
65 and implements the following new ones.
66  
67 =over
68  
69 =item SBOM::CycloneDX::Tools->new( %PARAMS )
70  
71 Create a new L<SBOM::CycloneDX::Tools> object.
72  
73 Parameters:
74  
75 =over
76  
77 =item * C<components>, An ARRAY of software and hardware components used as tools.
78 See L<SBOM::CycloneDX::Component>.
79  
80 =item * C<services>, An ARRAY of services used as tools. This may include microservices,
81 function-as-a-service, and other types of network or intra-process services.
82 See L<SBOM::CycloneDX::Service>.
83  
84 =back
85  
86 =item $tools->components
87  
88 An ARRAY of software and hardware components used as tools.
89 See L<SBOM::CycloneDX::Component>
90  
91 =item $tools->services
92  
93 An ARRAY of services used as tools. This may include microservices,
94 function-as-a-service, and other types of network or intra-process services.
95 See L<SBOM::CycloneDX::Service>.
96  
97 =item $tools->TO_JSON
98  
99 =back
100  
101  
102 =head1 SUPPORT
103  
104 =head2 Bugs / Feature Requests
105  
106 Please report any bugs or feature requests through the issue tracker
107 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
108 You will be notified automatically of any progress on your issue.
109  
110 =head2 Source Code
111  
112 This is open source software. The code repository is available for
113 public review and contribution under the terms of the license.
114  
115 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
116  
117 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
118  
119  
120 =head1 AUTHOR
121  
122 =over 4
123  
124 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
125  
126 =back
127  
128  
129 =head1 LICENSE AND COPYRIGHT
130  
131 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
132  
133 This is free software; you can redistribute it and/or modify it under
134 the same terms as the Perl 5 programming language system itself.
135  
136 =cut
« CycloneDX/CryptoProperties/SecuredBy.pm ↑ Summary CycloneDX/Metadata/Lifecycle.pm »