CSAF/Type/ProductStatus.pm

filter: Statementstmt 74.1% 23 / 31 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 100% 1 / 1 totaltotal 70.2% 33 / 47 CC 5 SCAR 19.5
CC
5
Cov
65%
TO_CSAF
20.0
__ANON__
2.1
BEGIN
1.0
CRAP 7.0
« CSAF/Renderer/HTML.pm ↑ Summary CSAF/Type/Score.pm »
1 package CSAF::Type::ProductStatus;
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 Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 extends 'CSAF::Type::Base';
12  
13 1 my @ATTRIBUTES = qw(
14 first_affected first_fixed fixed known_affected known_not_affected
15 last_affected recommended under_investigation
16 );
17  
18 has [@ATTRIBUTES] => (
19 is => 'rw',
20 16 ▶ isa => sub {
Subroutine __ANON__: called CC=2 SCAR=7.6
21 16 ▶ Carp::croak 'must be an array of products' if (ref $_[0] ne 'ARRAY');
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] ne "ARRAY" 0 16 16
22 },
23 16 ▶ default => sub { [] }
Subroutine __ANON__: called CC=1 SCAR=0.0
24 1 );
25  
26 0 ▶sub TO_CSAF {
Subroutine TO_CSAF: not called CC=4 SCAR=30.0
Pod documented
27  
28 0 my $self = shift;
29  
30 0 my $output = {};
31  
32 0 for my $attribute (@ATTRIBUTES) {
33 0 ▶ $output->{$attribute} = $self->$attribute if (@{$self->$attribute});
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->$attribute;} 0 0 0
34 }
35  
36 0 ▶ return if (!keys %{$output});
Branch: 1 branch
BranchTrueFalseTotal
unless keys %{$output;} 0 0 0
37  
38 0 return $output;
39  
40 }
41  
42 1 1;
43  
44 __END__
« CSAF/Renderer/HTML.pm ↑ Summary CSAF/Type/Score.pm »