line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
46464
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
52
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
72
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Module::Cloud; |
6
|
|
|
|
|
|
|
our $VERSION = '1.100861'; |
7
|
|
|
|
|
|
|
# ABSTRACT: Generates a tag cloud for modules used in given code |
8
|
1
|
|
|
1
|
|
2406
|
use HTML::TagCloud; |
|
1
|
|
|
|
|
2680
|
|
|
1
|
|
|
|
|
173
|
|
9
|
1
|
|
|
1
|
|
1093
|
use File::Find::Rule::MMagic; |
|
1
|
|
|
|
|
41355
|
|
|
1
|
|
|
|
|
15
|
|
10
|
1
|
|
|
1
|
|
1050
|
use Module::ExtractUse; |
|
1
|
|
|
|
|
159727
|
|
|
1
|
|
|
|
|
33
|
|
11
|
1
|
|
|
1
|
|
709
|
use parent 'Class::Accessor::Complex'; |
|
1
|
|
|
|
|
252
|
|
|
1
|
|
|
|
|
4
|
|
12
|
|
|
|
|
|
|
__PACKAGE__ |
13
|
|
|
|
|
|
|
->mk_new |
14
|
|
|
|
|
|
|
->mk_array_accessors('dir'); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get_cloud { |
17
|
1
|
|
|
1
|
1
|
85
|
my $self = shift; |
18
|
1
|
|
|
|
|
3
|
my @text_files; |
19
|
1
|
|
|
|
|
4
|
for my $dir ($self->dir) { |
20
|
28
|
|
|
|
|
64
|
push @text_files, grep { !/\/Makefile.PL$/ } |
|
43
|
|
|
|
|
73
|
|
21
|
43
|
|
|
|
|
266295
|
grep { !/\.t$/ } |
22
|
1
|
|
|
|
|
16
|
grep { !/\/\.svn\// } |
23
|
|
|
|
|
|
|
find(file => magic => [qw(text/* x-system/*)], in => $dir); |
24
|
|
|
|
|
|
|
} |
25
|
1
|
|
|
|
|
16
|
my $extractor = Module::ExtractUse->new; |
26
|
1
|
|
|
|
|
14
|
my %modules; |
27
|
1
|
|
|
|
|
3
|
for my $textfile (@text_files) { |
28
|
27
|
|
|
|
|
110
|
my $used = $extractor->extract_use($textfile); |
29
|
27
|
|
|
|
|
223478
|
$modules{$_}++ for keys %{ $used->{found} }; |
|
27
|
|
|
|
|
234
|
|
30
|
|
|
|
|
|
|
} |
31
|
1
|
|
|
|
|
9
|
my $cloud = HTML::TagCloud->new; |
32
|
1
|
|
|
|
|
18
|
while (my ($module, $count) = each %modules) { |
33
|
10
|
|
|
|
|
119
|
$cloud->add($module, "http://search.cpan.org/search?query=$module", |
34
|
|
|
|
|
|
|
$count); |
35
|
|
|
|
|
|
|
} |
36
|
1
|
|
|
|
|
31
|
$cloud; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |