Tool/EnglishMorpho/exceptions/nouns_plural_s.pl untested

filter: Statementstmt 0.0% 0 / 14 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 26 CC 2 SCAR 15.4
CC
2
Cov
0%
generate
6.0
analyze
2.0
CRAP 4.7
1 #!/usr/bin/env perl
2 my @DATA = qw(
3 abuse
4 ache
5 avalanche
6 birdie
7 bogie
8 bookie
9 bronze
10 brownie
11 calorie
12 canoe
13 collapse
14 corpse
15 excuse
16 expense
17 foe
18 glimpse
19 headache
20 hippie
21 impulse
22 lapse
23 movie
24 niche
25 pulse
26 sortie
27 throe
28 toe
29 woe
30 photo
31 );
32  
33 sub analyze() { ## no critic qw(Subroutines::ProhibitSubroutinePrototypes)
34 foreach (@DATA) {
35 print "${_}s\tNNS\t$_\n";
36 }
37 return;
38 }
39  
40 sub generate() { ## no critic qw(Subroutines::ProhibitSubroutinePrototypes)
41 foreach (@DATA) {
42  
43 # words ending in -e are covered by rules in EnglishMorpho::Generator.pm
44 next if /e$/;
45 print "$_\t${_}s\n";
46 }
47 return;
48 }
49  
50 if ( $ARGV[0] eq '-a' ) { analyze(); }
51 elsif ( $ARGV[0] eq '-g' ) { generate(); }
52 elsif ( $ARGV[0] eq '-d' ) {
53 foreach (@DATA) { print "$_\n"; }
54 }
55 else { die "Invalid usage: use option -a, -g or -d\n"; }