CycloneDX/Standard/Level.pm

filter: Statementstmt 78.2% 36 / 46 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 10 / 12 Podpod 100% 1 / 1 totaltotal 66.2% 47 / 71 CC 7 SCAR 27.2
CC
7
Cov
62%
TO_JSON
42.0
__ANON__
6.0
BEGIN
1.0
CRAP 15.2
« CycloneDX/Component/ModelCard.pm ↑ Summary CycloneDX/CryptoProperties/CipherSuite.pm »
1 package SBOM::CycloneDX::Standard::Level;
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::BomRef;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use SBOM::CycloneDX::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Types::Standard qw(Str InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Types::TypeTiny qw(ArrayLike);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 extends 'SBOM::CycloneDX::Base';
18  
19 has bom_ref => (
20 is => 'rw',
21 isa => InstanceOf ['SBOM::CycloneDX::BomRef'],
22 0 ▶ coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::BomRef->new($_[0]) }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] ? : 0 0 0
23 1 );
24  
25 1 has identifier => (is => 'rw', isa => Str);
26 1 has title => (is => 'rw', isa => Str);
27 1 has description => (is => 'rw', isa => Str);
28 1 has requirements => (is => 'rw', isa => ArrayLike [Str]); # Like bom-ref
29  
30 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=6 SCAR=37.4
Pod documented
31  
32 0 my $self = shift;
33  
34 0 my $json = {};
35  
36 0 ▶ $json->{'bom-ref'} = $self->bom_ref if $self->bom_ref;
Branch: 1 branch
BranchTrueFalseTotal
if $self->bom_ref 0 0 0
37 0 ▶ $json->{identifier} = $self->identifier if $self->identifier;
Branch: 1 branch
BranchTrueFalseTotal
if $self->identifier 0 0 0
38 0 ▶ $json->{title} = $self->title if $self->title;
Branch: 1 branch
BranchTrueFalseTotal
if $self->title 0 0 0
39 0 ▶ $json->{description} = $self->description if $self->description;
Branch: 1 branch
BranchTrueFalseTotal
if $self->description 0 0 0
40 0 ▶ $json->{requirements} = $self->requirements if @{$self->requirements};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->requirements;} 0 0 0
41  
42 0 return $json;
43  
44 }
45  
46 1 1;
47  
48 =encoding utf-8
49  
50 =head1 NAME
51  
52 SBOM::CycloneDX::Standard::Level - Standard Level
53  
54 =head1 SYNOPSIS
55  
56 SBOM::CycloneDX::Standard::Level->new();
57  
58  
59 =head1 DESCRIPTION
60  
61 L<SBOM::CycloneDX::Standard::Level> provides the level associated with the standard.
62 Some standards have different levels of compliance.
63  
64 =head2 METHODS
65  
66 L<SBOM::CycloneDX::Standard::Level> inherits all methods from L<SBOM::CycloneDX::Base>
67 and implements the following new ones.
68  
69 =over
70  
71 =item SBOM::CycloneDX::Standard::Level->new( %PARAMS )
72  
73 Properties:
74  
75 =over
76  
77 =item * C<bom_ref>, An identifier which can be used to reference the
78 object elsewhere in the BOM. Every bom-ref must be unique within the BOM.
79  
80 =item * C<description>, The description of the level.
81  
82 =item * C<identifier>, The identifier used in the standard to identify a
83 specific level.
84  
85 =item * C<requirements>, The list of requirement `bom-ref`s that comprise the
86 level.
87  
88 =item * C<title>, The title of the level.
89  
90 =back
91  
92 =item $level->bom_ref
93  
94 =item $level->description
95  
96 =item $level->identifier
97  
98 =item $level->requirements
99  
100 =item $level->title
101  
102 =back
103  
104  
105 =head1 SUPPORT
106  
107 =head2 Bugs / Feature Requests
108  
109 Please report any bugs or feature requests through the issue tracker
110 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
111 You will be notified automatically of any progress on your issue.
112  
113 =head2 Source Code
114  
115 This is open source software. The code repository is available for
116 public review and contribution under the terms of the license.
117  
118 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
119  
120 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
121  
122  
123 =head1 AUTHOR
124  
125 =over 4
126  
127 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
128  
129 =back
130  
131  
132 =head1 LICENSE AND COPYRIGHT
133  
134 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
135  
136 This is free software; you can redistribute it and/or modify it under
137 the same terms as the Perl 5 programming language system itself.
138  
139 =cut
« CycloneDX/Component/ModelCard.pm ↑ Summary CycloneDX/CryptoProperties/CipherSuite.pm »