lib/Bio/AssemblyImprovement/Validate/Executable.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 50.0% 1 / 2 totaltotal 97.1% 34 / 35 CC 4 SCAR 6.9
CC
4
Cov
100%
check_executable_and_set_default
3.0
does_executable_exist
2.0
BEGIN
1.0
CRAP 2.0
« lib/Bio/AssemblyImprovement/Abacas/Iterative.pm ↑ Summary lib/Bio/AssemblyImprovement/Util/OrderContigsByLength.pm »
1 package Bio::AssemblyImprovement::Validate::Executable;
2  
3 # ABSTRACT: Validates the executable is available in the path before running it.
4  
5  
6 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use File::Which;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub does_executable_exist
10 2 ▶{
Subroutine does_executable_exist: called CC=2 SCAR=6.9
Pod documented
11 2 my($self, $exec) = @_;
12 2 ▶ if(-x $exec){
Branch: 1 branch
BranchTrueFalseTotal
if (-x $exec) 1 1 2
13 1 return 1;
14 }
15 1 return 0;
16  
17 }
18  
19 sub check_executable_and_set_default
20 3 ▶{
Subroutine check_executable_and_set_default: called CC=3 SCAR=11.0
Pod undocumented
21 3 my($self, $exec, $default) = @_;
22
23 3 ▶ if(!defined $exec){
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $exec) { } 1 2 3
24 1 return $default;
25 }else{
26 2 ▶ if($self->does_executable_exist($exec)){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->does_executable_exist($exec)) { } 1 1 2
27 1 return $exec;
28 }else{
29 1 warn "$exec does not exist. Using default: $default";
30 1 return $default;
31 }
32 }
33 }
34  
35  
36 2 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
37 2 __PACKAGE__->meta->make_immutable;
38 2 1;
39  
40 __END__
« lib/Bio/AssemblyImprovement/Abacas/Iterative.pm ↑ Summary lib/Bio/AssemblyImprovement/Util/OrderContigsByLength.pm »