blib/lib/Acme/MetaSyntactic/soviet.pm

filter: Statementstmt 67.3% 33 / 49 Branchbran 45.8% 11 / 24 Conditioncond 50.0% 3 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 71.4% 5 / 7 Podpod n/a totaltotal 60.0% 54 / 90 CC 15 SCAR 20.4
CC
15
Cov
59%
_load_data_from_pod
11.1
_load_data_from_pod
11.1
_flush_category
4.1
CRAP 7.7
↑ Summary
1 # -*- encoding: utf-8; indent-tabs-mode: nil -*-
2 #
3 # Acme::MetaSyntactic::soviet -- NATO codenames for Soviet-designed equipment
4 # Copyright (C) 2008, 2012, 2016, 2021 Jean Forget
5 #
6 # See the license in the embedded documentation below.
7 #
8 package Acme::MetaSyntactic::soviet;
9  
10 14 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 14 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 14 ▶use Acme::MetaSyntactic::MultiList;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 14 our @ISA = qw( Acme::MetaSyntactic::MultiList );
15 14 our $VERSION = '0.06';
16  
17 14 my $data = { default => 'electronic' };
18 14 my ($category2, $category3);
19 14 my %seen;
20  
21 14 _load_data_from_pod();
22  
23 14 __PACKAGE__->init($data);
24  
25 14 ▶sub _load_data_from_pod {
Subroutine _load_data_from_pod: called CC=6 SCAR=24.1
26  
27 0 ▶ while (<DATA>) {
Subroutine _load_data_from_pod: not called CC=6 SCAR=24.1
Branch: 2 branches
BranchTrueFalseTotal
if (defined($_ = readline DATA)) 23212 0 23212
if (defined($_ = readline DATA)) 0 0 0
28 0 ▶ if (/^=head2\s+(.*)/) {
Branch: 8 branches
BranchTrueFalseTotal
if (/^=head2\s+(.*)/) { } 28 23184 23212
elsif (/^=head3\s+(.*)/) { } 98 23086 23184
elsif (/=item\s+(.*?)\s*$/) { } 5348 17738 23086
elsif (/^=head1/) { } 14 17724 17738
if (/^=head2\s+(.*)/) { } 0 0 0
elsif (/^=head3\s+(.*)/) { } 0 0 0
elsif (/=item\s+(.*?)\s*$/) { } 0 0 0
elsif (/^=head1/) { } 0 0 0
29 0 _flush_category();
30 0 $category2 = lc($1);
31 0 $category3 = '';
32 }
33 elsif (/^=head3\s+(.*)/) {
34 0 _flush_category();
35 0 $category3 = lc($1);
36 }
37 elsif (/=item\s+(.*?)\s*$/) {
38 0 my $name = $1;
39 0 $name =~ s/\s+/_/g;
40 0 $name =~ s/_+/_/g;
41 0 $seen{$name} = 1;
42 }
43 elsif (/^=head1/) {
44 0 last;
45 }
46 }
47 0 _flush_category();
48 }
49  
50 140 ▶sub _flush_category {
Subroutine _flush_category: called CC=3 SCAR=14.2
51 0 ▶ if ($category2 and %seen) {
Subroutine _flush_category: not called CC=3 SCAR=14.2
Branch: 2 branches
BranchTrueFalseTotal
if ($category2 and %seen) 98 42 140
if ($category2 and %seen) 0 0 0
Condition50%3/6
$category2 and %seen
!ll&&!rl&&r
142898
$category2 and %seen
!ll&&!rl&&r
000
MC/DC100%2/2
$category2 and %seen
$category2 %seen
MC/DC0%0/2
$category2 and %seen
$category2 %seen
Truth table100%3/3
A and B
A= $category2B= %seen
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $category2B= %seen
ABresult
0X0
100
111
52 0 $data->{names}{$category2}{$category3} = join ' ', sort keys %seen;
53 }
54 0 %seen = ();
55 }
56  
57 14 38;
58 # Why 38? Hint: s/r$/t/
59  
60 =encoding utf8
61  
62 =head1 NAME
63  
64 Acme::MetaSyntactic::soviet -- NATO codenames for Soviet-designed equipment
65  
66 =head1 DESCRIPTION
67  
68 Some codenames given by NATO to Soviet-designed aircraft, missiles,
69 submarines, radars and other electronic systems. The various
70 categories and sub-categories are
71  
72 =over 4
73  
74 =item *
75  
76 electronic
77  
78 =item *
79  
80 electronic/radars
81  
82 =item *
83  
84 electronic/misc
85  
86 =item *
87  
88 vehicles
89  
90 =item *
91  
92 vehicles/aircraft
93  
94 =item *
95  
96 vehicles/helicopters
97  
98 =item *
99  
100 vehicles/missiles
101  
102 =item *
103  
104 vehicles/submarines
105  
106 =item *
107  
108 vehicles/error
109  
110 =back
111  
112 The default category is 'electronic'.
113  
114 =head1 VERSION
115  
116 This is version 0.06, the Fresco version, released on the 49th
117 anniversary of the dogfight between a MiG-17 Fresco flown by ace
118 Colonel Tomb and a F-4 Phantom flown by soon-to-be-aces Cunningham and
119 Driscoll
120  
121 =head1 SYNOPSIS
122  
123 use Acme::MetaSyntactic;
124  
125 my $meta = Acme::MetaSyntactic->new( 'soviet' );
126  
127 print $meta->name(); # return a single name
128 my @names = $meta->name( 4 ); # return 4 distinct names (if possible)
129  
130 If you want some category other than 'electronic', the second line should
131 read:
132  
133 my $meta = Acme::MetaSyntactic->new( 'soviet', category => 'vehicle/aircraft' );
134  
135 If C<meta> from L<Acme::MetaSyntactic> is installed, you can use it
136 from the command line:
137  
138 meta soviet
139  
140 meta soviet/vehicles/submarines
141  
142 =head1 CONTRIBUTOR
143  
144 Jean Forget
145  
146 =head1 SOURCES
147  
148 Note: I have used only sources published I<before> the fall of the
149 Soviet Union. Therefore, the module name is C<A::MS::soviet>, with no
150 "ex-" prefix. For each entry, the sources are listed, with page
151 numbers for most books. The games use data cards, which are
152 unnumbered.
153  
154 Some sources, especially early sources, may contain some errors. Some
155 equipment may appear with faulty intelligence reports which give a
156 wrong code or description. And a later intelligence report would
157 correct it. The best example is the Backfire, first given the code
158 "Tu-26" and then the code "Tu-22M".
159  
160 =head2 Main Sources
161  
162 These sources contain extensive lists or extensive tables of soviet
163 equipment.
164  
165 =over 4
166  
167 =item *
168  
169 I<Pat-Led-1>
170 written by J-J Patry and P. Lederer
171 published by Editions Presse & Recherche
172 abbreviated as I<PL>.
173  
174 =item *
175  
176 I<Jane's World Aircraft Recognition Handbook>
177 written by Derek Wood
178 published by Janes in 1987
179 (ISBN 0-7106-0343-6)
180 abbreviated as I<JWARH>.
181  
182 =item *
183  
184 I<Air Superiority>
185 designed by J.D. Webster
186 and published by GDW in 1987
187 (ISBN 0-943580-19-6) see
188 L<https://boardgamegeek.com/boardgame/3613/air-superiority>
189 abbreviated as I<ASu>.
190  
191 =item *
192  
193 I<Air Strike>
194 designed by J.D. Webster
195 and published by GDW in 1987
196 (ISBN 0-943580-30-7), see
197 L<https://boardgamegeek.com/boardgameexpansion/3614/air-strike>
198 abbreviated as I<ASt>.
199  
200 =item *
201  
202 I<Desert Falcons>
203 designed by J.D. Webster
204 and published by GDW in 1988
205 (ISBN 0-943580-97-8), see
206 L<https://boardgamegeek.com/boardgame/8474/desert-falcons>
207 abbreviated as I<DF>.
208  
209 =item *
210  
211 I<Les Flottes de Combat 1968>
212 written by H. Le Masson
213 published by Editions Maritimes et Outre-Mer
214 (no ISBN)
215 abbreviated as I<LFDC>.
216  
217 =item *
218  
219 I<Flottes de Combat 1990>
220 written by B. Prézelin
221 published by Editions Maritimes et Outre-Mer
222 (ISBN 2.7373.0485.7)
223 abbreviated as I<FDC>.
224  
225 Note: these last two books are actually the same book, updated and
226 published every other year. You can notice that the title has been
227 shortened between the 1968 issue and the 1990 issue (FDC vs. LFDC).
228  
229 =item *
230  
231 I<Air Wars and Aircraft>
232 written by Victor Flintham
233 published by Arms and Armour in 1989
234 (ISBN 0-85368-779-X)
235 abbreviated as I<AWA>.
236  
237 =item *
238  
239 I<Air War>
240 designed by David Isby
241 published in 1977 by SPI and then in 1983 by TSR
242 (no ISBN), see
243 L<https://boardgamegeek.com/boardgame/1629/air-war-modern-tactical-air-combat>
244 abbreviated as I<SPIAW>.
245  
246 =item *
247  
248 I<How to Make War>
249 written by James F. Dunigan
250 published by Quill in 1988
251 (ISBN 0-668-07979-2)
252 abbreviated as I<HTMW>.
253  
254 =item *
255  
256 I<Science et Vie> special issue I<Aviation 77>
257 published by Excelsior Publications SA in May 1977
258 abbreviated as I<S&V>.
259  
260 =item *
261  
262 I<Aircraft Armament>
263 (or I<The Illustrated Encyclopedia of Aircraft Armament>)
264 written by Bill Gunston
265 published by Salamande Books Ltd. in 1987
266 (ISBN 0-86101-314-X)
267 abbreviated as I<IEAA>.
268  
269 =back
270  
271 =head2 Minor Sources
272  
273 These sources mention some NATO codes for soviet equipment, but
274 without trying to give an exhaustive list of some category or other.
275  
276 =over 4
277  
278 =item *
279  
280 I<Rolling Thunder>
281 designed by Steve Weiss
282 published by Group Three Games in 1985
283 (no ISBN), see
284 L<https://boardgamegeek.com/boardgame/6228/rolling-thunder>
285 abbreviated as I<RT>.
286  
287 =item *
288  
289 I<Fox Two>
290 by Randy Cunningham with Jeff Ethell
291 published by Warner Books in 1984
292 ISBN 0-446-35458-9
293 abbreviated as I<F2>.
294  
295 =item *
296  
297 I<The Hunt for Red October>
298 by Tom Clancy,
299 first published by Naval Institute Press in 1984
300 published by Fontana in 1987
301 ISBN 0-00-617276-8
302 abbreviated at I<THFRO>.
303  
304 =item *
305  
306 I<Red Storm Rising>
307 by Tom Clancy,
308 first published by G.P. Putnam's Sons in 1986,
309 published by Berkley International Edition in 1987
310 ISBN 0-425-10242-4
311 abbreviated as I<RSR>.
312  
313 =item *
314  
315 I<Helicopter Aces>
316 by James W Bradin,
317 published by Avon Books in 1990,
318 ISBN 0-380-75847-4,
319 abbreviated as I<HA>.
320  
321 =item *
322  
323 I<Bullseye One Reactor> written by Dan McKinnon published by House of
324 Hits Publishing in 1987 and by Airlife Publishing Ltd in 1988,
325 abbreviated as I<B1R>. For the ISBN, I am puzzled. On the
326 administrative page at the beginning of the book, there is a sticker
327 with number 1 85310 033 1 and on the flap of the book cover, the ISBN
328 is 1 85310 032 3. Take your pick.
329  
330 =item *
331  
332 I<Air Warfare in the Missile Age> by Lon O. Nordeen, Jr., published by
333 the Smithsonian Institution in 1985 and by Air and Armour Press in
334 1985, ISBN 0-85368-751-X, abbreviated as I<AWMA>.
335  
336 =back
337  
338 =head1 SOVIET EQUIPMENT
339  
340 =cut
341  
342 __DATA__
↑ Summary