blib/lib/POE/Filter/LOLCAT.pm

filter: Statementstmt 92.8% 39 / 42 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.8% 9 / 11 Podpod 100% 6 / 6 totaltotal 90.4% 57 / 63 CC 6 SCAR 6.3
CC
6
Cov
91%
get_one
3.0
new
2.0
get_one_start
2.0
CRAP 1.9
↑ Summary
1 package POE::Filter::LOLCAT;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Acme::LOLCAT ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use base qw(POE::Filter);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 $VERSION = '1.10';
10  
11 1 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
12 1 my $class = shift;
13 1 my %opts = @_;
14 1 $opts{lc $_} = delete $opts{$_} for keys %opts;
15 1 $opts{BUFFER} = [];
16 1 return bless \%opts, $class;
17 }
18  
19 2 ▶sub get_one_start {
Subroutine get_one_start: called CC=2 SCAR=6.9
Pod documented
20 2 my ($self, $raw) = @_;
21 2 push @{ $self->{BUFFER} }, $_ for @$raw;
22 }
23  
24 22 ▶sub get_one {
Subroutine get_one: called CC=3 SCAR=11.0
Pod documented
25 22 my $self = shift;
26 22 my $events = [];
27  
28 22 my $event = shift @{ $self->{BUFFER} };
29 22 ▶ if ( defined $event ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $event) 20 2 22
30 20 my $record = Acme::LOLCAT::translate($event);
31 20 ▶ push @$events, $record if $record;
Branch: 1 branch
BranchTrueFalseTotal
if $record 20 0 20
32 }
33 22 return $events;
34 }
35  
36 0 ▶sub get_pending {
Subroutine get_pending: not called CC=1 SCAR=6.9
Pod documented
37 0 my $self = shift;
38 0 return $self->{BUFFER};
39 }
40  
41 0 ▶sub put {
Subroutine put: not called CC=1 SCAR=6.9
Pod documented
42 0 return;
43 }
44  
45 1 ▶sub clone {
Subroutine clone: called CC=2 SCAR=6.9
Pod documented
46 1 my $self = shift;
47 1 my $nself = { };
48 1 $nself->{$_} = $self->{$_} for keys %{ $self };
49 1 $nself->{BUFFER} = [ ];
50 1 return bless $nself, ref $self;
51 }
52  
53 3 1;
54 __END__
↑ Summary