Any/DesktopNotify.pm

filter: Statementstmt 68.1% 15 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 2 totaltotal 60.6% 20 / 33 CC 2 SCAR 8.6
CC
2
Cov
62%
notify
6.0
register
2.0
BEGIN
1.0
CRAP 2.4
« Any/MacGrowl.pm ↑ Summary Any/GrowlGNTP.pm »
1 package Growl::Any::DesktopNotify;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use parent qw(Growl::Any::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Desktop::Notify ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 0 ▶sub register {
Subroutine register: not called CC=1 SCAR=6.9
Pod undocumented
10 0 my ($self, $appname, $events) = @_;
11 0 $self->SUPER::register($appname, $events);
12 0 $self->{instance} = Desktop::Notify->new(
13 "app_name" => $self->appname,
14 );
15 }
16  
17 0 ▶sub notify {
Subroutine notify: not called CC=2 SCAR=17.9
Pod undocumented
18 0 my ($self, $event, $title, $message, $icon) = @_;
19 0 ▶ $icon = $self->icon_file($icon) if defined $icon;
Branch: 1 branch
BranchTrueFalseTotal
if defined $icon 0 0 0
20 my $notify = $self->{instance}->create(
21 0 body => $self->encode($message),
22 summary => $self->encode($title),
23 timeout => 5000,
24 app_icon => $icon,
25 );
26 0 $notify->show();
27 }
28  
29 1;
30 __END__
« Any/MacGrowl.pm ↑ Summary Any/GrowlGNTP.pm »