Reply/Plugin/FancyPrompt.pm

filter: Statementstmt 46.1% 12 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 66.6% 2 / 3 totaltotal 45.9% 17 / 37 CC 2 SCAR 10.0
CC
2
Cov
43%
loop
6.0
new
2.0
prompt
2.0
CRAP 2.7
« Reply/Plugin/CollapseStack.pm ↑ Summary Reply/Plugin.pm »
1 package Reply::Plugin::FancyPrompt;
2 1 our $AUTHORITY = 'cpan:DOY';
3 1 $Reply::Plugin::FancyPrompt::VERSION = '0.42';
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 # ABSTRACT: provides a more informative prompt
7  
8 1 ▶use base 'Reply::Plugin';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
12 0 my $class = shift;
13 0 my $self = $class->SUPER::new(@_);
14 0 $self->{counter} = 0;
15 0 $self->{prompted} = 0;
16 0 return $self;
17 }
18  
19 0 ▶sub prompt {
Subroutine prompt: not called CC=1 SCAR=6.9
Pod documented
20 0 my $self = shift;
21 0 my ($next) = @_;
22 0 $self->{prompted} = 1;
23 0 return $self->{counter} . $next->();
24 }
25  
26 0 ▶sub loop {
Subroutine loop: not called CC=2 SCAR=17.9
Pod documented
27 0 my $self = shift;
28 0 my ($continue) = @_;
29 0 ▶ $self->{counter}++ if $self->{prompted};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"prompted"} 0 0 0
30 0 $self->{prompted} = 0;
31 0 $continue;
32 }
33  
34 1 1;
35  
36 __END__
« Reply/Plugin/CollapseStack.pm ↑ Summary Reply/Plugin.pm »