blib/lib/Clownfish/CFC.pm

filter: Statementstmt 89.1% 437 / 490 Branchbran 52.7% 97 / 184 Conditioncond 50.0% 11 / 22 MC/DCmcdc 8.3% 1 / 12 Subroutinesub 86.4% 115 / 133 Podpod 0.0% 0 / 44 totaltotal 74.6% 661 / 885 CC 103 SCAR 16.1
CC
103
Cov
78%
new
24.6
new
12.0
new
12.0
CRAP 5.0
« lib/Clownfish/CFC/Perl/Build/Charmonic.pm ↑ Summary buildlib/Clownfish/CFC/Test/TestUtils.pm »
1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements. See the NOTICE file distributed with
3 # this work for additional information regarding copyright ownership.
4 # The ASF licenses this file to You under the Apache License, Version 2.0
5 # (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15  
16 43 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 43 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 package Clownfish::CFC;
20 43 our $VERSION = '0.008000';
21 43 $VERSION = eval $VERSION;
22 43 our $MAJOR_VERSION = 0.008000;
23  
24 43 ▶END {
Subroutine END: called CC=1 SCAR=0.0
25 43 Clownfish::CFC::Model::Parcel->reap_singletons();
26 }
27  
28 43 ▶use XSLoader;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 43 ▶BEGIN { XSLoader::load( 'Clownfish::CFC', '0.8.0' ) }
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 {
32 package Clownfish::CFC::Util;
33 43 ▶ use base qw( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
34 43 ▶ use Scalar::Util qw( blessed );
Subroutine BEGIN: called CC=1 SCAR=0.0
35 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 43 ▶ use Fcntl;
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 43 ▶ BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
39 43 our @EXPORT_OK = qw(
40 slurp_text
41 current
42 strip_c_comments
43 verify_args
44 a_isa_b
45 write_if_changed
46 trim_whitespace
47 is_dir
48 make_dir
49 make_path
50 );
51 }
52  
53 # Verify that named parameters exist in a defaults hash. Returns false
54 # and sets $@ if a problem is detected.
55 156 ▶ sub verify_args {
Subroutine verify_args: called CC=4 SCAR=13.9
Pod undocumented
56 156 my $defaults = shift; # leave the rest of @_ intact
57  
58 # Verify that args came in pairs.
59 156 ▶ if ( @_ % 2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ % 2) 1 155 156
60 1 my ( $package, $filename, $line ) = caller(1);
61 1 $@
62 = "Parameter error: odd number of args at $filename line $line\n";
63 1 return 0;
64 }
65  
66 # Verify keys, ignore values.
67 155 ▶ while (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 300 150 450
68 300 my ( $var, undef ) = ( shift, shift );
69 300 ▶ next if exists $defaults->{$var};
Branch: 1 branch
BranchTrueFalseTotal
if exists $defaults->{$var} 295 5 300
70 5 my ( $package, $filename, $line ) = caller(1);
71 5 $@ = "Invalid parameter: '$var' at $filename line $line\n";
72 5 return 0;
73 }
74  
75 150 return 1;
76 }
77  
78 8 ▶ sub a_isa_b {
Subroutine a_isa_b: called CC=2 SCAR=6.9
Pod undocumented
79 8 my ( $thing, $class ) = @_;
80 8 ▶ return 0 unless blessed($thing);
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($thing) 2 6 8
81 6 return $thing->isa($class);
82 }
83 }
84  
85 {
86 43 package Clownfish::CFC::Base;
87 }
88  
89 {
90 43 package Clownfish::CFC::Model::CBlock;
91 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
92 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
93 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
94  
95 43 our %new_PARAMS = ( contents => undef, );
96  
97 2 ▶ sub new {
Subroutine new: called CC=4 SCAR=14.1
Pod undocumented
98 2 my ( $either, %args ) = @_;
99 2 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 2 2
100 2 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::CBlock::new_PARAMS, %args) or confess($@) 2 0 2
101 confess("Missing required param 'contents'")
102 2 ▶ unless defined $args{contents};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args{"contents"} 1 1 2
103 1 return _new( $args{contents} );
104 }
105 }
106  
107 {
108 43 package Clownfish::CFC::Model::Class;
109 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
110 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
111 43 ▶ use Config;
Subroutine BEGIN: called CC=1 SCAR=0.0
112 43 ▶ use Clownfish::CFC::Util qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
113 verify_args
114 a_isa_b
115 43 );
116  
117 43 our %create_PARAMS = (
118 file_spec => undef,
119 class_name => undef,
120 nickname => undef,
121 parent_class_name => undef,
122 docucomment => undef,
123 inert => undef,
124 final => undef,
125 parcel => undef,
126 abstract => undef,
127 exposure => 'parcel',
128 );
129  
130 0 ▶ sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
131 0 confess(
132 "The constructor for Clownfish::CFC::Model::Class is create()");
133 }
134  
135 20 ▶ sub create {
Subroutine create: called CC=3 SCAR=11.3
Pod undocumented
136 20 my ( $either, %args ) = @_;
137 20 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 20 20
138 20 ▶ verify_args( \%create_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Class::create_PARAMS, %args) or confess($@) 20 0 20
139 $args{parcel}
140 20 = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
141 return _create(
142 @args{
143 20 qw( parcel exposure class_name nickname docucomment
144 file_spec parent_class_name final inert abstract)
145 }
146 );
147 }
148 }
149  
150 {
151 43 package Clownfish::CFC::Model::DocuComment;
152 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
153 }
154  
155 {
156 43 package Clownfish::CFC::Model::File;
157 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
158 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
159 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
160  
161 43 our %new_PARAMS = (
162 parcel => undef,
163 spec => undef,
164 );
165  
166 0 ▶ sub new {
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
167 0 my ( $either, %args ) = @_;
168 0 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 0 0
169 0 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::File::new_PARAMS, %args) or confess($@) 0 0 0
170 0 return _new( @args{ qw( parcel spec ) } );
171 }
172 }
173  
174 {
175 43 package Clownfish::CFC::Model::FileSpec;
176 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
177 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
178 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
179  
180 43 our %new_PARAMS = (
181 source_dir => undef,
182 path_part => undef,
183 ext => undef,
184 is_included => undef,
185 );
186  
187 8 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod undocumented
188 8 my ( $either, %args ) = @_;
189 8 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 8 8
190 8 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::FileSpec::new_PARAMS, %args) or confess($@) 8 0 8
191 8 return _new( @args{ qw( source_dir path_part ext is_included ) } );
192 }
193 }
194  
195 {
196 43 package Clownfish::CFC::Model::Function;
197 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Model::Symbol' }
Subroutine BEGIN: called CC=1 SCAR=0.0
198 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
199 43 ▶ use Clownfish::CFC::Util qw( verify_args a_isa_b );
Subroutine BEGIN: called CC=1 SCAR=0.0
200  
201 43 my %new_PARAMS = (
202 return_type => undef,
203 param_list => undef,
204 name => undef,
205 docucomment => undef,
206 inline => undef,
207 exposure => undef,
208 );
209  
210 4 ▶ sub new {
Subroutine new: called CC=4 SCAR=14.1
Pod undocumented
211 4 my ( $either, %args ) = @_;
212 4 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 4 4
213 4 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%new_PARAMS, %args) or confess($@) 3 1 4
214 3 ▶ $args{inline} ||= 0;
Condition50%1/2
$args{"inline"} ||= 0
l!l
03
MC/DC0%0/1
$args{"inline"} ||= 0
$args{"inline"}
Truth table50%1/2
A
A= $args{"inline"}
Aresult
11
00
215 return _new(
216 @args{
217 3 qw( exposure name return_type param_list docucomment inline )
218 }
219 );
220 }
221 }
222  
223 {
224 43 package Clownfish::CFC::Model::Hierarchy;
225 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
226 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
227 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
228  
229 43 our %new_PARAMS = (
230 dest => undef,
231 );
232  
233 2 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
234 2 my ( $either, %args ) = @_;
235 2 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 2 2
236 2 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Hierarchy::new_PARAMS, %args) or confess($@) 1 1 2
237 1 return _new( @args{qw( dest )} );
238 }
239 }
240  
241 {
242 43 package Clownfish::CFC::Model::Method;
243 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Model::Function' }
Subroutine BEGIN: called CC=1 SCAR=0.0
244 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
245 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
246  
247 43 my %new_PARAMS = (
248 return_type => undef,
249 param_list => undef,
250 name => undef,
251 docucomment => undef,
252 class => undef,
253 abstract => undef,
254 final => undef,
255 exposure => 'parcel',
256 );
257  
258 15 ▶ sub new {
Subroutine new: called CC=5 SCAR=16.6
Pod undocumented
259 15 my ( $either, %args ) = @_;
260 15 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%new_PARAMS, %args) or confess($@) 14 1 15
261 14 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 14 14
262 14 ▶ $args{abstract} ||= 0;
Condition50%1/2
$args{"abstract"} ||= 0
l!l
014
MC/DC0%0/1
$args{"abstract"} ||= 0
$args{"abstract"}
Truth table50%1/2
A
A= $args{"abstract"}
Aresult
11
00
263 14 ▶ $args{final} ||= 0;
Condition50%1/2
$args{"final"} ||= 0
l!l
014
MC/DC0%0/1
$args{"final"} ||= 0
$args{"final"}
Truth table50%1/2
A
A= $args{"final"}
Aresult
11
00
264 return _new(
265 @args{
266 14 qw( exposure name return_type param_list docucomment class
267 final abstract )
268 }
269 );
270 }
271 }
272  
273 {
274 43 package Clownfish::CFC::Model::ParamList;
275 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
276 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
277 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
278  
279 43 our %new_PARAMS = ( variadic => undef, );
280  
281 1 ▶ sub new {
Subroutine new: called CC=4 SCAR=14.6
Pod undocumented
282 1 my ( $either, %args ) = @_;
283 1 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::ParamList::new_PARAMS, %args) or confess($@) 1 0 1
284 1 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 1 1
285 1 ▶ my $variadic = delete $args{variadic} || 0;
Condition50%1/2
delete $args{'variadic'} || 0
l!l
01
MC/DC0%0/1
delete $args{'variadic'} || 0
delete $args{'variadic'}
Truth table50%1/2
A
A= delete $args{'variadic'}
Aresult
11
00
286 1 return _new($variadic);
287 }
288 }
289  
290 {
291 43 package Clownfish::CFC::Model::Parcel;
292 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
293 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
294 43 ▶ use Scalar::Util qw( blessed );
Subroutine BEGIN: called CC=1 SCAR=0.0
295 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
296  
297 43 our %new_PARAMS = (
298 name => undef,
299 nickname => undef,
300 version => undef,
301 major_version => undef,
302 file_spec => undef,
303 );
304  
305 14 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod undocumented
306 14 my ( $either, %args ) = @_;
307 14 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Parcel::new_PARAMS, %args) or confess($@) 14 0 14
308 14 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 14 14
309 14 return _new( @args{qw(
310 name nickname version major_version file_spec
311 )} );
312 }
313  
314 43 our %new_from_json_PARAMS = (
315 json => undef,
316 file_spec => undef,
317 );
318  
319 3 ▶ sub new_from_json {
Subroutine new_from_json: called CC=3 SCAR=11.4
Pod undocumented
320 3 my ( $either, %args ) = @_;
321 3 ▶ verify_args( \%new_from_json_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Parcel::new_from_json_PARAMS, %args) or confess($@) 3 0 3
322 3 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 3 3
323 3 return _new_from_json( @args{qw( json file_spec )} );
324 }
325  
326 43 our %new_from_file_PARAMS = (
327 file_spec => undef,
328 );
329  
330 1 ▶ sub new_from_file {
Subroutine new_from_file: called CC=3 SCAR=11.4
Pod undocumented
331 1 my ( $either, %args ) = @_;
332 1 ▶ verify_args( \%new_from_file_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Parcel::new_from_file_PARAMS, %args) or confess($@) 1 0 1
333 1 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 1 1
334 1 return _new_from_file( @args{qw( file_spec )} );
335 }
336  
337 # $parcel = Clownfish::CFC::Model::Parcel->acquire($parcel_name_or_parcel_object);
338 #
339 # Aquire a parcel one way or another. If the supplied argument is a
340 # Parcel, return it. If it's a name, fetch an existing Parcel or register
341 # a new one.
342 42 ▶ sub acquire {
Subroutine acquire: called CC=5 SCAR=16.3
Pod undocumented
343 42 my ( undef, $thing ) = @_;
344 42 ▶ if ( !defined $thing ) {
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $thing) { } 0 42 42
elsif (builtin::blessed($thing)) { } 6 36 42
345 0 confess("Missing required param 'parcel'");
346 }
347 elsif ( blessed($thing) ) {
348 6 ▶ confess("Not a Clownfish::CFC::Model::Parcel")
Branch: 1 branch
BranchTrueFalseTotal
unless $thing->isa("Clownfish::CFC::Model::Parcel") 0 6 6
349 unless $thing->isa('Clownfish::CFC::Model::Parcel');
350 6 return $thing;
351 }
352 else {
353 36 my $parcel = Clownfish::CFC::Model::Parcel->fetch($thing);
354 36 ▶ if ( !$parcel ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($parcel) 4 32 36
355 4 $parcel
356 = Clownfish::CFC::Model::Parcel->new( name => $thing, );
357 4 $parcel->register;
358 }
359 36 return $parcel;
360 }
361 }
362 }
363  
364 {
365 43 package Clownfish::CFC::Parser;
366 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
367 }
368  
369 {
370 43 package Clownfish::CFC::Parser;
371 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
372 }
373  
374 {
375 43 package Clownfish::CFC::Model::Prereq;
376 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
377 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
378 43 ▶ use Scalar::Util qw( blessed );
Subroutine BEGIN: called CC=1 SCAR=0.0
379 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
380  
381 43 our %new_PARAMS = (
382 name => undef,
383 version => undef,
384 );
385  
386 1 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod undocumented
387 1 my ( $either, %args ) = @_;
388 1 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Prereq::new_PARAMS, %args) or confess($@) 1 0 1
389 1 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 1 1
390 1 return _new( @args{qw( name version )} );
391 }
392 }
393  
394 {
395 43 package Clownfish::CFC::Model::Symbol;
396 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
397 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
398 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
399  
400 43 my %new_PARAMS = (
401 exposure => undef,
402 name => undef,
403 );
404  
405 13 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod undocumented
406 13 my ( $either, %args ) = @_;
407 13 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%new_PARAMS, %args) or confess($@) 13 0 13
408 13 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 13 13
409 return _new(
410 13 @args{qw( exposure name )} );
411 }
412 }
413  
414 {
415 43 package Clownfish::CFC::Model::Type;
416 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
417 43 ▶ use Clownfish::CFC::Util qw( verify_args a_isa_b );
Subroutine BEGIN: called CC=1 SCAR=0.0
418 43 ▶ use Scalar::Util qw( blessed );
Subroutine BEGIN: called CC=1 SCAR=0.0
419 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
420  
421 43 our %new_PARAMS = (
422 const => undef,
423 specifier => undef,
424 indirection => undef,
425 parcel => undef,
426 void => undef,
427 object => undef,
428 primitive => undef,
429 integer => undef,
430 floating => undef,
431 cfish_string => undef,
432 va_list => undef,
433 arbitrary => undef,
434 composite => undef,
435 );
436  
437 5 ▶ sub new {
Subroutine new: called CC=18 SCAR=32.0
Pod undocumented
438 5 my ( $either, %args ) = @_;
439 5 ▶ my $package = ref($either) || $either;
Condition33%1/3
ref $either || $either
l!l&&r!l&&!r
050
MC/DC0%0/2
ref $either || $either
ref $either $either
Truth table33%1/3
A || B
A= ref $eitherB= $either
ABresult
1X1
011
000
440 5 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 5 5
441 5 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Type::new_PARAMS, %args) or confess($@) 5 0 5
442  
443 5 my $flags = 0;
444 5 ▶ $flags |= CONST if $args{const};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"const"} 1 4 5
445 5 ▶ $flags |= NULLABLE if $args{nullable};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"nullable"} 0 5 5
446 5 ▶ $flags |= VOID if $args{void};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"void"} 0 5 5
447 5 ▶ $flags |= OBJECT if $args{object};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"object"} 0 5 5
448 5 ▶ $flags |= PRIMITIVE if $args{primitive};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"primitive"} 4 1 5
449 5 ▶ $flags |= INTEGER if $args{integer};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"integer"} 0 5 5
450 5 ▶ $flags |= FLOATING if $args{floating};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"floating"} 0 5 5
451 5 ▶ $flags |= CFISH_STRING if $args{cfish_string};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"cfish_string"} 0 5 5
452 5 ▶ $flags |= VA_LIST if $args{va_list};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"va_list"} 0 5 5
453 5 ▶ $flags |= ARBITRARY if $args{arbitrary};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"arbitrary"} 0 5 5
454 5 ▶ $flags |= COMPOSITE if $args{composite};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"composite"} 0 5 5
455  
456 my $parcel
457 = $args{parcel}
458 ? Clownfish::CFC::Model::Parcel->acquire( $args{parcel} )
459 5 ▶ : $args{parcel};
Branch: 1 branch
BranchTrueFalseTotal
$args{'parcel'} ? : 1 4 5
460  
461 5 ▶ my $indirection = $args{indirection} || 0;
Condition50%1/2
$args{'indirection'} || 0
l!l
05
MC/DC0%0/1
$args{'indirection'} || 0
$args{'indirection'}
Truth table50%1/2
A
A= $args{'indirection'}
Aresult
11
00
462 5 ▶ my $specifier = $args{specifier} || '';
Condition50%1/2
$args{'specifier'} || ''
l!l
50
MC/DC0%0/1
$args{'specifier'} || ''
$args{'specifier'}
Truth table50%1/2
A
A= $args{'specifier'}
Aresult
11
00
463  
464 5 return _new( $flags, $parcel, $specifier, $indirection );
465 }
466  
467 43 our %new_integer_PARAMS = (
468 const => undef,
469 specifier => undef,
470 );
471  
472 1 ▶ sub new_integer {
Subroutine new_integer: called CC=4 SCAR=14.5
Pod undocumented
473 1 my ( $either, %args ) = @_;
474 1 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 1 1
475 1 ▶ verify_args( \%new_integer_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Type::new_integer_PARAMS, %args) or confess($@) 1 0 1
476 1 my $flags = 0;
477 1 ▶ $flags |= CONST if $args{const};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"const"} 1 0 1
478 1 return _new_integer( $flags, $args{specifier} );
479 }
480  
481 43 our %new_float_PARAMS = (
482 const => undef,
483 specifier => undef,
484 );
485  
486 1 ▶ sub new_float {
Subroutine new_float: called CC=4 SCAR=14.5
Pod undocumented
487 1 my ( $either, %args ) = @_;
488 1 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 1 1
489 1 ▶ verify_args( \%new_float_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Type::new_float_PARAMS, %args) or confess($@) 1 0 1
490 1 my $flags = 0;
491 1 ▶ $flags |= CONST if $args{const};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"const"} 1 0 1
492 1 return _new_float( $flags, $args{specifier} );
493 }
494  
495 43 our %new_object_PARAMS = (
496 const => undef,
497 specifier => undef,
498 indirection => 1,
499 parcel => undef,
500 incremented => 0,
501 decremented => 0,
502 nullable => 0,
503 );
504  
505 18 ▶ sub new_object {
Subroutine new_object: called CC=10 SCAR=23.4
Pod undocumented
506 18 my ( $either, %args ) = @_;
507 18 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 18 18
508 18 ▶ verify_args( \%new_object_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Type::new_object_PARAMS, %args) or confess($@) 18 0 18
509 18 my $flags = 0;
510 18 ▶ $flags |= INCREMENTED if $args{incremented};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"incremented"} 1 17 18
511 18 ▶ $flags |= DECREMENTED if $args{decremented};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"decremented"} 1 17 18
512 18 ▶ $flags |= NULLABLE if $args{nullable};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"nullable"} 0 18 18
513 18 ▶ $flags |= CONST if $args{const};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"const"} 1 17 18
514 18 ▶ $args{indirection} = 1 unless defined $args{indirection};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args{"indirection"} 16 2 18
515 18 my $parcel = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
516 18 ▶ my $package = ref($either) || $either;
Condition33%1/3
ref $either || $either
l!l&&r!l&&!r
0180
MC/DC0%0/2
ref $either || $either
ref $either $either
Truth table33%1/3
A || B
A= ref $eitherB= $either
ABresult
1X1
011
000
517 confess("Missing required param 'specifier'")
518 18 ▶ unless defined $args{specifier};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args{"specifier"} 1 17 18
519 return _new_object( $flags, $parcel, $args{specifier},
520 17 $args{indirection} );
521 }
522  
523 43 our %new_composite_PARAMS = (
524 child => undef,
525 indirection => undef,
526 array => undef,
527 nullable => undef,
528 );
529  
530 4 ▶ sub new_composite {
Subroutine new_composite: called CC=6 SCAR=18.6
Pod undocumented
531 4 my ( $either, %args ) = @_;
532 4 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 4 4
533 4 ▶ verify_args( \%new_composite_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Type::new_composite_PARAMS, %args) or confess($@) 4 0 4
534 4 my $flags = 0;
535 4 ▶ $flags |= NULLABLE if $args{nullable};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"nullable"} 0 4 4
536 4 ▶ my $indirection = $args{indirection} || 0;
Condition100%2/2
$args{'indirection'} || 0
l!l
31
MC/DC100%1/1
$args{'indirection'} || 0
$args{'indirection'}
Truth table100%2/2
A
A= $args{'indirection'}
Aresult
11
00
537 4 ▶ my $array = defined $args{array} ? $args{array} : "";
Branch: 1 branch
BranchTrueFalseTotal
defined $args{'array'} ? : 0 4 4
538 4 return _new_composite( $flags, $args{child}, $indirection, $array );
539 }
540  
541 43 our %new_void_PARAMS = ( const => undef, );
542  
543 2 ▶ sub new_void {
Subroutine new_void: called CC=3 SCAR=11.4
Pod undocumented
544 2 my ( $either, %args ) = @_;
545 2 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 2 2
546 2 ▶ verify_args( \%new_void_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Type::new_void_PARAMS, %args) or confess($@) 2 0 2
547 2 return _new_void( !!$args{const} );
548 }
549  
550 1 ▶ sub new_va_list {
Subroutine new_va_list: called CC=3 SCAR=11.4
Pod undocumented
551 1 my $either = shift;
552 1 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 1 1
553 1 ▶ verify_args( {}, @_ ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(scalar {}, @_) or confess($@) 1 0 1
554 1 return _new_va_list();
555 }
556  
557 43 our %new_arbitrary_PARAMS = (
558 parcel => undef,
559 specifier => undef,
560 );
561  
562 3 ▶ sub new_arbitrary {
Subroutine new_arbitrary: called CC=3 SCAR=11.3
Pod undocumented
563 3 my ( $either, %args ) = @_;
564 3 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 3 3
565 3 ▶ verify_args( \%new_arbitrary_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Type::new_arbitrary_PARAMS, %args) or confess($@) 3 0 3
566 3 my $parcel = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
567 3 return _new_arbitrary( $parcel, $args{specifier} );
568 }
569 }
570  
571 {
572 43 package Clownfish::CFC::Model::Variable;
573 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Model::Symbol' }
Subroutine BEGIN: called CC=1 SCAR=0.0
574 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
575 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
576  
577 43 our %new_PARAMS = (
578 type => undef,
579 name => undef,
580 exposure => 'local',
581 inert => undef,
582 );
583  
584 8 ▶ sub new {
Subroutine new: called CC=4 SCAR=14.1
Pod undocumented
585 8 my ( $either, %args ) = @_;
586 8 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 8 8
587 8 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Variable::new_PARAMS, %args) or confess($@) 7 1 8
588 7 ▶ $args{exposure} ||= 'local';
Condition50%1/2
$args{"exposure"} ||= "local"
l!l
07
MC/DC0%0/1
$args{"exposure"} ||= "local"
$args{"exposure"}
Truth table50%1/2
A
A= $args{"exposure"}
Aresult
11
00
589 return _new(
590 @args{
591 7 qw( exposure name type inert )
592 }
593 );
594 }
595 }
596  
597 {
598 43 package Clownfish::CFC::Model::Version;
599 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
600 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
601 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
602  
603 43 our %new_PARAMS = (
604 vstring => undef,
605 );
606  
607 10 ▶ sub new {
Subroutine new: called CC=3 SCAR=11.4
Pod undocumented
608 10 my ( $either, %args ) = @_;
609 10 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 10 10
610 10 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Model::Version::new_PARAMS, %args) or confess($@) 10 0 10
611 10 return _new( $args{vstring} );
612 }
613 }
614  
615 {
616 43 package Clownfish::CFC::Binding::Core;
617 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
618 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
619 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
620  
621 43 our %new_PARAMS = (
622 hierarchy => undef,
623 header => undef,
624 footer => undef,
625 );
626  
627 0 ▶ sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
628 0 my ( $either, %args ) = @_;
629 0 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Binding::Core::new_PARAMS, %args) or confess($@) 0 0 0
630 0 return _new( @args{qw( hierarchy header footer )} );
631 }
632 }
633  
634 {
635 43 package Clownfish::CFC::Binding::Core::Class;
636 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
637 43 ▶ use Clownfish::CFC::Util qw( a_isa_b verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
638 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
639  
640 43 our %new_PARAMS = ( client => undef, );
641  
642 0 ▶ sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
643 0 my ( $either, %args ) = @_;
644 0 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Binding::Core::Class::new_PARAMS, %args) or confess($@) 0 0 0
645 0 return _new( $args{client} );
646 }
647 }
648  
649 {
650 43 package Clownfish::CFC::Binding::Core::File;
651 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
652 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
653  
654 43 my %write_h_PARAMS = (
655 file => undef,
656 dest => undef,
657 header => undef,
658 footer => undef,
659 );
660  
661 0 ▶ sub write_h {
Subroutine write_h: not called CC=2 SCAR=17.9
Pod undocumented
662 0 my ( undef, %args ) = @_;
663 0 ▶ verify_args( \%write_h_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%write_h_PARAMS, %args) or confess($@) 0 0 0
664 0 _write_h( @args{qw( file dest header footer )} );
665 }
666 }
667  
668 {
669 43 package Clownfish::CFC::Binding::Core::Method;
670  
671 0 ▶ sub method_def {
Subroutine method_def: not called CC=1 SCAR=6.9
Pod undocumented
672 0 my ( undef, %args ) = @_;
673 0 return _method_def( @args{qw( method class )} );
674 }
675  
676 0 ▶ sub callback_obj_def {
Subroutine callback_obj_def: not called CC=1 SCAR=6.9
Pod undocumented
677 0 my ( undef, %args ) = @_;
678 0 return _callback_obj_def( @args{qw( method offset )} );
679 }
680 }
681  
682 {
683 43 package Clownfish::CFC::Binding::Perl;
684 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
685 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
686 43 ▶ use Clownfish::CFC::Util qw( verify_args a_isa_b );
Subroutine BEGIN: called CC=1 SCAR=0.0
687  
688 43 our %new_PARAMS = (
689 hierarchy => undef,
690 lib_dir => undef,
691 header => undef,
692 footer => undef,
693 );
694  
695 0 ▶ sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
696 0 my ( $either, %args ) = @_;
697 0 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Binding::Perl::new_PARAMS, %args) or confess($@) 0 0 0
698 return _new(
699 0 @args{qw( hierarchy lib_dir header footer )} );
700 }
701  
702 0 ▶ sub write_bindings {
Subroutine write_bindings: not called CC=1 SCAR=6.9
Pod undocumented
703 0 my ( $self, %args ) = @_;
704 $args{parcels} = [ map {
705 0 Clownfish::CFC::Model::Parcel->acquire($_);
706 0 } @{ $args{parcels} } ];
707 0 return $self->_write_bindings( @args{qw( boot_class parcels )} );
708 }
709 }
710  
711 {
712 43 package Clownfish::CFC::Binding::Perl::Class;
713 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
714 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
715 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
716  
717 43 our %new_PARAMS = (
718 parcel => undef,
719 class_name => undef,
720 );
721  
722 0 ▶ sub new {
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
723 0 my ( $either, %args ) = @_;
724 0 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Binding::Perl::Class::new_PARAMS, %args) or confess($@) 0 0 0
725 0 ▶ if ( exists( $args{parcel} ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $args{"parcel"}) 0 0 0
726 $args{parcel}
727 0 = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
728 }
729 0 return _new( @args{qw( parcel class_name )} );
730 }
731  
732 43 our %bind_method_PARAMS = (
733 alias => undef,
734 method => undef,
735 );
736  
737 0 ▶ sub bind_method {
Subroutine bind_method: not called CC=2 SCAR=17.9
Pod undocumented
738 0 my ( $self, %args ) = @_;
739 0 ▶ verify_args( \%bind_method_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Binding::Perl::Class::bind_method_PARAMS, %args) or confess($@) 0 0 0
740 0 _bind_method( $self, @args{qw( alias method )} );
741 }
742  
743 43 our %bind_constructor_PARAMS = (
744 alias => undef,
745 initializer => undef,
746 );
747  
748 0 ▶ sub bind_constructor {
Subroutine bind_constructor: not called CC=2 SCAR=17.9
Pod undocumented
749 0 my ( $self, %args ) = @_;
750 0 ▶ verify_args( \%bind_constructor_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%Clownfish::CFC::Binding::Perl::Class::bind_constructor_PARAMS, %args) or confess($@) 0 0 0
751 0 _bind_constructor( $self, @args{qw( alias initializer )} );
752 }
753 }
754  
755 {
756 43 package Clownfish::CFC::Binding::Perl::Constructor;
757 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Binding::Perl::Subroutine' }
Subroutine BEGIN: called CC=1 SCAR=0.0
758 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
759 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
760  
761 43 our %new_PARAMS = (
762 class => undef,
763 alias => undef,
764 initializer => undef,
765 );
766  
767 0 ▶ sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
768 0 my ( $either, %args ) = @_;
769 0 ▶ confess $@ unless verify_args( \%new_PARAMS, %args );
Branch: 1 branch
BranchTrueFalseTotal
unless verify_args(\%Clownfish::CFC::Binding::Perl::Constructor::new_PARAMS, %args) 0 0 0
770 0 return _new( @args{qw( class alias initializer )} );
771 }
772 }
773  
774 {
775 43 package Clownfish::CFC::Binding::Perl::Method;
776 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Binding::Perl::Subroutine' }
Subroutine BEGIN: called CC=1 SCAR=0.0
777 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
778 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
779  
780 43 our %new_PARAMS = (
781 method => undef,
782 alias => undef,
783 );
784  
785 0 ▶ sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
786 0 my ( $either, %args ) = @_;
787 0 ▶ confess $@ unless verify_args( \%new_PARAMS, %args );
Branch: 1 branch
BranchTrueFalseTotal
unless verify_args(\%Clownfish::CFC::Binding::Perl::Method::new_PARAMS, %args) 0 0 0
788 0 return _new( @args{qw( method alias )} );
789 }
790 }
791  
792 {
793 43 package Clownfish::CFC::Binding::Perl::Pod;
794 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
795 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
796 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
797  
798 43 my %add_method_PARAMS = (
799 alias => undef,
800 method => undef,
801 sample => undef,
802 pod => undef,
803 );
804  
805 0 ▶ sub add_method {
Subroutine add_method: not called CC=2 SCAR=17.9
Pod undocumented
806 0 my ( $self, %args ) = @_;
807 0 ▶ verify_args( \%add_method_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%add_method_PARAMS, %args) or confess($@) 0 0 0
808 0 _add_method( $self, @args{qw( alias method sample pod )} );
809 }
810  
811 43 my %add_constructor_PARAMS = (
812 alias => undef,
813 pod_func => undef,
814 sample => undef,
815 pod => undef,
816 );
817  
818 0 ▶ sub add_constructor {
Subroutine add_constructor: not called CC=2 SCAR=17.9
Pod undocumented
819 0 my ( $self, %args ) = @_;
820 0 ▶ verify_args( \%add_constructor_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%add_constructor_PARAMS, %args) or confess($@) 0 0 0
821 0 _add_constructor( $self, @args{qw( alias pod_func sample pod )} );
822 }
823 }
824  
825 {
826 43 package Clownfish::CFC::Binding::Perl::Subroutine;
827 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
828 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
829 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
830  
831 0 ▶ sub xsub_def { confess "Abstract method" }
Subroutine xsub_def: not called CC=1 SCAR=6.9
Pod undocumented
832 }
833  
834 {
835 43 package Clownfish::CFC::Binding::Perl::TypeMap;
836 43 ▶ use base qw( Exporter );
Subroutine BEGIN: called CC=1 SCAR=0.0
837  
838 43 our @EXPORT_OK = qw( from_perl to_perl );
839  
840 0 ▶ sub write_xs_typemap {
Subroutine write_xs_typemap: not called CC=1 SCAR=6.9
Pod undocumented
841 0 my ( undef, %args ) = @_;
842 0 _write_xs_typemap( $args{hierarchy} );
843 }
844 }
845  
846 {
847 43 package Clownfish::CFC::Test;
848 43 ▶ BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
Subroutine BEGIN: called CC=1 SCAR=0.0
849 43 ▶ use Clownfish::CFC::Util qw( verify_args );
Subroutine BEGIN: called CC=1 SCAR=0.0
850 43 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
851  
852 43 my %new_PARAMS = (
853 formatter_name => 'tap',
854 );
855  
856 16 ▶ sub new {
Subroutine new: called CC=4 SCAR=14.6
Pod undocumented
857 16 my ( $either, %args ) = @_;
858 16 ▶ verify_args( \%new_PARAMS, %args ) or confess $@;
Branch: 1 branch
BranchTrueFalseTotal
verify_args(\%new_PARAMS, %args) or confess($@) 16 0 16
859 16 ▶ confess "no subclassing allowed" unless $either eq __PACKAGE__;
Branch: 1 branch
BranchTrueFalseTotal
unless $either eq __PACKAGE__ 0 16 16
860 16 ▶ $args{formatter_name} = 'tap' unless defined $args{formatter_name};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args{"formatter_name"} 16 0 16
861 16 return _new( @args{qw( formatter_name )} );
862 }
863 }
864  
865 43 1;
866  
« lib/Clownfish/CFC/Perl/Build/Charmonic.pm ↑ Summary buildlib/Clownfish/CFC/Test/TestUtils.pm »