Tools/EUtilities/History.pm

filter: Statementstmt 75.7% 25 / 33 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 3 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 85.7% 6 / 7 Podpod 100% 2 / 2 totaltotal 62.3% 38 / 61 CC 7 SCAR 15.9
CC
7
Cov
65%
_add_data
8.7
to_string
6.0
new
2.0
CRAP 4.9
« Tools/EUtilities/Link/UrlLink.pm ↑ Summary Tools/EUtilities/Summary/DocSum.pm »
1 package Bio::Tools::EUtilities::History;
2 6 $Bio::Tools::EUtilities::History::VERSION = '1.77';
3 6 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use base qw(Bio::Root::Root Bio::Tools::EUtilities::HistoryI);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # ABSTRACT: Lightweight implementation of HistoryI interface (not bound to filehandles, extraneous methods, etc).
9 # AUTHOR: Chris Fields <cjfields@bioperl.org>
10 # OWNER: 2006-2013 Chris Fields
11 # LICENSE: Perl_5
12  
13  
14  
15 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod documented
16 2 my ($class, @args) = @_;
17 2 my $self = $class->SUPER::new(@args);
18 2 my ($eutil) = $self->_rearrange([qw(eutil)],@args);
19 2 ▶ $eutil || $self->throw('eutil not defined');
Branch: 1 branch
BranchTrueFalseTotal
$eutil or $self->throw("eutil not defined") 2 0 2
20 2 $self->eutil($eutil);
21 2 $self->datatype('history');
22 2 return $self;
23 }
24  
25  
26  
27  
28 2 ▶sub _add_data {
Subroutine _add_data: called CC=5 SCAR=21.6
29 2 my ($self, $simple) = @_;
30 2 ▶ if (!exists $simple->{WebEnv} || !exists $simple->{QueryKey}) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $simple->{"WebEnv"} and exists $simple->{"QueryKey"}) 0 2 2
Condition33%1/3
exists $simple->{"WebEnv"} and exists $simple->{"QueryKey"}
!ll&&!rl&&r
002
MC/DC0%0/2
exists $simple->{"WebEnv"} and exists $simple->{"QueryKey"}
exists $simple->{"WebEnv"} exists $simple->{"QueryKey"}
Truth table33%1/3
A and B
A= exists $simple->{"WebEnv"}B= exists $simple->{"QueryKey"}
ABresult
0X0
100
111
31 0 $self->debug("Data:",Dumper($simple));
32 0 $self->throw("Missing webenv/query key in history output");
33 }
34 2 ▶ $self->{_webenv} = $simple->{WebEnv} && delete $simple->{WebEnv};
Condition33%1/3
$simple->{'WebEnv'} && delete $simple->{'WebEnv'}
!ll&&!rl&&r
002
MC/DC0%0/2
$simple->{'WebEnv'} && delete $simple->{'WebEnv'}
$simple->{'WebEnv'} delete $simple->{'WebEnv'}
Truth table33%1/3
A && B
A= $simple->{'WebEnv'}B= delete $simple->{'WebEnv'}
ABresult
0X0
100
111
35 2 ▶ $self->{_querykey} = $simple->{QueryKey} && delete $simple->{QueryKey};
Condition33%1/3
$simple->{'QueryKey'} && delete $simple->{'QueryKey'}
!ll&&!rl&&r
002
MC/DC0%0/2
$simple->{'QueryKey'} && delete $simple->{'QueryKey'}
$simple->{'QueryKey'} delete $simple->{'QueryKey'}
Truth table33%1/3
A && B
A= $simple->{'QueryKey'}B= delete $simple->{'QueryKey'}
ABresult
0X0
100
111
36 }
37  
38  
39 0 ▶sub to_string {
Subroutine to_string: not called CC=2 SCAR=17.9
Pod documented
40 0 my $self = shift;
41 0 my $string;
42 0 my %map = (
43 'get_webenv' => 'WebEnv',
44 'get_query_key' => 'Key'
45 );
46 0 for my $m (qw(get_webenv get_query_key)) {
47 0 $string .= sprintf("%-20s:%s\n", $map{$m}, $self->$m);
48 }
49 0 return $string;
50 }
51  
52 6 1;
53  
54 __END__
« Tools/EUtilities/Link/UrlLink.pm ↑ Summary Tools/EUtilities/Summary/DocSum.pm »