blib/lib/AudioFile/Info/MP3/Info.pm

filter: Statementstmt 100% 26 / 26 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 94.5% 35 / 37 CC 2 SCAR 2.0
CC
2
Cov
96%
AUTOLOAD
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« lib/AudioFile/Info/Build.pm ↑ Summary
1 =head1 NAME
2  
3 AudioFile::Info::MP3::Info - Perl extension to get info from MP3 files.
4  
5 =head1 DESCRIPTION
6  
7 This is a plugin for AudioFile::Info which uses MP3::Info to get
8 data about MP3 files.
9  
10 See L<AudioFile::Info> for more details.
11  
12 =cut
13  
14 package AudioFile::Info::MP3::Info;
15  
16 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 2 ▶use MP3::Info;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 2 our $VERSION = '1.5.1';
24  
25 2 my %data = (artist => 'ARTIST',
26 title => 'TITLE',
27 album => 'ALBUM',
28 track => 'TRACKNUM',
29 year => 'YEAR',
30 genre => 'GENRE');
31  
32 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
33 1 my $class = shift;
34 1 my $file = shift;
35 1 my $obj = MP3::Info->new($file);
36  
37 1 bless { obj => $obj }, $class;
38 }
39  
40 0 ▶sub DESTROY {}
Subroutine DESTROY: not called CC=1 SCAR=0.0
41  
42 6 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=2 SCAR=7.0
43 6 my $self = shift;
44  
45 6 our $AUTOLOAD;
46  
47 6 my ($pkg, $sub) = $AUTOLOAD =~ /(.+)::(\w+)/;
48  
49 6 ▶ die "Invalid attribute $sub" unless exists $data{$sub};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $data{$sub} 0 6 6
50  
51 6 return $self->{obj}->{$data{$sub}};
52 }
53  
54  
55 2 1;
56 __END__
« lib/AudioFile/Info/Build.pm ↑ Summary