blib/lib/Data/PowerSet/Hash.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 CC 2 SCAR 2.9
CC
2
Cov
100%
hash_powerset
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
↑ Summary
1 package Data::PowerSet::Hash;
2 {
3 2 $Data::PowerSet::Hash::VERSION = '0.04';
4 }
5 # ABSTRACT: Power sets of hashes
6  
7 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use parent 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Data::PowerSet 'powerset';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 our @EXPORT_OK = 'hash_powerset';
13  
14 4 ▶sub hash_powerset {
Subroutine hash_powerset: called CC=2 SCAR=6.9
Pod documented
15 4 my %hash = @_;
16 4 my @pset = ();
17 4 my $pset = powerset( keys %hash );
18  
19 4 foreach my $combo ( @{$pset} ) {
20 push @pset, {
21 8 map +( $_ => $hash{$_} ), @{$combo}
22 };
23 }
24  
25 4 return @pset;
26 }
27  
28 2 1;
29  
30 __END__
↑ Summary