Expander/Guess/FileName.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 4 / 4 Conditioncond 80.0% 4 / 5 MC/DCmcdc 66.6% 2 / 3 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 93.1% 41 / 44 CC 5 SCAR 11.0
CC
5
Cov
97%
type
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Expander/Plugin/ApplicationGzip.pm ↑ Summary Expander/Plugin/ApplicationTar.pm »
1 package MIME::Expander::Guess::FileName;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 $VERSION = '0.02';
7  
8 3 ▶use base qw(MIME::Expander::Guess);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use MIME::Type::FileName;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 9 ▶sub type {
Subroutine type: called CC=5 SCAR=16.1
Pod undocumented
12 9 my $class = shift;
13 9 my $ref_contents = shift;
14 9 ▶ my $info = shift || {};
Condition100%2/2
shift() || {}
l!l
81
MC/DC100%1/1
shift() || {}
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
15 9 my $name = $info->{filename};
16  
17 9 ▶ return undef unless( defined $name );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $name 2 7 9
18  
19 7 my $mime = MIME::Type::FileName::guess($name);
20  
21 7 ▶ return undef if( $mime and $mime eq 'application/octet-stream' );
Branch: 1 branch
BranchTrueFalseTotal
if $mime and $mime eq "application/octet-stream" 1 6 7
Condition66%2/3
$mime and $mime eq "application/octet-stream"
!ll&&!rl&&r
061
MC/DC50%1/2
$mime and $mime eq "application/octet-stream"
$mime $mime eq "application/octet-stream"
Truth table66%2/3
A and B
A= $mimeB= $mime eq "application/octet-stream"
ABresult
0X0
100
111
22  
23 6 return $mime;
24 }
25  
26 3 1;
27 __END__
« Expander/Plugin/ApplicationGzip.pm ↑ Summary Expander/Plugin/ApplicationTar.pm »