- if ( $cgi->param('mode') eq 'report' ) {
- # In theory, a package can belong to any subset of the report classes,
- # so the report groups should be all the _subsets_, but for now we're
- # handling the simple case where each package belongs to one report
- # class. Packages with multiple classes will go into one bin at the
- # end.
- push @classnames, '(multiple classes)';
- push @classnums, 'multiple';
+ if ( $cgi->param('class_mode') eq 'report' ) {
+ # The new way:
+ # Actually break down all subsets of the (selected) report classes.
+ my $powerset = sub {
+ my @set = [];
+ foreach my $x (@_) {
+ @set = map { $_, [ @$_, $x ] } @set;
+ }
+ @set;
+ };
+ @classnums = $powerset->(@classnums);
+ @classnames = $powerset->(@classnames);
+ # this is pairwise complementary to @classnums, because math
+ @not_classnums = reverse(@classnums);
+warn Dumper(\@classnums, \@classnames, \@not_classnums);
+ # remove the null set
+ shift @classnums;
+ shift @classnames;
+ shift @not_classnums;