Signum.pm

filter: Statementstmt 53.1% 25 / 47 Branchbran 0.0% 0 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 37.5% 6 / 16 Podpod n/a totaltotal 44.5% 33 / 74 CC 6 SCAR 11.2
CC
6
Cov
48%
FETCH
6.0
STORE
6.0
EXISTS
6.0
CRAP 3.1
↑ Summary signum.pl »
1 package Acme::Signum;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use vars qw/@SIG %signum @signame/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 require Exporter;
9  
10 1 our @ISA = qw(Exporter);
11  
12 1 our @EXPORT = qw(
13 @SIG
14 );
15  
16 1 our $VERSION = '0.01';
17  
18  
19 1 ▶sub import {
Subroutine import: called CC=3 SCAR=11.0
20 1 tie @SIG => __PACKAGE__;
21 1 my @names = split ' ', $Config{sig_name};
22 1 @signum{@names} = split ' ', $Config{sig_num};
23 1 foreach (@names) {
24 68 ▶ $signame[$signum{$_}]||=$_;
Condition66%2/3
$Acme::Signum::signame[$Acme::Signum::signum{$_}] ||= $_
l!l&&r!l&&!r
3650
MC/DC0%0/2
$Acme::Signum::signame[$Acme::Signum::signum{$_}] ||= $_
$Acme::Signum::signame[$Acme::Signum::signum{$_}] $_
Truth table66%2/3
A ||= B
A= $Acme::Signum::signame[$Acme::Signum::signum{$_}]B= $_
ABresult
1X1
011
000
25 }
26 }
27  
28 0 ▶sub _signame {
Subroutine _signame: not called CC=1 SCAR=6.9
29 0 $signame[$_[0]];
30 }
31  
32 1 ▶sub TIEARRAY {
Subroutine TIEARRAY: called CC=1 SCAR=0.0
33 1 my $cls = shift;
34 1 my $d = undef;
35 1 bless \$d => $cls;
36 }
37  
38 0 ▶sub FETCH {
Subroutine FETCH: not called CC=2 SCAR=17.9
39 0 my $i = pop;
40 0 my $name = _signame($i);
41 0 ▶ unless ($name) { return }
Branch: 1 branch
BranchTrueFalseTotal
unless ($name) 0 0 0
42 0 return $SIG{$name};
43 }
44  
45 0 ▶sub STORE {
Subroutine STORE: not called CC=2 SCAR=17.9
46 0 my ($val, $i) = (pop,pop);
47 0 my $name = _signame($i);
48 0 ▶ unless ($name) { return }
Branch: 1 branch
BranchTrueFalseTotal
unless ($name) 0 0 0
49 0 $SIG{$name} = $val;
50 }
51  
52 0 ▶sub FETCHSIZE {
Subroutine FETCHSIZE: not called CC=1 SCAR=6.9
53 0 scalar @signame;
54 }
55  
56 0 ▶sub STORESIZE { undef }
Subroutine STORESIZE: not called CC=1 SCAR=6.9
57  
58 0 ▶sub EXTEND { undef }
Subroutine EXTEND: not called CC=1 SCAR=6.9
59  
60 0 ▶sub EXISTS {
Subroutine EXISTS: not called CC=2 SCAR=17.9
61 0 my $i = pop;
62 0 my $name = _signame($i);
63 0 ▶ unless ($name) { return 0 }
Branch: 1 branch
BranchTrueFalseTotal
unless ($name) 0 0 0
64 0 return exists $SIG{$name};
65 }
66  
67 0 ▶sub PUSH { undef }
Subroutine PUSH: not called CC=1 SCAR=6.9
68  
69 0 ▶sub CLEAR { undef }
Subroutine CLEAR: not called CC=1 SCAR=6.9
70  
71 0 ▶sub DELETE { undef }
Subroutine DELETE: not called CC=1 SCAR=6.9
72  
73 1 1;
74 __END__
↑ Summary signum.pl »