Fluent/Elements/Argument.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 2 / 2 totaltotal 88.2% 30 / 34 CC 4 SCAR 7.7
CC
4
Cov
89%
translate
3.1
__ANON__
2.0
identifier
2.0
CRAP 2.2
« Fluent/Elements/NamedArgument.pm ↑ Summary Fluent/Elements/Term.pm »
1 package Translate::Fluent::Elements::Argument;
2  
3 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 extends 'Translate::Fluent::Elements::Base';
5  
6 has [qw(
7 named_argument
8 inline_expression
9 )] => (
10 is => 'ro',
11 0 ▶ default => sub { undef },
Subroutine __ANON__: not called CC=1 SCAR=6.9
12 6 );
13  
14 28 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
15 28 my ($orig, $class, %args) = @_;
16  
17 28 $args{named_argument} = delete $args{ NamedArgument };
18 28 $args{inline_expression} = delete $args{ InlineExpression };
19  
20 28 $class->$orig( %args );
21 6 };
22  
23 15 ▶sub identifier {
Subroutine identifier: called CC=2 SCAR=6.9
Pod documented
24 15 my ($self) = @_;
25  
26 15 ▶ if ($self->named_argument) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->named_argument) 12 3 15
27 12 return $self->named_argument->identifier;
28 }
29  
30 3 return;
31 }
32  
33 15 ▶sub translate {
Subroutine translate: called CC=3 SCAR=11.3
Pod documented
34 15 my ($self, $variables) = @_;
35  
36 15 ▶ if ($self->named_argument) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->named_argument) { } 12 3 15
elsif ($self->inline_expression) { } 3 0 3
37 12 return $self->named_argument->translate( $variables );
38 } elsif ($self->inline_expression) {
39 3 return $self->inline_expression->translate( $variables );
40 }
41  
42 0 return;
43 }
44  
45  
46 6 1;
47  
48 __END__
« Fluent/Elements/NamedArgument.pm ↑ Summary Fluent/Elements/Term.pm »