CycloneDX/BomRef.pm

filter: Statementstmt 96.7% 30 / 31 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 100% 2 / 2 totaltotal 95.6% 44 / 46 CC 2 SCAR 1.9
CC
2
Cov
94%
__ANON__
2.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« CycloneDX/Dependency.pm ↑ Summary CycloneDX/Hash.pm »
1 package SBOM::CycloneDX::BomRef;
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 Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 16 ▶use Time::Piece;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 16 ▶use overload '""' => \&to_string, fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 16 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 20 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=2 SCAR=8.1
16  
17 20 my ($orig, $class, @args) = @_;
18  
19 20 ▶ return {value => $args[0]} if @args == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @args == 1 20 0 20
20 0 return $class->$orig(@args);
21  
22 16 };
23  
24 16 has value => (is => 'rw', required => 1);
25  
26 72 ▶sub to_string { shift->TO_JSON }
Subroutine to_string: called CC=1 SCAR=0.0
Pod documented
27  
28 186 ▶sub TO_JSON { shift->value }
Subroutine TO_JSON: called CC=1 SCAR=0.0
Pod documented
29  
30 16 1;
31  
32 =encoding utf-8
33  
34 =head1 NAME
35  
36 SBOM::CycloneDX::BomRef - BOM-ref representation for CycloneDX
37  
38 =head1 SYNOPSIS
39  
40 $component->bom_ref(SBOM::CycloneDX::BomRef->new('app-component'));
41  
42  
43 =head1 DESCRIPTION
44  
45 L<SBOM::CycloneDX::BomRef> represents the BOM reference in L<SBOM::CycloneDX>.
46  
47 =head2 METHODS
48  
49 =over
50  
51 =item SBOM::CycloneDX::BomRef->new( %PARAMS )
52  
53 =item $bom_ref->value
54  
55 =item $bom_ref->to_string
56  
57 =item $bom_ref->TO_JSON
58  
59 Return BOM ref.
60  
61 =back
62  
63 =head1 SUPPORT
64  
65 =head2 Bugs / Feature Requests
66  
67 Please report any bugs or feature requests through the issue tracker
68 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
69 You will be notified automatically of any progress on your issue.
70  
71 =head2 Source Code
72  
73 This is open source software. The code repository is available for
74 public review and contribution under the terms of the license.
75  
76 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
77  
78 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
79  
80  
81 =head1 AUTHOR
82  
83 =over 4
84  
85 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
86  
87 =back
88  
89  
90 =head1 LICENSE AND COPYRIGHT
91  
92 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
93  
94 This is free software; you can redistribute it and/or modify it under
95 the same terms as the Perl 5 programming language system itself.
96  
97 =cut
« CycloneDX/Dependency.pm ↑ Summary CycloneDX/Hash.pm »