lib/Bio/MUST/Core/Roles/Taxable.pm

filter: Statementstmt 80.6% 25 / 31 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod n/a totaltotal 78.0% 32 / 41 CC 2 SCAR 7.5
CC
2
Cov
76%
_build_tax
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« lib/Bio/MUST/Core/SeqId/Filter.pm ↑ Summary script/ali2fasta.pl »
1 package Bio::MUST::Core::Roles::Taxable;
2 # ABSTRACT: Taxable Moose role for objects that query a taxonomy
3 18 $Bio::MUST::Core::Roles::Taxable::VERSION = '0.252040';
4 18 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 18 ▶use autodie;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 18 ▶use feature qw(say);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 18 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 18 ▶use Bio::MUST::Core::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 18 ▶use aliased 'Bio::MUST::Core::Taxonomy';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 18 has 'tax_dir' => (
16 is => 'ro',
17 isa => 'Maybe[Str]',
18 );
19  
20  
21 18 has 'tax' => (
22 is => 'ro',
23 isa => 'Maybe[Bio::MUST::Core::Taxonomy]',
24 lazy => 1,
25 builder => '_build_tax', # if not provided in constructor
26 );
27  
28 ## no critic (ProhibitUnusedPrivateSubroutines)
29  
30 0 ▶sub _build_tax {
Subroutine _build_tax: not called CC=2 SCAR=17.9
31 0 my $self = shift;
32  
33 0 my $tax_dir = $self->tax_dir;
34 0 ▶ unless ($tax_dir) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($tax_dir) 0 0 0
35 0 carp '[BMC] Warning: no valid tax_dir specified; disabling taxonomy!';
36 0 return;
37 }
38  
39 0 return Taxonomy->new_from_cache( tax_dir => $tax_dir );
40 }
41  
42 ## use critic
43  
44 18 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
45 18 1;
46  
47 __END__
« lib/Bio/MUST/Core/SeqId/Filter.pm ↑ Summary script/ali2fasta.pl »