Branch Coverage

blib/lib/WWW/Patent/Page.pm
Criterion Covered Total %
branch 80 100 80.0


line true false branch
48 7 2 if (@_ % 2) { }
83 2 7 if ($doc_id)
96 3 0 if (exists $default_parameter{$key}) { }
116 0 9 unless (defined $self->agent)
119 0 9 if (defined $passed_parm{'country'} and defined $passed_parm{'number'})
125 2 7 if ($$self{'patent'}{'doc_id'})
134 1 1 if (exists $_country_known{$country_in_question}) { }
145 22 173 unless ($id)
146 0 22 unless $id = $$self{'patent'}{'doc_id'}
152 193 2 if ($id =~ /^ # anchor to beginning of string [, _\.\t-]* #separator(s) (optional) (\D\D){0,1} # country (optional) (well, sometimes the type, if country not supplied because known by other means) [, _\.\t-]* #separator(s) (optional) (D|PP|RE|T|H|RX|AI|d|pp|re|t|h|rx|ai|S|M|s|m){0,1} # type, if accompanied by country (use below also!) [, _\.\t-]* #separator(s) (optional) ([, _\d-]+) # "number" REQUIRED to have digits - with interspersed separator(s) (optional) [, _\.\t-]* #separator(s) (optional) ( A$|A[, _\.\t-]+|B$|B[, _\.\t-]+|D$|D[, _\.\t-]+|E$|E[, _\.\t-]+|H$|H[, _\.\t-]+| L$|L[, _\.\t-]+|M$|M[, _\.\t-]+|O$|O[, _\.\t-]+|P$|P[, _\.\t-]+|S$|S[, _\.\t-]+| T$|T[, _\.\t-]+|U$|U[, _\.\t-]+|W$|W[, _\.\t-]+|X$|X[, _\.\t-]+|Y$|Y[, _\.\t-]+| Z$|Z[, _\.\t-]+| A0|A1|A2|A3|A4|A5|A6|A7|A8|A9|B1|B2|B3|B4|B5|B6|B8|B9|C$|C0|C1|C2|C3|C4|C5| C8|C[, _\.\t-]+|F1|F2|H1|H2|P1|P2|P3|P4|P9|T1|T2|T3|T4|T5|T9|U0|U1|U2|U3|U4| U8|W1|W2|X0|X1|X2|Y1|Y2|Y3|Y4|Y5|Y6|Y8| a$|a[, _\.\t-]+|b$|b[, _\.\t-]+|d$|d[, _\.\t-]+|e$|e[, _\.\t-]+|h$|h[, _\.\t-]+| l$|l[, _\.\t-]+|m$|m[, _\.\t-]+|o$|o[, _\.\t-]+|p$|p[, _\.\t-]+|s$|s[, _\.\t-]+| t$|t[, _\.\t-]+|u$|u[, _\.\t-]+|w$|w[, _\.\t-]+|x$|x[, _\.\t-]+|y$|y[, _\.\t-]+| z$|z[, _\.\t-]+| a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|b1|b2|b3|b4|b5|b6|b8|b9|c$|c0|c1|c2|c3|c4|c5| c8|c[, _\.\t-]+|f1|f2|h1|h2|p1|p2|p3|p4|p9|t1|t2|t3|t4|t5|t9|u0|u1|u2|u3|u4| u8|w1|w2|x0|x1|x2|y1|y2|y3|y4|y5|y6|y8 ){0,1} # kind code (eats up separator required before comment) (.*) # comment (optional, if used, required to be preceded by at least one separator) /mx) { }
189 159 34 if ($country) { }
193 87 106 if ($type) { }
197 34 72 unless (defined $type or $type or $_country_known{$country})
198 32 2 if ($country =~ /(D|PP|RE|T|H|RX|AI|d|pp|re|t|h|rx|ai|S|M|s|m)/mx) { }
212 0 191 if (not exists $_country_known{$country} or $type and !$type =~ /(^D$|^PP$|RE|T|H|RX|AI|d|pp|re|t|h|rx|ai)/mx)
226 191 0 if ($number) { }
230 47 144 if ($kind)
231 47 144 if ($kind)
234 25 166 if ($comment)
253 21 170 if ($$self{'patent'}{'country'} eq 'JP')
256 12 9 if (uc $$self{'patent'}{'doc_type'} eq 'H' or uc $$self{'patent'}{'doc_type'} eq 'S' or uc $$self{'patent'}{'doc_type'} eq 'T' or uc $$self{'patent'}{'doc_type'} eq 'M') { }
5 4 elsif (substr($$self{'patent'}{'number'}, 3, 1) ne '-' and length $$self{'patent'}{'number'} > 7 and substr($$self{'patent'}{'number'}, 0, 4) > 1992 and substr($$self{'patent'}{'number'}, 0, 4) <= (localtime time)[5] + 1900) { }
286 191 0 if (defined $$self{'patent'}{'country'}) { }
290 119 72 if (defined $$self{'patent'}{'doc_type'}) { }
294 191 0 if (defined $$self{'patent'}{'number'}) { }
298 47 144 if (defined $$self{'patent'}{'kind'}) { }
302 191 0 if (defined $$self{'patent'}{'comment'}) { }
307 21 170 if ($$self{'patent'}{'doc_type'} and $$self{'patent'}{'kind'}) { }
46 124 elsif (not $$self{'patent'}{'doc_type'} || $$self{'patent'}{'kind'}) { }
98 26 elsif (not $$self{'patent'}{'kind'}) { }
334 14 9 if (@_ % 2)
342 0 64 if (exists $$self{$key}) { }
64 0 elsif (exists $$self{'patent'}{$key}) { }
349 20 3 if ($$self{'patent'}{'doc_id'})
351 2 21 unless ($response->get_parameter('country'))
358 0 21 unless ($_country_known{$response->get_parameter('country')})
365 1 20 unless ($response->get_parameter('number'))
370 1 19 unless ($response->get_parameter('office'))
375 3 16 unless ($response->get_parameter('format'))
381 2 14 unless (exists $METHODS{$provide_doc})
386 0 14 unless my $function_reference = $METHODS{$provide_doc}
390 0 13 unless $response = &{$function_reference;}($self, $response)
394 0 13 unless ($response)
401 0 2 if (@_ % 2) { }
403 0 2 unless (exists $METHODS{$office . '_terms'})
421 2 0 if ($response->code == 500)
422 0 2 if ($response->code == 503)
424 1 29 unless ($response->is_success)
453 5 4 unless (defined $MODULES{$modpath})
456 0 5 if ($WWW::Patent::Page::EVAL_ERROR)