| 1 | package POE::Filter::IASLog; | ||||||||||||||||||||||||||||
| 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 Parse::IASLog; | ||||||||||||||||||||||||||
|
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.08'; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | sub new { | ||||||||||||||||||||||||||||
| 12 | 1 | ▶ | my $class = shift; | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.5
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | 1 | my %opts = @_; | |||||||||||||||||||||||||||
| 14 | 1 | $opts{lc $_} = delete $opts{$_} for keys %opts; | |||||||||||||||||||||||||||
| 15 | 1 | ▶ | $opts{enumerate} = 1 unless defined $opts{enumerate} and !$opts{enumerate}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $opts{"enumerate"} and not $opts{"enumerate"}
MC/DC0%0/2
defined $opts{"enumerate"} and not $opts{"enumerate"}
defined $opts{"enumerate"}
not $opts{"enumerate"}
Truth table33%1/3
A and not(B)
A= defined $opts{"enumerate"}B= not $opts{"enumerate"}
| |||||||||||||||||||||||||||||
| 16 | 1 | $opts{BUFFER} = []; | |||||||||||||||||||||||||||
| 17 | 1 | $opts{IAS} = Parse::IASLog->new( enumerate => $opts{enumerate} ); | |||||||||||||||||||||||||||
| 18 | 1 | return bless \%opts, $class; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | sub get_one_start { | ||||||||||||||||||||||||||||
| 22 | 2 | ▶ | my ($self, $raw) = @_; | ||||||||||||||||||||||||||
|
Subroutine
get_one_start: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 23 | 2 | push @{ $self->{BUFFER} }, $_ for @$raw; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | sub get_one { | ||||||||||||||||||||||||||||
| 27 | 4 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_one: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 28 | 4 | my $events = []; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 4 | my $event = shift @{ $self->{BUFFER} }; | |||||||||||||||||||||||||||
| 31 | 4 | ▶ | if ( defined $event ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | 2 | my $record = $self->{IAS}->parse($event); | |||||||||||||||||||||||||||
| 33 | 2 | ▶ | push @$events, $record if $record; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | 4 | return $events; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | sub get_pending { | ||||||||||||||||||||||||||||
| 39 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_pending: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 40 | 0 | return $self->{BUFFER}; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | sub put { | ||||||||||||||||||||||||||||
| 44 | 0 | ▶ | return; | ||||||||||||||||||||||||||
|
Subroutine
put: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | sub clone { | ||||||||||||||||||||||||||||
| 48 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
clone: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 49 | 1 | my $nself = { }; | |||||||||||||||||||||||||||
| 50 | 1 | $nself->{$_} = $self->{$_} for keys %{ $self }; | |||||||||||||||||||||||||||
| 51 | 1 | $nself->{BUFFER} = [ ]; | |||||||||||||||||||||||||||
| 52 | 1 | return bless $nself, ref $self; | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 3 | 1; | |||||||||||||||||||||||||||
| 56 | __END__ | ||||||||||||||||||||||||||||