blib/lib/Lingua/RU/Numeric/Declension.pm

filter: Statementstmt 64.7% 11 / 17 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 2 / 3 Podpod 0.0% 0 / 1 totaltotal 40.6% 13 / 32 CC 5 SCAR 30.8
CC
5
Cov
42%
numdecl
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 21.7
↑ Summary
1 package Lingua::RU::Numeric::Declension;
2  
3 1 ▶use vars qw ($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 $VERSION = '1.1';
5  
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 require Exporter;
9 1 our @ISA = qw(Exporter);
10 1 our @EXPORT_OK = qw(numdecl);
11  
12  
13 0 ▶sub numdecl {
Subroutine numdecl: not called CC=5 SCAR=34.0
Pod undocumented
14 0 my ($number, $nominative, $genitive, $plural) = @_;
15  
16 0 ▶ return $plural if $number =~ /1.$/;
Branch: 1 branch
BranchTrueFalseTotal
if $number =~ /1.$/ 0 0 0
17  
18 0 my ($last_digit) = $number =~ /(.)$/;
19  
20 0 ▶ return $nominative if $last_digit == 1;
Branch: 1 branch
BranchTrueFalseTotal
if $last_digit == 1 0 0 0
21 0 ▶ return $genitive if $last_digit > 0 && $last_digit < 5;
Branch: 1 branch
BranchTrueFalseTotal
if $last_digit > 0 and $last_digit < 5 0 0 0
Condition0%0/3
$last_digit > 0 and $last_digit < 5
!ll&&!rl&&r
000
MC/DC0%0/2
$last_digit > 0 and $last_digit < 5
$last_digit > 0 $last_digit < 5
Truth table0%0/3
A and B
A= $last_digit > 0B= $last_digit < 5
ABresult
0X0
100
111
22 0 return $plural;
23 }
24  
25 1 1;
26  
27 __END__
↑ Summary