PerlIO/via/PinyinConvert.pm

filter: Statementstmt 89.6% 26 / 29 Branchbran 25.0% 1 / 4 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 3 totaltotal 72.0% 36 / 50 CC 5 SCAR 9.3
CC
5
Cov
78%
FILL
6.0
import
3.1
FLUSH
2.0
CRAP 2.5
« Lingua/ZH/PinyinConvert.pm ↑ Summary
1 package PerlIO::via::PinyinConvert;
2 2 ▶use Lingua::ZH::PinyinConvert qw/convert/;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 our $VERSION = '0.01';
6  
7 2 our $from;
8 2 our $to;
9  
10 2 ▶sub import {
Subroutine import: called CC=3 SCAR=11.4
11 2 shift;
12 2 my %arg = @_;
13 2 ▶ $from = $arg{from} || die "From what?\n";
Condition50%1/2
$arg{'from'} || die("From what?\n")
l!l
20
MC/DC0%0/1
$arg{'from'} || die("From what?\n")
$arg{'from'}
Truth table50%1/2
A
A= $arg{'from'}
Aresult
11
00
14 2 ▶ $to = $arg{to} || die "To what?\n";
Condition50%1/2
$arg{'to'} || die("To what?\n")
l!l
20
MC/DC0%0/1
$arg{'to'} || die("To what?\n")
$arg{'to'}
Truth table50%1/2
A
A= $arg{'to'}
Aresult
11
00
15 }
16  
17 2 ▶sub PUSHED {
Subroutine PUSHED: called CC=1 SCAR=0.0
Pod undocumented
18 2 my ($class,$mode,$fh) = @_;
19 2 my $buf = '';
20 2 return bless \$buf,$class;
21 }
22  
23 0 ▶sub FILL {
Subroutine FILL: not called CC=2 SCAR=17.9
Pod undocumented
24 0 my ($obj,$fh) = @_;
25 0 my $line = <$fh>;
26 0 ▶ return (defined $line) ? convert($from, $to, $line) : undef;
Branch: 1 branch
BranchTrueFalseTotal
defined $line ? : 0 0 0
27 }
28  
29 2 ▶sub WRITE {
Subroutine WRITE: called CC=1 SCAR=0.0
30 2 my ($obj,$buf,$fh) = @_;
31 2 $$obj .= convert($from, $to, $buf);
32 2 return length($buf);
33 }
34  
35 2 ▶sub FLUSH {
Subroutine FLUSH: called CC=2 SCAR=7.0
Pod undocumented
36 2 my ($obj,$fh) = @_;
37 2 ▶ print $fh $$obj or return -1;
Branch: 1 branch
BranchTrueFalseTotal
print $fh $$obj or return -1 2 0 2
38 2 $$obj = '';
39 2 return 0;
40 }
41  
42 2 1;
43 __END__
« Lingua/ZH/PinyinConvert.pm ↑ Summary