Resume/MoopsParserTrait.pm

filter: Statementstmt 97.4% 38 / 39 Branchbran 50.0% 3 / 6 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 89.2% 50 / 56 CC 5 SCAR 6.3
CC
5
Cov
89%
__ANON__
3.1
__ANON__
2.1
__ANON__
2.0
CRAP 1.9
« Resume/Output/ToPlain.pm ↑ Summary Resume.pm »
1 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Acme::Resume::MoopsParserTrait;
5  
6 # ABSTRACT: Trait for the Moops parser
7 2 our $VERSION = '0.0109';
8  
9 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Module::Runtime qw($module_name_rx);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶around _eat_package => sub {
Subroutine __ANON__: called CC=2 SCAR=7.0
13 1 my $next = shift;
14 1 my $self = shift;
15 1 my ($rel) = @_;
16  
17 1 my $pkg = $self->_eat(qr{(?:::)?$module_name_rx});
18  
19 1 ▶ if($pkg !~ m{::}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($pkg =~ /::/) 1 0 1
20 1 $pkg = 'Acme::Resume::For::' . $pkg;
21 }
22  
23 1 return $self->qualify_module_name($pkg, $rel);
24  
25 2 };
26  
27 1 ▶after parse => sub {
Subroutine __ANON__: called CC=3 SCAR=11.4
28 1 my $self = shift;
29  
30 1 ▶ if($self->keyword eq 'resume') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->keyword eq "resume") 1 0 1
31 1 ▶ push @{ $self->relations->{'with'} ||= [] } => (
Condition50%1/2
$self->relations->{"with"} ||= []
l!l
01
MC/DC0%0/1
$self->relations->{"with"} ||= []
$self->relations->{"with"}
Truth table50%1/2
A
A= $self->relations->{"with"}
Aresult
11
00
32 'Acme::Resume::Output::ToPlain',
33 );
34 }
35 2 };
36  
37 2 ▶around keywords => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
38 2 my $next = shift;
39 2 my $self = shift;
40  
41 2 my @all = ('resume', $self->$next(@_));
42 2 return @all;
43 2 };
44  
45 1 ▶around class_for_keyword => sub {
Subroutine __ANON__: called CC=2 SCAR=7.2
46 1 my $next = shift;
47 1 my $self = shift;
48  
49 1 ▶ if($self->keyword eq 'resume') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->keyword eq "resume") 1 0 1
50 1 require Moops::Keyword::Class;
51 1 return 'Moops::Keyword::Class';
52 }
53  
54 0 return $self->$next(@_);
55 2 };
56  
57 2 1;
58  
59 __END__
« Resume/Output/ToPlain.pm ↑ Summary Resume.pm »