CSAF/Type/Note.pm

filter: Statementstmt 77.7% 21 / 27 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 1 / 1 totaltotal 65.8% 27 / 41 CC 4 SCAR 16.7
CC
4
Cov
64%
TO_CSAF
12.0
__ANON__
6.0
BEGIN
1.0
CRAP 5.3
« CSAF/Type/Publisher.pm ↑ Summary CSAF/Type/Notes.pm »
1 package CSAF::Type::Note;
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 @CATEGORIES = ('description', 'details', 'faq', 'general', 'legal_disclaimer', 'other', 'summary');
12  
13 has category => (
14 is => 'rw',
15 required => 1,
16 0 ▶ isa => sub { Carp::croak 'Unknown note "category"' unless grep(/$_[0]/, @CATEGORIES) }
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
unless grep /$_[0]/, @CATEGORIES 0 0 0
17 1 );
18  
19 1 has text => (is => 'rw', required => 1);
20 1 has audience => (is => 'rw');
21 1 has title => (is => 'rw');
22  
23  
24 0 ▶sub TO_CSAF {
Subroutine TO_CSAF: not called CC=3 SCAR=24.8
Pod documented
25  
26 0 my $self = shift;
27  
28 0 my $output = {category => $self->category, text => $self->text};
29  
30 0 ▶ $output->{audience} = $self->audience if ($self->audience);
Branch: 1 branch
BranchTrueFalseTotal
if $self->audience 0 0 0
31 0 ▶ $output->{title} = $self->title if ($self->title);
Branch: 1 branch
BranchTrueFalseTotal
if $self->title 0 0 0
32  
33 0 return $output;
34  
35 }
36  
37 1 1;
38  
39 __END__
« CSAF/Type/Publisher.pm ↑ Summary CSAF/Type/Notes.pm »