File Coverage

blib/lib/SBOM/CycloneDX/Tool.pm
Criterion Covered Total %
statement 26 36 72.2
branch 0 10 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 57 63.1


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Tool;
2              
3 16     16   423 use 5.010001;
  16         283  
4 16     16   153 use strict;
  16         35  
  16         550  
5 16     16   85 use warnings;
  16         36  
  16         1088  
6 16     16   128 use utf8;
  16         31  
  16         140  
7              
8 16     16   599 use SBOM::CycloneDX::List;
  16         36  
  16         745  
9              
10 16     16   88 use Types::Standard qw(Str InstanceOf);
  16         33  
  16         194  
11 16     16   57444 use Types::TypeTiny qw(ArrayLike);
  16         42  
  16         170  
12              
13 16     16   9653 use Moo;
  16         42  
  16         135  
14 16     16   7745 use namespace::autoclean;
  16         44  
  16         195  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has vendor => (is => 'rw', isa => Str);
19             has name => (is => 'rw', isa => Str);
20             has version => (is => 'rw', isa => Str);
21              
22             has hashes => (
23             is => 'rw',
24             isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Hash']],
25             default => sub { SBOM::CycloneDX::List->new }
26             );
27              
28             has external_references => (
29             is => 'rw',
30             isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::ExternalReference']],
31             default => sub { SBOM::CycloneDX::List->new }
32             );
33              
34             sub TO_JSON {
35              
36 0     0 1   my $self = shift;
37              
38 0           my $json = {};
39              
40 0 0         $json->{vendor} = $self->vendor if $self->vendor;
41 0 0         $json->{name} = $self->name if $self->name;
42 0 0         $json->{version} = $self->version if $self->version;
43 0 0         $json->{hashes} = $self->hashes if @{$self->hashes};
  0            
44 0 0         $json->{externalReferences} = $self->external_references if @{$self->external_references};
  0            
45              
46 0           return $json;
47              
48             }
49              
50             1;
51              
52             =encoding utf-8
53              
54             =head1 NAME
55              
56             SBOM::CycloneDX::Tool - Tool (legacy, deprecated)
57              
58             =head1 SYNOPSIS
59              
60             SBOM::CycloneDX::Tool->new();
61              
62              
63             =head1 DESCRIPTION
64              
65             [Deprecated] This will be removed in a future version. Use component or service
66             instead. Information about the automated or manual tool used
67              
68             =head2 METHODS
69              
70             L inherits all methods from L
71             and implements the following new ones.
72              
73             =over
74              
75             =item SBOM::CycloneDX::Tool->new( %PARAMS )
76              
77             Properties:
78              
79             =over
80              
81             =item * C, External references provide a way to document
82             systems, sites, and information that may be relevant, but are not included
83             with the BOM. They may also establish specific relationships within or
84             external to the BOM.
85              
86             =item * C, The hashes of the tool (if applicable).
87              
88             =item * C, The name of the tool
89              
90             =item * C, The name of the vendor who created the tool
91              
92             =item * C, The version of the tool
93              
94             =back
95              
96             =item $tool->external_references
97              
98             =item $tool->hashes
99              
100             =item $tool->name
101              
102             =item $tool->vendor
103              
104             =item $tool->version
105              
106             =back
107              
108              
109             =head1 SUPPORT
110              
111             =head2 Bugs / Feature Requests
112              
113             Please report any bugs or feature requests through the issue tracker
114             at L.
115             You will be notified automatically of any progress on your issue.
116              
117             =head2 Source Code
118              
119             This is open source software. The code repository is available for
120             public review and contribution under the terms of the license.
121              
122             L
123              
124             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
125              
126              
127             =head1 AUTHOR
128              
129             =over 4
130              
131             =item * Giuseppe Di Terlizzi
132              
133             =back
134              
135              
136             =head1 LICENSE AND COPYRIGHT
137              
138             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
139              
140             This is free software; you can redistribute it and/or modify it under
141             the same terms as the Perl 5 programming language system itself.
142              
143             =cut