eg/multiselection.pl

filter: Statementstmt 100% 26 / 26 Branchbran 100% 2 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 94.1% 32 / 34 CC 1 SCAR 0.0
CC
1
Cov
97%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« eg/basic.pl ↑ Summary
1 #!/usr/bin/perl
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Geo::Postcodes::NO;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 my ($status, @lines) = Geo::Postcodes::NO::verify_selectionlist(@ARGV);
7  
8 2 ▶if ($status == 0)
Branch: 1 branch
BranchTrueFalseTotal
if ($status == 0) 1 1 2
9 {
10 1 print "Usage:\n",
11 " * multiselection.pl [all|none]\n",
12 " * multiselection.pl [",
13 join("|", Geo::Postcodes::NO::get_initial_selectionmodes()),
14 "]? <field> <value> [[",
15 join("|", Geo::Postcodes::NO::get_selectionmodes()),
16 "]? [<field> <value>]]*\n\n";
17 1 print "Legal fields: ", join(", ", Geo::Postcodes::NO::get_fields()), "\n\n";
18 1 print "Diagnostic output:\n";
19 1 foreach (@lines)
20 {
21 1 print " * $_\n";
22 }
23 1 exit;
24 }
25  
26 1 my @fields = Geo::Postcodes::NO::get_fields();
27 1 foreach my $m (@fields)
28 {
29 7 printf("%-14s", ucfirst($m));
30 }
31 1 print "\n";
32  
33 1 foreach my $P (Geo::Postcodes::NO->selection(@lines))
34 {
35 449 foreach my $method (@fields)
36 {
37 3143 ▶ printf("%-14s", $P->$method() || "");
Condition50%1/2
$P->$method || ''
l!l
31430
MC/DC0%0/1
$P->$method || ''
$P->$method
Truth table50%1/2
A
A= $P->$method
Aresult
11
00
38 }
39 449 print "\n";
40 }
41 1 print "\n";
« eg/basic.pl ↑ Summary