App/Chart/Gtk2/Ex/WidgetBits.pm

filter: Statementstmt 42.8% 9 / 21 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 30.7% 12 / 39 CC 6 SCAR 33.4
CC
6
Cov
28%
error_bell
42.0
BEGIN
1.0
BEGIN
1.0
CRAP 28.3
« App/Chart/Series/Database.pm ↑ Summary App/Chart/Gtk2/SymlistTreeModel.pm »
1 # Copyright 2007, 2008, 2009, 2010 Kevin Ryde
2  
3 # This file is part of Chart.
4 #
5 # Chart is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 3, or (at your option) any later version.
8 #
9 # Chart is distributed in the hope that it will be useful, but WITHOUT ANY
10 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12 # details.
13 #
14 # You should have received a copy of the GNU General Public License along
15 # with Chart. If not, see <http://www.gnu.org/licenses/>.
16  
17 package App::Chart::Gtk2::Ex::WidgetBits;
18 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 # allowing gtk pre-2.12...
23 #
24 0 ▶sub error_bell {
Subroutine error_bell: not called CC=6 SCAR=37.4
Pod undocumented
25 0 my ($widget) = @_;
26 0 my $display;
27  
28 0 ▶ if (! Gtk2::Widget->can('get_screen')) {
Branch: 1 branch
BranchTrueFalseTotal
unless ("Gtk2::Widget"->can("get_screen")) 0 0 0
29 0 return;
30 }
31  
32 # actually the 2.12 one doesn't beep if the widget has no display
33 0 ▶ if ($widget && $widget->has_screen) {
Branch: 1 branch
BranchTrueFalseTotal
if ($widget and $widget->has_screen) 0 0 0
Condition0%0/3
$widget and $widget->has_screen
!ll&&!rl&&r
000
MC/DC0%0/2
$widget and $widget->has_screen
$widget $widget->has_screen
Truth table0%0/3
A and B
A= $widgetB= $widget->has_screen
ABresult
0X0
100
111
34 0 ▶ if ($widget->can('error_bell')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($widget->can("error_bell")) 0 0 0
35 0 $widget->error_bell;
36 0 return;
37 }
38 0 ▶ if ($widget->can('get_display')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($widget->can("get_display")) 0 0 0
39 0 $display->beep;
40 0 return;
41 }
42 }
43  
44 # Gtk 2.0.x or widget without a screen
45 0 Gtk2::Gdk->beep;
46 }
47  
48 1 1;
49 __END__
« App/Chart/Series/Database.pm ↑ Summary App/Chart/Gtk2/SymlistTreeModel.pm »