Tools/EUtilities/History.pm

filter: Statementstmt 76.4% 26 / 34 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.9% 39 / 62 CC 7 SCAR 15.9
CC
7
Cov
66%
_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 our $AUTHORITY = 'cpan:BIOPERLML';
3 6 $Bio::Tools::EUtilities::History::VERSION = '1.74';
4 6 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use base qw(Bio::Root::Root Bio::Tools::EUtilities::HistoryI);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # ABSTRACT: Lightweight implementation of HistoryI interface (not bound to filehandles, extraneous methods, etc).
10 # AUTHOR: Chris Fields <cjfields@bioperl.org>
11 # OWNER: 2006-2013 Chris Fields
12 # LICENSE: Perl_5
13  
14  
15  
16 sub new {
17 2 ▶ my ($class, @args) = @_;
Subroutine new: called CC=2 SCAR=7.0
Pod documented
18 2 my $self = $class->SUPER::new(@args);
19 2 my ($eutil) = $self->_rearrange([qw(eutil)],@args);
20 2 ▶ $eutil || $self->throw('eutil not defined');
Branch: 1 branch
BranchTrueFalseTotal
$eutil or $self->throw("eutil not defined") 0 2 2
21 2 $self->eutil($eutil);
22 2 $self->datatype('history');
23 2 return $self;
24 }
25  
26  
27  
28  
29 sub _add_data {
30 2 ▶ my ($self, $simple) = @_;
Subroutine _add_data: called CC=5 SCAR=21.6
31 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
32 0 $self->debug("Data:",Dumper($simple));
33 0 $self->throw("Missing webenv/query key in history output");
34 }
35 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
36 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
37 }
38  
39  
40 sub to_string {
41 0 ▶ my $self = shift;
Subroutine to_string: not called CC=2 SCAR=17.9
Pod documented
42 0 my $string;
43 0 my %map = (
44 'get_webenv' => 'WebEnv',
45 'get_query_key' => 'Key'
46 );
47 0 for my $m (qw(get_webenv get_query_key)) {
48 0 $string .= sprintf("%-20s:%s\n", $map{$m}, $self->$m);
49 }
50 0 return $string;
51 }
52  
53 6 1;
54  
55 __END__
« Tools/EUtilities/Link/UrlLink.pm ↑ Summary Tools/EUtilities/Summary/DocSum.pm »