CycloneDX/Declarations/Contents.pm

filter: Statementstmt 84.3% 27 / 32 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 100% 1 / 1 totaltotal 78.2% 36 / 46 CC 3 SCAR 13.9
CC
3
Cov
75%
TO_JSON
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« CycloneDX/Declarations/Confidence.pm ↑ Summary CycloneDX/Util.pm »
1 package SBOM::CycloneDX::Declarations::Contents;
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(Str InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 extends 'SBOM::CycloneDX::Base';
16  
17 1 has attachment => (is => 'rw', isa => InstanceOf ['SBOM::CycloneDX::Attachment']);
18 1 has url => (is => 'rw', isa => Str);
19  
20 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=3 SCAR=24.8
Pod documented
21  
22 0 my $self = shift;
23  
24 0 my $json = {};
25  
26 0 ▶ $json->{attachment} = $self->attachment if $self->attachment;
Branch: 1 branch
BranchTrueFalseTotal
if $self->attachment 0 0 0
27 0 ▶ $json->{url} = $self->url if $self->url;
Branch: 1 branch
BranchTrueFalseTotal
if $self->url 0 0 0
28  
29 0 return $json;
30  
31 }
32  
33 1 1;
34  
35 =encoding utf-8
36  
37 =head1 NAME
38  
39 SBOM::CycloneDX::Declarations::Contents - Data Contents
40  
41 =head1 SYNOPSIS
42  
43 SBOM::CycloneDX::Declarations::Contents->new();
44  
45  
46 =head1 DESCRIPTION
47  
48 L<SBOM::CycloneDX::Declarations::Contents> provide the contents or references to
49 the contents of the data being described.
50  
51 =head2 METHODS
52  
53 L<SBOM::CycloneDX::Declarations::Contents> inherits all methods from L<SBOM::CycloneDX::Base>
54 and implements the following new ones.
55  
56 =over
57  
58 =item SBOM::CycloneDX::Declarations::Contents->new( %PARAMS )
59  
60 Properties:
61  
62 =over
63  
64 =item * C<attachment>, A way to include textual or encoded data.
65  
66 =item * C<url>, The URL to where the data can be retrieved.
67  
68 =back
69  
70 =item $contents->attachment
71  
72 =item $contents->url
73  
74 =back
75  
76  
77 =head1 SUPPORT
78  
79 =head2 Bugs / Feature Requests
80  
81 Please report any bugs or feature requests through the issue tracker
82 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
83 You will be notified automatically of any progress on your issue.
84  
85 =head2 Source Code
86  
87 This is open source software. The code repository is available for
88 public review and contribution under the terms of the license.
89  
90 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
91  
92 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
93  
94  
95 =head1 AUTHOR
96  
97 =over 4
98  
99 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
100  
101 =back
102  
103  
104 =head1 LICENSE AND COPYRIGHT
105  
106 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
107  
108 This is free software; you can redistribute it and/or modify it under
109 the same terms as the Perl 5 programming language system itself.
110  
111 =cut
« CycloneDX/Declarations/Confidence.pm ↑ Summary CycloneDX/Util.pm »