lib/URI/Title/PDF.pm

filter: Statementstmt 31.0% 9 / 29 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 2 totaltotal 21.0% 12 / 57 SCAR 41.4
CC
10
Cov
19%
title
110.0
BEGIN
1.0
BEGIN
1.0
CRAP 62.9
« lib/URI/Title/MP3.pm ↑ Summary blib/lib/URI/Title/MP3.pm »
1 package URI::Title::PDF;
2 3 $URI::Title::PDF::VERSION = '1.902';
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 sub types {(
7 2 ▶ 'application/pdf',
Subroutine types: called CC=1 SCAR=0.0
Pod undocumented
8 )}
9  
10 sub title {
11 0 ▶ my ($class, $url, $data, $type) = @_;
Subroutine title: not called CC=10 SCAR=47.0
Pod undocumented
12  
13 0 my %fields = ();
14 0 ▶ my $content = URI::Title::_get_end($url) or return;
Branch: 1 branch
BranchTrueFalseTotal
my $content = URI::Title::_get_end($url) or return 0 0 0
15 0 foreach my $i (qw(Producer Creator CreationDate Author Title Subject)) {
16 0 my @parts = $content =~ m#/$i \((.*?)\)#mgs;
17 0 $fields{$i} = $parts[-1]; # grab the last one, hopefully right
18 }
19  
20 0 my $title = "";
21 0 my @parts = ();
22 0 ▶ if ($fields{Title}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fields{"Title"}) 0 0 0
23 0 push @parts, "$fields{Title}";
24 0 ▶ if ($fields{Author}) { push @parts, "by $fields{Author}"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($fields{"Author"}) 0 0 0
25 0 ▶ if ($fields{Subject}) { push @parts, "($fields{Subject})"; }
Branch: 1 branch
BranchTrueFalseTotal
if ($fields{"Subject"}) 0 0 0
26 }
27 0 ▶ if ($fields{Creator} and $fields{Creator} ne 'Not Available') {
Branch: 1 branch
BranchTrueFalseTotal
if ($fields{"Creator"} and $fields{"Creator"} ne "Not Available") 0 0 0
Condition0%0/3
$fields{"Creator"} and $fields{"Creator"} ne "Not Available"
!ll&&!rl&&r
000
MC/DC0%0/2
$fields{"Creator"} and $fields{"Creator"} ne "Not Available"
$fields{"Creator"} $fields{"Creator"} ne "Not Available"
Truth table0%0/3
A and B
A= $fields{"Creator"}B= $fields{"Creator"} ne "Not Available"
ABresult
0X0
100
111
28 0 push @parts, "creator: $fields{Creator}";
29 }
30 0 ▶ if ($fields{Producer} and $fields{Producer} ne 'Not Available') {
Branch: 1 branch
BranchTrueFalseTotal
if ($fields{"Producer"} and $fields{"Producer"} ne "Not Available") 0 0 0
Condition0%0/3
$fields{"Producer"} and $fields{"Producer"} ne "Not Available"
!ll&&!rl&&r
000
MC/DC0%0/2
$fields{"Producer"} and $fields{"Producer"} ne "Not Available"
$fields{"Producer"} $fields{"Producer"} ne "Not Available"
Truth table0%0/3
A and B
A= $fields{"Producer"}B= $fields{"Producer"} ne "Not Available"
ABresult
0X0
100
111
31 0 push @parts, "produced: $fields{Producer}";
32 }
33 0 $title = join(' ', @parts);
34 0 return $title;
35 }
36  
37 3 1;
38  
39 __END__
« lib/URI/Title/MP3.pm ↑ Summary blib/lib/URI/Title/MP3.pm »