OO/Plugin/Expand/BabelFish/Loc.pm

filter: Statementstmt 76.9% 30 / 39 Branchbran 33.3% 6 / 18 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 9 / 12 Podpod 100% 2 / 2 totaltotal 66.2% 47 / 71 CC 10 SCAR 22.4
CC
10
Cov
63%
loc_bp
30.0
__ANON__
6.0
loc_b
5.1
CRAP 9.4
« OO/FunctionalInterface.pm ↑ Summary OO/Lexicon/Hash.pm »
1 package Locale::TextDomain::OO::Plugin::Expand::BabelFish::Loc; ## no critic (TidyCode)
2
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Locale::Utils::PlaceholderBabelFish;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 2 our $VERSION = '1.027';
9
10 2 requires qw(
11 translate
12 filter
13 run_filter
14 );
15
16 has expand_babel_fish_loc => (
17 is => 'rw',
18 1 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
19 1 return Locale::Utils::PlaceholderBabelFish->new;
20 },
21 2 );
22
23 4 ▶sub loc_b {
Subroutine loc_b: called CC=5 SCAR=16.2
Pod documented
24 4 my ($self, $msgid, @args) = @_;
25
26 my $translation = $self->translate(
27 undef,
28 $msgid,
29 undef,
30 undef,
31 undef,
32 4 ▶ sub { $self->expand_babel_fish_loc->plural_code(shift) },
Subroutine __ANON__: called CC=1 SCAR=0.0
33 4 );
34 @args and $translation = $self->expand_babel_fish_loc->expand_babel_fish(
35 $translation,
36 @args == 1
37 4 ▶ ? ( ref $args[0] eq 'HASH' ? %{ $args[0] } : $args[0] )
Branch: 3 branches
BranchTrueFalseTotal
@args and $translation = $self->expand_babel_fish_loc->expand_babel_fish($translation, @args == 1 ? ref $args[0] eq "HASH" ? %{$args[0];} : $args[0] : @args) 4 0 4
@args == 1 ? : 3 1 4
ref $args[0] eq 'HASH' ? : 2 1 3
38 : @args,
39 );
40 4 ▶ $self->filter
Branch: 1 branch
BranchTrueFalseTotal
$self->filter and $self->run_filter(\$translation) 0 4 4
41 and $self->run_filter(\$translation);
42
43 4 return $translation;
44 }
45
46 0 ▶sub loc_bp {
Subroutine loc_bp: not called CC=5 SCAR=34.0
Pod documented
47 0 my ($self, $msgctxt, $msgid, @args) = @_;
48
49 my $translation = $self->translate(
50 $msgctxt,
51 $msgid,
52 undef,
53 undef,
54 undef,
55 0 ▶ sub { $self->expand_babel_fish_loc->plural_code(shift) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
56 0 );
57 @args and $translation = $self->expand_babel_fish_loc->expand_babel_fish(
58 $translation,
59 @args == 1
60 0 ▶ ? ( ref $args[0] eq 'HASH' ? %{ $args[0] } : $args[0] )
Branch: 3 branches
BranchTrueFalseTotal
@args and $translation = $self->expand_babel_fish_loc->expand_babel_fish($translation, @args == 1 ? ref $args[0] eq "HASH" ? %{$args[0];} : $args[0] : @args) 0 0 0
@args == 1 ? : 0 0 0
ref $args[0] eq 'HASH' ? : 0 0 0
61 : @args,
62 );
63 0 ▶ $self->filter
Branch: 1 branch
BranchTrueFalseTotal
$self->filter and $self->run_filter(\$translation) 0 0 0
64 and $self->run_filter(\$translation);
65
66 0 return $translation;
67 }
68
69 2 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.6
70 # Dummy methods for string marking.
71 0 ▶ my $dummy = sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
72 0 my (undef, @more) = @_;
73 0 ▶ return wantarray ? @more : $more[0];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
74 2 };
75 2 ▶ no warnings qw(redefine); ## no critic (NoWarnings)
Subroutine BEGIN: called CC=1 SCAR=0.0
76 2 *Nloc_b = $dummy;
77 2 *Nloc_bp = $dummy;
78 }
79
80 2 1;
81
82 __END__
« OO/FunctionalInterface.pm ↑ Summary OO/Lexicon/Hash.pm »