blib/lib/Circle/Widget/Scroller.pm

filter: Statementstmt 47.6% 10 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 43.3% 13 / 30 SCAR 10.0
CC
2
Cov
43%
push_event
6.0
new
2.0
BEGIN
1.0
CRAP 2.7
« blib/lib/Circle/Widget.pm ↑ Summary blib/lib/Circle/Widget/Label.pm »
1 # You may distribute under the terms of the GNU General Public License
2 #
3 # (C) Paul Evans, 2008-2014 -- leonerd@leonerd.org.uk
4  
5 package Circle::Widget::Scroller;
6  
7 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 4 ▶use base qw( Circle::Widget );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub new
13 {
14 0 ▶ my $class = shift;
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
15 0 my %args = @_;
16  
17 0 my $self = $class->SUPER::new( @_ );
18  
19 0 $self->{scrollback} = $args{scrollback};
20  
21 0 return $self;
22 }
23  
24 sub push_event
25 {
26 0 ▶ my $self = shift;
Subroutine push_event: not called CC=2 SCAR=17.9
Pod undocumented
27 0 my ( $event, $time, $args ) = @_;
28  
29 0 my $eventqueue = $self->get_prop_displayevents;
30  
31 0 my $overcount = @$eventqueue + 1 - $self->{scrollback};
32  
33 0 ▶ $self->shift_prop_displayevents( $overcount ) if $overcount > 0;
Branch: 1 branch
BranchTrueFalseTotal
if $overcount > 0 0 0 0
34  
35 0 $self->push_prop_displayevents( [ $event, $time, $args ] );
36 }
37  
38 4 0x55AA;
« blib/lib/Circle/Widget.pm ↑ Summary blib/lib/Circle/Widget/Label.pm »