Tools/EUtilities/Summary/ItemContainerI.pm

filter: Statementstmt 70.6% 41 / 58 Branchbran 35.7% 5 / 14 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 8 / 12 Podpod 100% 7 / 7 totaltotal 63.5% 61 / 96 CC 12 SCAR 17.9
CC
12
Cov
61%
next_Item
20.0
get_Items_by_name
6.0
get_all_Items
5.0
CRAP 6.0
« Tools/EUtilities/HistoryI.pm ↑ Summary Tools/EUtilities/Link/UrlLink.pm »
1 package Bio::Tools::EUtilities::Summary::ItemContainerI;
2 4 $Bio::Tools::EUtilities::Summary::ItemContainerI::VERSION = '1.77';
3 4 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use base qw(Bio::Tools::EUtilities::EUtilDataI);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # ABSTRACT: Abtract interface methods for accessing Item information from any Item-containing class. This pertains to either DocSums or to Items themselves (which can be layered).
9 # AUTHOR: Chris Fields <cjfields@bioperl.org>
10 # OWNER: 2006-2013 Chris Fields
11 # LICENSE: Perl_5
12  
13  
14  
15 0 ▶sub next_Item {
Subroutine next_Item: not called CC=4 SCAR=30.0
Pod documented
16 0 my ($self, $request) = @_;
17 0 ▶ unless ($self->{"_items_it"}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"_items_it"}) 0 0 0
18 0 ▶ my @items = ($request && $request eq 'flatten') ?
Branch: 1 branch
BranchTrueFalseTotal
$request && $request eq 'flatten' ? : 0 0 0
Condition0%0/3
$request and $request eq "flatten"
!ll&&!rl&&r
000
MC/DC0%0/2
$request and $request eq "flatten"
$request $request eq "flatten"
Truth table0%0/3
A and B
A= $requestB= $request eq "flatten"
ABresult
0X0
100
111
19 $self->get_all_Items :
20 $self->get_Items ;
21 0 ▶ $self->{"_items_it"} = sub {return shift @items}
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 0 }
23 0 $self->{'_items_it'}->();
24 }
25  
26  
27 7 ▶sub get_Items {
Subroutine get_Items: called CC=2 SCAR=7.1
Pod documented
28 7 my $self = shift;
29 7 ▶ return ref $self->{'_items'} ? @{ $self->{'_items'} } : return ();
Branch: 1 branch
BranchTrueFalseTotal
ref $self->{'_items'} ? : 7 0 7
30 }
31  
32  
33 13 ▶sub get_all_Items {
Subroutine get_all_Items: called CC=5 SCAR=16.1
Pod documented
34 13 my $self = shift;
35 13 ▶ unless ($self->{'_ordered_items'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"_ordered_items"}) 6 7 13
36 6 for my $item ($self->get_Items) {
37 52 push @{$self->{'_ordered_items'}}, $item;
38 52 for my $ls ($item->get_ListItems) {
39 16 push @{$self->{'_ordered_items'}}, $ls;
40 16 for my $st ($ls->get_StructureItems) {
41 80 push @{$self->{'_ordered_items'}}, $st;
42 }
43 }
44 }
45 }
46 13 return @{$self->{'_ordered_items'}};
47 }
48  
49  
50 0 ▶sub get_all_names {
Subroutine get_all_names: not called CC=1 SCAR=6.9
Pod documented
51 0 my ($self) = @_;
52 0 my %tmp;
53 0 my @data = grep {!$tmp{$_}++}
54 0 map {$_->get_name} $self->get_all_Items;
55 0 return @data;
56 }
57  
58  
59 0 ▶sub get_Items_by_name {
Subroutine get_Items_by_name: not called CC=2 SCAR=17.9
Pod documented
60 0 my ($self, $key) = @_;
61 0 ▶ return unless $key;
Branch: 1 branch
BranchTrueFalseTotal
unless $key 0 0 0
62 0 my @data = grep {$_->get_name eq $key}
63 $self->get_all_Items;
64 0 return @data;
65 }
66  
67  
68 5 ▶sub get_contents_by_name {
Subroutine get_contents_by_name: called CC=2 SCAR=7.0
Pod documented
69 5 my ($self, $key) = @_;
70 5 ▶ return unless $key;
Branch: 1 branch
BranchTrueFalseTotal
unless $key 0 5 5
71 19 my @data = map {$_->get_content}
72 5 grep {$_->get_name eq $key}
73 $self->get_all_Items;
74 5 return @data;
75 }
76  
77  
78 5 ▶sub get_type_by_name {
Subroutine get_type_by_name: called CC=2 SCAR=7.0
Pod documented
79 5 my ($self, $key) = @_;
80 5 ▶ return unless $key;
Branch: 1 branch
BranchTrueFalseTotal
unless $key 0 5 5
81 5 my ($it) = grep {$_->get_name eq $key} $self->get_all_Items;
82 5 return $it->get_type;
83 }
84  
85 4 1;
86  
87 __END__
« Tools/EUtilities/HistoryI.pm ↑ Summary Tools/EUtilities/Link/UrlLink.pm »