Tools/EUtilities/Summary/ItemContainerI.pm

filter: Statementstmt 71.1% 42 / 59 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.9% 62 / 97 CC 12 SCAR 17.9
CC
12
Cov
62%
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 our $AUTHORITY = 'cpan:BIOPERLML';
3 4 $Bio::Tools::EUtilities::Summary::ItemContainerI::VERSION = '1.74';
4 4 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use base qw(Bio::Tools::EUtilities::EUtilDataI);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # 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).
10 # AUTHOR: Chris Fields <cjfields@bioperl.org>
11 # OWNER: 2006-2013 Chris Fields
12 # LICENSE: Perl_5
13  
14  
15  
16 sub next_Item {
17 0 ▶ my ($self, $request) = @_;
Subroutine next_Item: not called CC=4 SCAR=30.0
Pod documented
18 0 ▶ unless ($self->{"_items_it"}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"_items_it"}) 0 0 0
19 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
20 $self->get_all_Items :
21 $self->get_Items ;
22 0 ▶ $self->{"_items_it"} = sub {return shift @items}
Subroutine __ANON__: not called CC=1 SCAR=6.9
23 0 }
24 0 $self->{'_items_it'}->();
25 }
26  
27  
28 sub get_Items {
29 7 ▶ my $self = shift;
Subroutine get_Items: called CC=2 SCAR=7.1
Pod documented
30 7 ▶ return ref $self->{'_items'} ? @{ $self->{'_items'} } : return ();
Branch: 1 branch
BranchTrueFalseTotal
ref $self->{'_items'} ? : 7 0 7
31 }
32  
33  
34 sub get_all_Items {
35 13 ▶ my $self = shift;
Subroutine get_all_Items: called CC=5 SCAR=16.1
Pod documented
36 13 ▶ unless ($self->{'_ordered_items'}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"_ordered_items"}) 6 7 13
37 6 for my $item ($self->get_Items) {
38 52 push @{$self->{'_ordered_items'}}, $item;
39 52 for my $ls ($item->get_ListItems) {
40 16 push @{$self->{'_ordered_items'}}, $ls;
41 16 for my $st ($ls->get_StructureItems) {
42 80 push @{$self->{'_ordered_items'}}, $st;
43 }
44 }
45 }
46 }
47 13 return @{$self->{'_ordered_items'}};
48 }
49  
50  
51 sub get_all_names {
52 0 ▶ my ($self) = @_;
Subroutine get_all_names: not called CC=1 SCAR=6.9
Pod documented
53 0 my %tmp;
54 0 my @data = grep {!$tmp{$_}++}
55 0 map {$_->get_name} $self->get_all_Items;
56 0 return @data;
57 }
58  
59  
60 sub get_Items_by_name {
61 0 ▶ my ($self, $key) = @_;
Subroutine get_Items_by_name: not called CC=2 SCAR=17.9
Pod documented
62 0 ▶ return unless $key;
Branch: 1 branch
BranchTrueFalseTotal
unless $key 0 0 0
63 0 my @data = grep {$_->get_name eq $key}
64 $self->get_all_Items;
65 0 return @data;
66 }
67  
68  
69 sub get_contents_by_name {
70 5 ▶ my ($self, $key) = @_;
Subroutine get_contents_by_name: called CC=2 SCAR=7.0
Pod documented
71 5 ▶ return unless $key;
Branch: 1 branch
BranchTrueFalseTotal
unless $key 0 5 5
72 19 my @data = map {$_->get_content}
73 5 grep {$_->get_name eq $key}
74 $self->get_all_Items;
75 5 return @data;
76 }
77  
78  
79 sub get_type_by_name {
80 5 ▶ my ($self, $key) = @_;
Subroutine get_type_by_name: called CC=2 SCAR=7.0
Pod documented
81 5 ▶ return unless $key;
Branch: 1 branch
BranchTrueFalseTotal
unless $key 0 5 5
82 5 my ($it) = grep {$_->get_name eq $key} $self->get_all_Items;
83 5 return $it->get_type;
84 }
85  
86 4 1;
87  
88 __END__
« Tools/EUtilities/HistoryI.pm ↑ Summary Tools/EUtilities/Link/UrlLink.pm »