CSAF/Type/FullProductName.pm

filter: Statementstmt 73.3% 22 / 30 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 6 / 9 Podpod 100% 1 / 1 totaltotal 69.0% 29 / 42 CC 2 SCAR 7.9
CC
2
Cov
69%
TO_CSAF
6.0
_trigger_product_id
2.0
_trigger_product_identification_helper
2.0
CRAP 2.2
« CSAF/Type/Relationship.pm ↑ Summary CSAF/Type/Product.pm »
1 package CSAF::Type::FullProductName;
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 CSAF::Type::ProductIdentificationHelper;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 extends 'CSAF::Type::Base';
12  
13 1 has name => (is => 'rw', required => 1);
14 1 has product_id => (is => 'rw', required => 1, trigger => 1);
15 1 has product_identification_helper => (is => 'rw', trigger => 1);
16  
17 0 ▶sub _trigger_product_id {
Subroutine _trigger_product_id: not called CC=1 SCAR=6.9
18 0 $CSAF::CACHE->{products}->{$_[0]->product_id} = $_[0]->name;
19 }
20  
21 0 ▶sub _trigger_product_identification_helper {
Subroutine _trigger_product_identification_helper: not called CC=1 SCAR=6.9
22 0 my ($self) = @_;
23 $self->{product_identification_helper}
24 0 = CSAF::Type::ProductIdentificationHelper->new($self->product_identification_helper);
25 }
26  
27 0 ▶sub TO_CSAF {
Subroutine TO_CSAF: not called CC=2 SCAR=17.9
Pod documented
28  
29 0 my $self = shift;
30  
31 0 my $output = {name => $self->name, product_id => $self->product_id};
32  
33 0 ▶ if (my $product_identification_helper = $self->{product_identification_helper}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $product_identification_helper = $self->{"product_identification_helper"}) 0 0 0
34 0 $output->{product_identification_helper} = $product_identification_helper;
35 }
36  
37 0 return $output;
38  
39 }
40  
41 1 1;
42  
43 __END__
« CSAF/Type/Relationship.pm ↑ Summary CSAF/Type/Product.pm »