CycloneDX/Metadata/Lifecycle.pm

filter: Statementstmt 100% 37 / 37 Branchbran 80.0% 8 / 10 Conditioncond 66.6% 4 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 10 / 10 Podpod 50.0% 1 / 2 totaltotal 86.9% 60 / 69 CC 8 SCAR 11.3
CC
8
Cov
92%
BUILD
5.7
TO_JSON
4.0
BEGIN
1.0
CRAP 3.1
« CycloneDX/Tools.pm ↑ Summary CycloneDX/OrganizationalContact.pm »
1 package SBOM::CycloneDX::Metadata::Lifecycle;
2  
3 2 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use SBOM::CycloneDX::Enum;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Types::Standard qw(Enum Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 extends 'SBOM::CycloneDX::Base';
16  
17 9 ▶sub BUILD {
Subroutine BUILD: called CC=5 SCAR=17.5
Pod undocumented
18 9 my ($self, $args) = @_;
19 9 ▶ Carp::croak('"phase" and "name" cannot be used at the same time') if exists $args->{phase} && exists $args->{name};
Branch: 1 branch
BranchTrueFalseTotal
if exists $args->{"phase"} and exists $args->{"name"} 0 9 9
Condition66%2/3
exists $args->{"phase"} and exists $args->{"name"}
!ll&&!rl&&r
360
MC/DC0%0/2
exists $args->{"phase"} and exists $args->{"name"}
exists $args->{"phase"} exists $args->{"name"}
Truth table66%2/3
A and B
A= exists $args->{"phase"}B= exists $args->{"name"}
ABresult
0X0
100
111
20 9 ▶ Carp::croak('"description" without "name"') if exists $args->{phase} && exists $args->{description};
Branch: 1 branch
BranchTrueFalseTotal
if exists $args->{"phase"} and exists $args->{"description"} 0 9 9
Condition66%2/3
exists $args->{"phase"} and exists $args->{"description"}
!ll&&!rl&&r
360
MC/DC0%0/2
exists $args->{"phase"} and exists $args->{"description"}
exists $args->{"phase"} exists $args->{"description"}
Truth table66%2/3
A and B
A= exists $args->{"phase"}B= exists $args->{"description"}
ABresult
0X0
100
111
21 }
22  
23 2 has phase => (is => 'rw', isa => Enum [SBOM::CycloneDX::Enum->values('LIFECYCLE_PHASE')]);
24 2 has name => (is => 'rw', isa => Str);
25 2 has description => (is => 'rw', isa => Str);
26  
27 27 ▶sub TO_JSON {
Subroutine TO_JSON: called CC=4 SCAR=13.9
Pod documented
28  
29 27 my $self = shift;
30  
31 27 my $json = {};
32  
33 27 ▶ $json->{phase} = $self->phase if $self->phase;
Branch: 1 branch
BranchTrueFalseTotal
if $self->phase 18 9 27
34 27 ▶ $json->{name} = $self->name if $self->name;
Branch: 1 branch
BranchTrueFalseTotal
if $self->name 9 18 27
35 27 ▶ $json->{description} = $self->description if $self->description;
Branch: 1 branch
BranchTrueFalseTotal
if $self->description 9 18 27
36  
37 27 return $json;
38  
39 }
40  
41 2 1;
42  
43 =encoding utf-8
44  
45 =head1 NAME
46  
47 SBOM::CycloneDX::Metadata::Lifecycle - Lifecycle
48  
49 =head1 SYNOPSIS
50  
51 SBOM::CycloneDX::Metadata::Lifecycle->new();
52  
53  
54 =head1 DESCRIPTION
55  
56 L<SBOM::CycloneDX::Metadata::Lifecycle> provides the product lifecycle(s) that
57 this BOM represents.
58  
59 =head2 METHODS
60  
61 L<SBOM::CycloneDX::Metadata::Lifecycle> inherits all methods from L<SBOM::CycloneDX::Base>
62 and implements the following new ones.
63  
64 =over
65  
66 =item SBOM::CycloneDX::Metadata::Lifecycle->new( %PARAMS )
67  
68 Properties:
69  
70 =over
71  
72 =item * C<description>, The name of the lifecycle phase.
73  
74 =item * C<name>, The description of the lifecycle phase.
75  
76 =item * C<phase>, A pre-defined phase in the product lifecycle.
77  
78 =back
79  
80 =item $lifecycle->description
81  
82 =item $lifecycle->name
83  
84 =item $lifecycle->phase
85  
86 =back
87  
88  
89 =head1 SUPPORT
90  
91 =head2 Bugs / Feature Requests
92  
93 Please report any bugs or feature requests through the issue tracker
94 at L<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>.
95 You will be notified automatically of any progress on your issue.
96  
97 =head2 Source Code
98  
99 This is open source software. The code repository is available for
100 public review and contribution under the terms of the license.
101  
102 L<https://github.com/giterlizzi/perl-SBOM-CycloneDX>
103  
104 git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
105  
106  
107 =head1 AUTHOR
108  
109 =over 4
110  
111 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
112  
113 =back
114  
115  
116 =head1 LICENSE AND COPYRIGHT
117  
118 This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
119  
120 This is free software; you can redistribute it and/or modify it under
121 the same terms as the Perl 5 programming language system itself.
122  
123 =cut
« CycloneDX/Tools.pm ↑ Summary CycloneDX/OrganizationalContact.pm »