# barbie/cpan-testers-www-statistics

Fetching contributors…
Cannot retrieve contributors at this time
1906 lines (1499 sloc) 65.2 KB
OS/Perl' . join( "", @\$vers ) . 'OS/Perl
Totals' . join( '', map {\$totals{perl}{\$_}||0} @\$vers ) . 'Totals
' . \$osname . '' . \$totals{os}{\$osname} . '} . (\$count ? qq|\$count
\$self->{osname}{\$osname}{\$perl}{\$type}| : '-') . '
' . \$totals{os}{\$osname} . '' . \$osname . '
Totals' . join( '', map {\$totals{perl}{\$_}||0} @\$vers ) . 'Totals
OS/Perl' . join( "", @\$vers ) . 'OS/Perl
' . "\n" . ''; for my \$osname (sort {\$totals{os}{\$b} <=> \$totals{os}{\$a}} keys %{\$totals{os}}) { if(\$type eq 'month') { my \$check = 0; for my \$perl (@\$vers) { \$check++ if(defined \$self->{osys}{\$osname}{\$perl}{\$type}) } next if(\$check == 0); } \$content .= "\n" . ''; for my \$perl (@\$vers) { my \$count = defined \$self->{osys}{\$osname}{\$perl}{\$type} ? scalar(keys %{\$self->{osys}{\$osname}{\$perl}{\$type}}) : 0; if(\$count) { if(\$self->{list}{osname}{\$osname}{\$perl}{\$type}) { \$index = \$self->{list}{osname}{\$osname}{\$perl}{\$type}; } else { my %tvars = (template => 'distlist', OS => 1, MONTH => (\$type eq 'month' ? 1 : 0), FULL => \$full); my @list = sort keys %{\$self->{osys}{\$osname}{\$perl}{\$type}}; \$tvars{dists} = \@list; \$tvars{vplatform} = \$osname; \$tvars{vperl} = \$perl; \$tvars{count} = \$count; \$index = join('-','osys', \$type, \$osname, \$perl); \$index =~ s/[^-.\w]/-/g; \$index = 'matrix/' . \$index; \$self->{list}{osname}{\$osname}{\$perl}{\$type} = \$index; \$self->_writepage(\$index,\%tvars); } } my \$number = \$self->{osname}{\$osname}{\$perl}{\$type} || 0; my \$class = 'none'; \$class = 'some' if(\$number > 0); \$class = 'more' if(\$number > \$matrix_limits{\$type}->[0]); \$class = 'lots' if(\$number > \$matrix_limits{\$type}->[1]); \$content .= qq{'; } \$content .= ''; \$content .= ''; } \$content .= "\n" . '' . "\n" . '' . "\n" . ''; return \$content; } sub _build_platform_matrix { my \$self = shift; my %tvars = (template => 'pmatrix', FULL => 1, MONTH => 0); \$self->{parent}->_log("building platform matrix - 1"); my \$CONTENT = \$self->_platform_matrix(\$self->{versions},'all',1); \$tvars{CONTENT} = \$CONTENT; \$self->_writepage('pmatrix-full',\%tvars); %tvars = (template => 'pmatrix', FULL => 1, MONTH => 0, layout => 'layout-wide'); \$tvars{CONTENT} = \$CONTENT; \$self->{parent}->_log("building platform matrix - 2"); \$self->_writepage('pmatrix-full-wide',\%tvars); %tvars = (template => 'pmatrix', FULL => 1, MONTH => 1); \$self->{parent}->_log("building platform matrix - 3"); \$CONTENT = \$self->_platform_matrix(\$self->{versions},'month',1); \$tvars{CONTENT} = \$CONTENT; \$self->_writepage('pmatrix-full-month',\%tvars); %tvars = (template => 'pmatrix', FULL => 1, MONTH => 1, layout => 'layout-wide'); \$tvars{CONTENT} = \$CONTENT; \$self->{parent}->_log("building platform matrix - 4"); \$self->_writepage('pmatrix-full-month-wide',\%tvars); my @vers = grep {!/^5\.(11|9|7)\./} @{\$self->{versions}}; %tvars = (template => 'pmatrix', FULL => 0, MONTH => 0); \$self->{parent}->_log("building platform matrix - 5"); \$CONTENT = \$self->_platform_matrix(\@vers,'all',0); \$tvars{CONTENT} = \$CONTENT; \$self->_writepage('pmatrix',\%tvars); %tvars = (template => 'pmatrix', FULL => 0, MONTH => 0, layout => 'layout-wide'); \$tvars{CONTENT} = \$CONTENT; \$self->{parent}->_log("building platform matrix - 6"); \$self->_writepage('pmatrix-wide',\%tvars); %tvars = (template => 'pmatrix', FULL => 0, MONTH => 1); \$self->{parent}->_log("building platform matrix - 7"); \$CONTENT = \$self->_platform_matrix(\@vers,'month',0); \$tvars{CONTENT} = \$CONTENT; \$self->_writepage('pmatrix-month',\%tvars); %tvars = (template => 'pmatrix', FULL => 0, MONTH => 1, layout => 'layout-wide'); \$tvars{CONTENT} = \$CONTENT; \$self->{parent}->_log("building platform matrix - 8"); \$self->_writepage('pmatrix-month-wide',\%tvars); } sub _platform_matrix { my \$self = shift; my \$vers = shift or return ''; my \$type = shift; my \$full = shift || 0; return '' unless(@\$vers); my %totals; for my \$platform (sort keys %{\$self->{pass}}) { if(\$type eq 'month') { my \$check = 0; for my \$perl (@\$vers) { \$check++ if(defined \$self->{pass}{\$platform}{\$perl}{\$type}) } next if(\$check == 0); } for my \$perl (@\$vers) { my \$count = defined \$self->{pass}{\$platform}{\$perl}{\$type} ? scalar(keys %{\$self->{pass}{\$platform}{\$perl}{\$type}}) : 0; \$totals{platform}{\$platform} += \$count; \$totals{perl}{\$perl} += \$count; } } my \$index = 0; my \$content = "\n" . '' . "\n" . '
Platform/Perl' . join( "", @\$vers ) . 'Platform/Perl
Totals' . join( '', map {\$totals{perl}{\$_}||0} @\$vers ) . 'Totals
' . \$platform . '' . \$totals{platform}{\$platform} . '} . (\$count ? qq|\$count
\$self->{platform}{\$platform}{\$perl}{\$type}| : '-') . '
' . \$totals{platform}{\$platform} . '' . \$platform . '
Totals' . join( '', map {\$totals{perl}{\$_}||0} @\$vers ) . 'Totals
Platform/Perl' . join( "", @\$vers ) . 'Platform/Perl