Fluent/Elements.pm

filter: Statementstmt 95.1% 79 / 83 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 24 / 24 Podpod 100% 1 / 1 totaltotal 92.1% 105 / 114 CC 4 SCAR 5.3
CC
4
Cov
90%
create
5.7
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Fluent/Elements/CallArguments.pm ↑ Summary Fluent/Elements/PatternElement.pm »
1 package Translate::Fluent::Elements;
2  
3 6 ▶use Translate::Fluent::Elements::Message;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use Translate::Fluent::Elements::Pattern;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use Translate::Fluent::Elements::PatternElement;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use Translate::Fluent::Elements::InlinePlaceable;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use Translate::Fluent::Elements::InlineText;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use Translate::Fluent::Elements::InlineExpression;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Translate::Fluent::Elements::BlockText;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 6 ▶use Translate::Fluent::Elements::BlockPlaceable;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 6 ▶use Translate::Fluent::Elements::FunctionReference;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 6 ▶use Translate::Fluent::Elements::VariableReference;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 6 ▶use Translate::Fluent::Elements::CallArguments;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 6 ▶use Translate::Fluent::Elements::ArgumentList;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 6 ▶use Translate::Fluent::Elements::Argument;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 6 ▶use Translate::Fluent::Elements::NamedArgument;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 6 ▶use Translate::Fluent::Elements::MessageReference;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 6 ▶use Translate::Fluent::Elements::TermReference;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 6 ▶use Translate::Fluent::Elements::AttributeAccessor;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 6 ▶use Translate::Fluent::Elements::StringLiteral;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 6 ▶use Translate::Fluent::Elements::Term;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 6 ▶use Translate::Fluent::Elements::SelectExpression;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 6 ▶use Translate::Fluent::Elements::Variant;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 6 ▶use Translate::Fluent::Elements::DefaultVariant;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 6 ▶use Translate::Fluent::Elements::Attribute;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 708 ▶sub create {
Subroutine create: called CC=4 SCAR=17.4
Pod documented
28 708 my (undef, $type, $args) = @_;
29  
30 708 $type = "\u$type";
31 708 $type =~ s/_(.)/\u$1/g;
32  
33 708 my $class = "Translate::Fluent::Elements::$type";
34  
35 708 my $res;
36 eval {
37 708 $res = $class->new( %$args );
38  
39 708 1;
40 708 ▶ } or do {
Branch: 1 branch
BranchTrueFalseTotal
eval { do { $res = $class->new(%$args); 1 } } or do { my($err) = $@; print STDERR "err: $err\n" unless $err =~ /Can't locate object method "new"/; unless ($type eq "Text") { print STDERR "FLT: Missing $class\n"; } } 708 0 708
41 0 my ($err) = $@;
42 0 ▶ print STDERR "err: $err\n"
Branch: 1 branch
BranchTrueFalseTotal
unless $err =~ /Can't locate object method "new"/ 0 0 0
43 unless $err =~ m{Can't locate object method "new"};
44 0 ▶ unless ($type eq 'Text') {
Branch: 1 branch
BranchTrueFalseTotal
unless ($type eq "Text") 0 0 0
45 0 print STDERR "FLT: Missing $class\n";
46 }
47 };
48  
49 708 return $res;
50 }
51  
52 6 1;
53  
54 __END__
« Fluent/Elements/CallArguments.pm ↑ Summary Fluent/Elements/PatternElement.pm »