CSAF/Type/TLP.pm

filter: Statementstmt 82.1% 23 / 28 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 78.0% 32 / 41 CC 3 SCAR 7.9
CC
3
Cov
75%
TO_CSAF
6.0
__ANON__
2.0
BEGIN
1.0
CRAP 2.2
« CSAF/Type/Product.pm ↑ Summary CSAF/Base.pm »
1 package CSAF::Type::TLP;
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 extends 'CSAF::Type::Base';
10  
11 1 my @LABELS = (qw[AMBER GREEN RED WHITE]);
12  
13 has label => (
14 is => 'rw',
15 default => 'WHITE',
16 2 ▶ isa => sub {
Subroutine __ANON__: called CC=2 SCAR=7.1
17 2 my $test = shift;
18 2 ▶ Carp::croak 'Unknown TLP label' unless grep { $test eq $_ } @LABELS;
Branch: 1 branch
BranchTrueFalseTotal
unless grep {$test eq $_;} @LABELS 0 2 2
19 },
20 2 ▶ coerce => sub { uc $_[0] }
Subroutine __ANON__: called CC=1 SCAR=0.0
21 1 );
22  
23 1 has url => (is => 'rw', default => 'https://www.first.org/tlp/');
24  
25 0 ▶sub TO_CSAF {
Subroutine TO_CSAF: not called CC=2 SCAR=17.9
Pod documented
26  
27 0 my $self = shift;
28  
29 0 my $output = {};
30  
31 0 $output->{label} = $self->label;
32 0 ▶ $output->{url} = $self->url if ($self->url);
Branch: 1 branch
BranchTrueFalseTotal
if $self->url 0 0 0
33  
34 0 return $output;
35  
36 }
37  
38 1 1;
39  
40 __END__
« CSAF/Type/Product.pm ↑ Summary CSAF/Base.pm »