| 1 | package MIME::Expander::Plugin::ApplicationTar; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use vars qw($VERSION); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 4 | $VERSION = '0.02'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use parent qw(MIME::Expander::Plugin); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 4 | __PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw( | |||||||||||||||||||||||||||
| 10 | application/tar | ||||||||||||||||||||||||||||
| 11 | )]); | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use Archive::Tar; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 4 | ▶ | use IO::Scalar; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 5 | ▶ | sub expand { | ||||||||||||||||||||||||||
|
Subroutine
expand: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 17 | 5 | my $self = shift; | |||||||||||||||||||||||||||
| 18 | 5 | my $part = shift; | |||||||||||||||||||||||||||
| 19 | 5 | my $callback = shift; | |||||||||||||||||||||||||||
| 20 | 5 | my $c = 0; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 5 | my $contents = $part->body; | |||||||||||||||||||||||||||
| 23 | 5 | my $iter = Archive::Tar->iter(IO::Scalar->new( | |||||||||||||||||||||||||||
| 24 | \$contents, | ||||||||||||||||||||||||||||
| 25 | )); | ||||||||||||||||||||||||||||
| 26 | 5 | ▶ | while( my $f = $iter->() ){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | 15 | ▶ | if( $f->has_content and $f->validate ){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$f->has_content and $f->validate
MC/DC50%1/2
$f->has_content and $f->validate
$f->has_content
$f->validate
Truth table66%2/3
A and B
A= $f->has_contentB= $f->validate
| |||||||||||||||||||||||||||||
| 28 | 10 | ▶ | $callback->( $f->get_content_by_ref, { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 29 | filename => $f->full_path, | ||||||||||||||||||||||||||||
| 30 | } ) if( ref $callback eq 'CODE' ); | ||||||||||||||||||||||||||||
| 31 | 10 | ++$c; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 5 | return $c; | |||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 4 | 1; | |||||||||||||||||||||||||||
| 39 | __END__ | ||||||||||||||||||||||||||||