| 1 | package Locale::File::PO::Header::Base; ## no critic (TidyCode) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use Moose; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 5 | our $VERSION = '0.004'; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub default { ## no critic (BuiltinHomonyms) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 86 | ▶ | sub trigger_helper { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trigger_helper: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 86 | my ($self, $arg_ref) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | my ($new, $current, $default) = map { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 258 | ▶ | defined $_ ? $_ : q{}; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 86 | } @{$arg_ref}{ qw(new current default) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 86 | ▶ | if ( ! length $new ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 35 | $new = $default; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 86 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%7/7
defined $arg_ref->{"new"} xor defined $arg_ref->{"current"} or $new ne $current
defined $arg_ref->{"new"} xor defined $arg_ref->{"current"}
MC/DC100%3/3
defined $arg_ref->{"new"} xor defined $arg_ref->{"current"} or $new ne $current
defined $arg_ref->{"new"}
defined $arg_ref->{"current"}
$new ne $current
Truth table83%5/6
A xor B or C
A= defined $arg_ref->{"new"}B= defined $arg_ref->{"current"}C= $new ne $current
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | ( defined $arg_ref->{new} xor defined $arg_ref->{current} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | || $new ne $current | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 44 | my $writer = $arg_ref->{writer}; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 44 | $self->$writer($new); | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 86 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 21 | ▶ | sub header_keys { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
header_keys: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 21 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 21 | return $self->name; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 24 | ▶ | sub format_line { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
format_line: called CC=3 SCAR=11.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 24 | my ($self, $line, %args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 24 | for my $key ( keys %args ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 56 | $line =~ s{ | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | [{] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | \Q$key\E | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | [}] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | } { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | defined $args{$key} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 56 | ▶ | ? $args{$key} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | : q{} | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | }xmsge; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 24 | return $line; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 5 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | # $Id: Utils.pm 602 2011-11-13 13:49:23Z steffenw $ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||