BeCool.pm

filter: Statementstmt 88.2% 15 / 17 Branchbran 33.3% 2 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 76.0% 19 / 25 CC 5 SCAR 16.6
CC
5
Cov
74%
import
6.1
BEGIN
1.0
CRAP 5.2
↑ Summary example.pm »
1 package Acme::BeCool;
2  
3 =head1 NAME
4  
5 Acme::BeCool -- Make your modules use the modules that get you some.
6  
7 =head1 SYNOPSIS
8  
9 use Acme::BeCool; # Wakka-chikka, wakka-chikka...
10  
11 # Whatever you write here will get play.
12  
13 or
14  
15 use Acme::BeCool qw(This That And The::Other); # I *define* cool.
16 # really?
17  
18 =cut
19  
20 # This improves my Kwalitee?
21 1 q#
22 use strict;
23 use warnings;
24 #;
25  
26 1 $VERSION = '0.02';
27  
28 1 ▶use LWP::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 sub import
31 1 ▶{
Subroutine import: called CC=5 SCAR=18.1
32 1 shift;
33 1 ▶ if (!@_) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@_) 1 0 1
34 1 my $page = get 'http://search.cpan.org/search?query=cool&mode=all';
35 1 ▶ push @_, $1 while $page =~ m!<h2.*?<b>(.*?)</b></a></h2>!g;
Branch: 1 branch
BranchTrueFalseTotal
$page =~ m[<h2.*?<b>(.*?)</b></a></h2>]g and do { push @_, $1 } 0 1 1
36 }
37 1 @_ = grep !/\//, @_;
38 1 my $caller = shift;
39 1 my $cool = 0;
40 1 for (@_) {
41 0 eval "require $_";
42 0 ▶ $caller->import($_) unless $@;
Branch: 1 branch
BranchTrueFalseTotal
unless $@ 0 0 0
43 }
44 1 print STDERR "You are ", ($cool / @_), "\% cool\n";
45 }
46  
47 1 1;
48 __END__
↑ Summary example.pm »