| 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() || {}
MC/DC100%1/1
shift() || {}
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||
| 15 | 9 | my $name = $info->{filename}; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 9 | ▶ | return undef unless( defined $name ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 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
Condition66%2/3
$mime and $mime eq "application/octet-stream"
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"
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 6 | return $mime; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 3 | 1; | |||||||||||||||||||||||||||
| 27 | __END__ | ||||||||||||||||||||||||||||