Log/Report/Translator.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 85.7% 6 / 7 Podpod 75.0% 3 / 4 totaltotal 91.6% 33 / 36 CC 3 SCAR 5.8
CC
3
Cov
96%
translate
3.0
load
2.0
BEGIN
1.0
CRAP 1.8
« MojoX/Log/Report.pm ↑ Summary Log/Report/Dispatcher/Perl.pm »
1 # This code is part of Perl distribution Log-Report version 1.46.
2 # The POD got stripped from this file by OODoc version 3.06.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2007-2026 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11  
12 package Log::Report::Translator;{
13 17 our $VERSION = '1.46';
14 }
15  
16  
17 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 17 ▶use Log::Report 'log-report', import => [ ];
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 #--------------------
23  
24 12 ▶sub new(@) { my $class = shift; (bless {}, $class)->init({@_}) }
Subroutine new: called CC=1 SCAR=0.0
Pod documented
25 12 ▶sub init($) { $_[0] }
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
26  
27 #--------------------
28  
29 #--------------------
30  
31 # this is called as last resort: if a translator cannot find
32 # any lexicon or has no matching language.
33 sub translate($$$)
34 100 ▶{ my $msg = $_[1];
Subroutine translate: called CC=3 SCAR=11.0
Pod documented
35 100 ▶ defined $msg->{_count} && $msg->{_count} != 1 ? $msg->{_plural} : $msg->{_msgid};
Branch: 1 branch
BranchTrueFalseTotal
defined $msg->{'_count'} && $msg->{'_count'} != 1 ? : 11 89 100
Condition100%3/3
defined $msg->{"_count"} and $msg->{"_count"} != 1
!ll&&!rl&&r
82711
MC/DC100%2/2
defined $msg->{"_count"} and $msg->{"_count"} != 1
defined $msg->{"_count"} $msg->{"_count"} != 1
Truth table100%3/3
A and B
A= defined $msg->{"_count"}B= $msg->{"_count"} != 1
ABresult
0X0
100
111
36 }
37  
38  
39 0 ▶sub load($@) { undef }
Subroutine load: not called CC=1 SCAR=6.9
Pod documented
40  
41 17 1;
« MojoX/Log/Report.pm ↑ Summary Log/Report/Dispatcher/Perl.pm »