Importer/WoS.pm

filter: Statementstmt 58.8% 20 / 34 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod n/a totaltotal 47.0% 24 / 51 CC 5 SCAR 27.5
CC
5
Cov
47%
_search_content
30.0
_search_response_type
2.0
BEGIN
1.0
CRAP 15.6
↑ Summary WoS/SearchBase.pm »
1 package Catmandu::Importer::WoS;
2  
3 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $VERSION = '0.0303';
6  
7 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Catmandu::Util qw(xml_escape);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 with 'Catmandu::WoS::SearchRecords';
12  
13 1 has query => (is => 'ro', required => 1);
14 1 has edition => (is => 'ro');
15 1 has symbolic_timespan => (is => 'ro');
16 1 has timespan_begin => (is => 'ro');
17 1 has timespan_end => (is => 'ro');
18  
19 0 ▶sub _search_content {
Subroutine _search_content: not called CC=5 SCAR=34.0
20 0 my ($self, $start, $limit) = @_;
21  
22 0 my $query = xml_escape($self->query);
23  
24 0 my $edition_xml = '';
25 0 my $symbolic_timespan_xml = '';
26 0 my $timespan_xml = '';
27  
28 0 ▶ if (my $edition = $self->edition) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $edition = $self->edition) 0 0 0
29 0 $edition_xml
30 = "<editions><collection>WOS</collection><edition>$edition</edition></editions>";
31 }
32  
33 0 ▶ if (my $ts = $self->symbolic_timespan) {
Branch: 2 branches
BranchTrueFalseTotal
if (my $ts = $self->symbolic_timespan) { } 0 0 0
elsif ($self->timespan_begin and $self->timespan_end) { } 0 0 0
34 0 $symbolic_timespan_xml = "<symbolicTimeSpan>$ts</symbolicTimeSpan>";
35 }
36 ▶ elsif ($self->timespan_begin && $self->timespan_end) {
Condition0%0/3
$self->timespan_begin and $self->timespan_end
!ll&&!rl&&r
000
MC/DC0%0/2
$self->timespan_begin and $self->timespan_end
$self->timespan_begin $self->timespan_end
Truth table0%0/3
A and B
A= $self->timespan_beginB= $self->timespan_end
ABresult
0X0
100
111
37 0 my $tsb = $self->timespan_begin;
38 0 my $tse = $self->timespan_end;
39 0 $timespan_xml
40 = "<timeSpan><begin>$tsb</begin><end>$tse</end></timeSpan>";
41 }
42  
43 0 <<EOF;
44 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
45 xmlns:woksearch="http://woksearch.v3.wokmws.thomsonreuters.com">
46 <soapenv:Header/>
47 <soapenv:Body>
48 <woksearch:search>
49 <queryParameters>
50 <databaseId>WOS</databaseId>
51 <userQuery>$query</userQuery>
52 $edition_xml
53 $symbolic_timespan_xml
54 $timespan_xml
55 <queryLanguage>en</queryLanguage>
56 </queryParameters>
57 <retrieveParameters>
58 <firstRecord>$start</firstRecord>
59 <count>$limit</count>
60 <option>
61 <key>RecordIDs</key>
62 <value>On</value>
63 </option>
64 <option>
65 <key>targetNamespace</key>
66 <value>http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord</value>
67 </option>
68 </retrieveParameters>
69 </woksearch:search>
70 </soapenv:Body>
71 </soapenv:Envelope>
72 EOF
73 }
74  
75 0 ▶sub _search_response_type {
Subroutine _search_response_type: not called CC=1 SCAR=6.9
76 0 'searchResponse';
77 }
78  
79 1 1;
80  
81 __END__
↑ Summary WoS/SearchBase.pm »