Circle/Widget/Scroller.pm

filter: Statementstmt 100% 22 / 22 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 90.3% 28 / 31 CC 2 SCAR 2.9
CC
2
Cov
96%
push_event
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Circle.pm ↑ Summary 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 4 ▶use base qw( Circle::Widget );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 our $VERSION = '0.173320';
12  
13 sub new
14 4 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
15 4 my $class = shift;
16 4 my %args = @_;
17  
18 4 my $self = $class->SUPER::new( @_ );
19  
20 4 $self->{scrollback} = $args{scrollback};
21  
22 4 return $self;
23 }
24  
25 sub push_event
26 8 ▶{
Subroutine push_event: called CC=2 SCAR=7.0
Pod undocumented
27 8 my $self = shift;
28 8 my ( $event, $time, $args ) = @_;
29  
30 8 my $eventqueue = $self->get_prop_displayevents;
31  
32 8 my $overcount = @$eventqueue + 1 - $self->{scrollback};
33  
34 8 ▶ $self->shift_prop_displayevents( $overcount ) if $overcount > 0;
Branch: 1 branch
BranchTrueFalseTotal
if $overcount > 0 0 8 8
35  
36 8 $self->push_prop_displayevents( [ $event, $time, $args ] );
37 }
38  
39 4 0x55AA;
« Circle.pm ↑ Summary Circle/Widget/Label.pm »