File Coverage

blib/lib/SBOM/CycloneDX/Tools.pm
Criterion Covered Total %
statement 26 33 78.7
branch 0 4 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 48 75.0


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Tools;
2              
3 1     1   2515 use 5.010001;
  1         4  
4 1     1   5 use strict;
  1         3  
  1         20  
5 1     1   6 use warnings;
  1         3  
  1         48  
6 1     1   4 use utf8;
  1         1  
  1         8  
7              
8 1     1   105 use SBOM::CycloneDX::List;
  1         2  
  1         29  
9              
10 1     1   4 use Types::Standard qw(InstanceOf);
  1         3  
  1         9  
11 1     1   2885 use Types::TypeTiny qw(ArrayLike);
  1         2  
  1         6  
12              
13 1     1   479 use Moo;
  1         2  
  1         7  
14 1     1   437 use namespace::autoclean;
  1         4  
  1         12  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has components => (
19             is => 'rw',
20             isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Component']],
21             default => sub { SBOM::CycloneDX::List->new }
22             );
23              
24             has services => (
25             is => 'rw',
26             isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Service']],
27             default => sub { SBOM::CycloneDX::List->new }
28             );
29              
30             sub TO_JSON {
31              
32 0     0 1   my $self = shift;
33              
34 0           my $json = {};
35              
36 0 0         $json->{components} = $self->components if @{$self->components};
  0            
37 0 0         $json->{services} = $self->services if @{$self->services};
  0            
38              
39 0           return $json;
40              
41             }
42              
43             1;
44              
45             =encoding utf-8
46              
47             =head1 NAME
48              
49             SBOM::CycloneDX::Tools - [Deprecated] The tool(s) used in the creation, enrichment,
50             and 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 is a "deprecated" module for generate the tool(s) used
61             in the creation, enrichment, and validation of the BOM.
62              
63             =head2 METHODS
64              
65             L inherits all methods from L
66             and implements the following new ones.
67              
68             =over
69              
70             =item SBOM::CycloneDX::Tools->new( %PARAMS )
71              
72             Create a new L object.
73              
74             Parameters:
75              
76             =over
77              
78             =item * C, An ARRAY of software and hardware components used as tools.
79             See L.
80              
81             =item * C, An ARRAY of services used as tools. This may include microservices,
82             function-as-a-service, and other types of network or intra-process services.
83             See L.
84              
85             =back
86              
87             =item $tools->components
88              
89             An ARRAY of software and hardware components used as tools.
90             See L
91              
92             =item $tools->services
93              
94             An ARRAY of services used as tools. This may include microservices,
95             function-as-a-service, and other types of network or intra-process services.
96             See L.
97              
98             =item $tools->TO_JSON
99              
100             =back
101              
102              
103             =head1 SUPPORT
104              
105             =head2 Bugs / Feature Requests
106              
107             Please report any bugs or feature requests through the issue tracker
108             at L.
109             You will be notified automatically of any progress on your issue.
110              
111             =head2 Source Code
112              
113             This is open source software. The code repository is available for
114             public review and contribution under the terms of the license.
115              
116             L
117              
118             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
119              
120              
121             =head1 AUTHOR
122              
123             =over 4
124              
125             =item * Giuseppe Di Terlizzi
126              
127             =back
128              
129              
130             =head1 LICENSE AND COPYRIGHT
131              
132             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
133              
134             This is free software; you can redistribute it and/or modify it under
135             the same terms as the Perl 5 programming language system itself.
136              
137             =cut