blib/lib/Lingy.pm

filter: Statementstmt 90.0% 36 / 40 Branchbran 43.7% 7 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 83.3% 5 / 6 totaltotal 78.8% 56 / 71 CC 9 SCAR 9.9
CC
9
Cov
77%
reps
6.0
read
3.1
new
3.1
CRAP 2.7
« blib/lib/Lingy/Test.pm ↑ Summary lib/Lingy/Class.pm »
1 56 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package Lingy;
3 56 our $VERSION = '0.1.19';
4  
5 56 my $rt = 0;
6  
7 56 ▶use constant error_prefix => 'Lingy Error:';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶sub new {
Subroutine new: called CC=3 SCAR=11.2
Pod documented
10 1 ▶ die "Lingy->new() takes no arguments"
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 1 0 1 1
11 unless @_ == 1;
12 1 my ($class) = @_;
13 1 require Lingy::RT;
14 1 my $rt_class = "${class}::RT";
15 1 ▶ $rt_class->init unless $Lingy::RT::OK;
Branch: 1 branch
BranchTrueFalseTotal
unless $Lingy::RT::OK 1 0 1
16 1 return bless {
17 RT => $rt_class,
18 }, $class;
19 }
20  
21 5 ▶sub rep {
Subroutine rep: called CC=2 SCAR=7.0
Pod documented
22 5 ▶ die "Lingy->rep(string) takes one argument"
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 2 0 5 5
23 unless @_ == 2;
24 5 my ($self, $string) = @_;
25 5 local $Lingy::Common::error_prefix = $self->error_prefix;
26 5 my ($ret) = $self->{RT}->rep($string);
27 3 return $ret;
28 }
29  
30 0 ▶sub reps {
Subroutine reps: not called CC=2 SCAR=17.9
Pod undocumented
31 0 ▶ die "Lingy->rep(string) takes one argument"
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 2 0 0 0
32 unless @_ == 2;
33 0 my ($self, $string) = @_;
34 0 local $Lingy::Common::error_prefix = $self->error_prefix;
35 0 return $self->{RT}->rep($string);
36 }
37  
38 1 ▶sub read {
Subroutine read: called CC=3 SCAR=11.3
Pod documented
39 1 ▶ die "Lingy->read(string) takes one argument"
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 2 0 1 1
40 unless @_ == 2;
41 1 my ($self, $string) = @_;
42 1 local $Lingy::Common::error_prefix = $self->error_prefix;
43 1 my (@ret) = $self->{RT}->reader->read_str($string);
44 1 ▶ return wantarray ? @ret : $ret[0];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 1 1
45 }
46  
47 1 ▶sub eval {
Subroutine eval: called CC=2 SCAR=7.0
Pod documented
48 1 ▶ die "Lingy->eval(form) takes one argument"
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 2 0 1 1
49 unless @_ == 2;
50 1 my ($self, $form) = @_;
51 1 local $Lingy::Common::error_prefix = $self->error_prefix;
52 1 $self->{RT}->eval($form);
53 }
54  
55 2 ▶sub print {
Subroutine print: called CC=2 SCAR=7.0
Pod documented
56 2 ▶ die "Lingy->print(form) takes one argument"
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 2 0 2 2
57 unless @_ == 2;
58 2 my ($self, $form) = @_;
59 2 local $Lingy::Common::error_prefix = $self->error_prefix;
60 2 $self->{RT}->printer->pr_str($form);
61 }
62  
63 56 1;
« blib/lib/Lingy/Test.pm ↑ Summary lib/Lingy/Class.pm »