lib/Bio/AssemblyImprovement/Util/ZipFileRole.pm

filter: Statementstmt 100% 26 / 26 Branchbran 75.0% 3 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 88.1% 37 / 42 CC 4 SCAR 8.2
CC
4
Cov
91%
_zip_file
4.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.3
« lib/Bio/AssemblyImprovement/Scaffold/SSpace/PreprocessInputFiles.pm ↑ Summary lib/Bio/AssemblyImprovement/Scaffold/SSpace/Config.pm »
1 package Bio::AssemblyImprovement::Util::ZipFileRole;
2 # ABSTRACT: Zip file
3  
4  
5 6 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use IO::Compress::Gzip qw(gzip $GzipError) ;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use Cwd qw(abs_path);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 6 ▶use Cwd;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use File::Basename;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 2 ▶sub _zip_file {
Subroutine _zip_file: called CC=4 SCAR=14.2
12
13 2 my ( $self, $input_filename, $output_directory ) = @_;
14
15 2 ▶ return undef unless(defined($input_filename));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $input_filename 0 2 2
16
17 2 ▶ $output_directory ||= abs_path (getcwd());
Condition33%1/3
$output_directory ||= abs_path(getcwd())
l!l&&r!l&&!r
200
MC/DC0%0/2
$output_directory ||= abs_path(getcwd())
$output_directory abs_path(getcwd())
Truth table33%1/3
A ||= B
A= $output_directoryB= abs_path(getcwd())
ABresult
1X1
011
000
18
19 2 my ( $filename, $directories, $suffix ) = fileparse( $input_filename );
20 2 my $output_filename = join( '/', ( $output_directory, $filename.'.gz' ) );
21 2 ▶ gzip $input_filename => $output_filename or die "gzip failed: $GzipError\n";
Branch: 1 branch
BranchTrueFalseTotal
gzip($input_filename, $output_filename) or die "gzip failed: $Bio::AssemblyImprovement::Util::ZipFileRole::GzipError\n" 1 1 2
22 1 return $output_filename;
23  
24 }
25  
26 6 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 6 1;
28  
29 __END__
« lib/Bio/AssemblyImprovement/Scaffold/SSpace/PreprocessInputFiles.pm ↑ Summary lib/Bio/AssemblyImprovement/Scaffold/SSpace/Config.pm »