blib/lib/perl5i/1/HASH.pm

filter: Statementstmt 40.0% 10 / 25 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 4 totaltotal 30.9% 13 / 42 SCAR 21.9
CC
4
Cov
32%
flip
12.0
merge
6.0
print
2.0
CRAP 9.0
« blib/lib/perl5i/2/Signature.pm ↑ Summary Build »
1 # vi: set ts=4 sw=4 ht=4 et :
2 package perl5i::1::HASH;
3 1 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 require Carp;
8  
9 sub flip {
10 Carp::croak("Can't flip hash with references as values")
11 0 ▶ if grep { ref } values %{$_[0]};
Subroutine flip: not called CC=3 SCAR=24.8
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
if grep {ref $_;} values %{$_[0];} 0 0 0
12  
13 0 my %flipped = reverse %{$_[0]};
14  
15 0 ▶ return wantarray ? %flipped : \%flipped;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
16 }
17  
18 sub merge {
19 0 ▶ require Hash::Merge::Simple;
Subroutine merge: not called CC=2 SCAR=17.9
Pod undocumented
20 0 my $merged = Hash::Merge::Simple::merge(@_);
21  
22 0 ▶ return wantarray ? %$merged : $merged;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
23 }
24  
25 sub print {
26 0 ▶ my $hash = shift;
Subroutine print: not called CC=1 SCAR=6.9
Pod undocumented
27 0 print join(" ", map { "$_ => $hash->{$_}" } keys %$hash);
28 }
29  
30 sub say {
31 0 ▶ my $hash = shift;
Subroutine say: not called CC=1 SCAR=6.9
Pod undocumented
32 0 print join(" ", map { "$_ => $hash->{$_}" } keys %$hash), "\n";
33 }
34  
35 1 1;
« blib/lib/perl5i/2/Signature.pm ↑ Summary Build »