CycloneDX/Tool.pm

filter: Statementstmt 73.3% 33 / 45 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 9 / 12 Podpod 100% 1 / 1 totaltotal 63.2% 43 / 68 CC 6 SCAR 27.5
CC
6
Cov
60%
TO_JSON
42.0
__ANON__
2.0
__ANON__
2.0
CRAP 15.6
« CycloneDX/Composition.pm ↑ Summary CycloneDX/Declarations/Map.pm »
1 package SBOM::CycloneDX::Tool;
2  
3 16 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 16 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 16 ▶use SBOM::CycloneDX::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 16 ▶use Types::Standard qw(Str InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 16 ▶use Types::TypeTiny qw(ArrayLike);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 16 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 16 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 16 extends 'SBOM::CycloneDX::Base';
17  
18 16 has vendor => (is => 'rw', isa => Str);
19 16 has name => (is => 'rw', isa => Str);
20 16 has version => (is => 'rw', isa => Str);
21  
22 has hashes => (
23 is => 'rw',
24 isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Hash']],
25 0 ▶ default => sub { SBOM::CycloneDX::List->new }
Subroutine __ANON__: not called CC=1 SCAR=6.9
26 16 );
27  
28 has external_references => (
29 is => 'rw',
30 isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::ExternalReference']],
31 0 ▶ default => sub { SBOM::CycloneDX::List->new }
Subroutine __ANON__: not called CC=1 SCAR=6.9
32 16 );
33  
34 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=6 SCAR=37.4
Pod documented
35  
36 0 my $self = shift;
37  
38 0 my $json = {};
39  
40 0 ▶ $json->{vendor} = $self->vendor if $self->vendor;
Branch: 1 branch
BranchTrueFalseTotal
if $self->vendor 0 0 0
41 0 ▶ $json->{name} = $self->name if $self->name;
Branch: 1 branch
BranchTrueFalseTotal
if $self->name 0 0 0
42 0 ▶ $json->{version} = $self->version if $self->version;
Branch: 1 branch
BranchTrueFalseTotal
if $self->version 0 0 0
43 0 ▶ $json->{hashes} = $self->hashes if @{$self->hashes};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->hashes;} 0 0 0
44 0 ▶ $json->{externalReferences} = $self->external_references if @{$self->external_references};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->external_references;} 0 0 0
45  
46 0 return $json;
47  
48 }
49  
50 16 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<SBOM::CycloneDX::Tool> inherits all methods from L<SBOM::CycloneDX::Base>
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>, 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<hashes>, The hashes of the tool (if applicable).
87  
88 =item * C<name>, The name of the tool
89  
90 =item * C<vendor>, The name of the vendor who created the tool
91  
92 =item * C<version>, 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<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
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<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
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 <gdt@cpan.org>
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
« CycloneDX/Composition.pm ↑ Summary CycloneDX/Declarations/Map.pm »