CmdDispatch/IO.pm

filter: Statementstmt 53.1% 17 / 32 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 36.3% 4 / 11 Podpod 100% 4 / 4 totaltotal 51.9% 27 / 52 CC 2 SCAR 5.6
CC
2
Cov
54%
new
2.0
print
2.0
readline
2.0
CRAP 1.8
« CmdDispatch/Table.pm ↑ Summary CmdDispatch/Exception.pm »
1 package App::CmdDispatch::IO;
2  
3 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 11 ▶use Term::ReadLine;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 11 our $VERSION = '0.44';
8  
9 11 my $term;
10 sub new
11 4 ▶{
Subroutine new: called CC=2 SCAR=7.0
Pod documented
12 4 my ($class) = @_;
13 4 ▶ $term ||= Term::ReadLine->new('CmdDispatch Shell');
Condition66%2/3
$term ||= "Term::ReadLine"->new("CmdDispatch Shell")
l!l&&r!l&&!r
310
MC/DC0%0/2
$term ||= "Term::ReadLine"->new("CmdDispatch Shell")
$term "Term::ReadLine"->new("CmdDispatch Shell")
Truth table66%2/3
A ||= B
A= $termB= "Term::ReadLine"->new("CmdDispatch Shell")
ABresult
1X1
011
000
14 4 $term->ornaments( 0 );
15 4 return bless { term => $term }, $class;
16 }
17  
18 sub print
19 0 ▶{
Subroutine print: not called CC=1 SCAR=6.9
Pod documented
20 0 my $self = shift;
21 0 return CORE::print @_;
22 }
23  
24 sub readline
25 0 ▶{
Subroutine readline: not called CC=1 SCAR=6.9
Pod documented
26 0 my ($self) = @_;
27 0 return $self->{term}->readline( '' );
28 }
29  
30 sub prompt
31 0 ▶{
Subroutine prompt: not called CC=1 SCAR=6.9
Pod documented
32 0 my ($self, @in) = @_;
33 0 return $self->{term}->readline( @in );
34 }
35  
36 {
37 package App::CmdDispatch::MinimalIO;
38  
39 sub new
40 0 ▶ {
Subroutine new: not called CC=1 SCAR=6.9
41 0 my ($class) = @_;
42 0 return bless {}, $class;
43 }
44  
45 sub print
46 0 ▶ {
Subroutine print: not called CC=1 SCAR=6.9
47 0 my $self = shift;
48 0 return CORE::print @_;
49 }
50  
51 sub readline
52 0 ▶ {
Subroutine readline: not called CC=1 SCAR=6.9
53 0 my ($self) = @_;
54 0 return CORE::readline;
55 }
56  
57 sub prompt
58 0 ▶ {
Subroutine prompt: not called CC=1 SCAR=6.9
59 0 my ($self, @in) = @_;
60 0 $self->print( @in );
61 0 return $self->readline();
62 }
63 }
64 11 1;
65 __END__
« CmdDispatch/Table.pm ↑ Summary CmdDispatch/Exception.pm »