lib/CGI/FormBuilder/Messages/base.pm

filter: Statementstmt 95.6% 22 / 23 Branchbran 75.0% 6 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 2 totaltotal 84.6% 33 / 39 SCAR 16.1
CC
5
Cov
90%
define_messages
4.0
messages
2.1
__ANON__
1.0
CRAP 5.0
« blib/lib/CGI/FormBuilder/Field/file.pm ↑ Summary blib/lib/CGI/FormBuilder/Field/button.pm »
1  
2 ###########################################################################
3 # Copyright (c) Nate Wiger http://nateware.com. All Rights Reserved.
4 # Please visit http://formbuilder.org for tutorials, support, and examples.
5 ###########################################################################
6  
7 package CGI::FormBuilder::Messages::base;
8  
9 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 10 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 10 our $VERSION = '3.10';
13 10 our %MESSAGES = ();
14  
15 sub define_messages {
16 10 ▶ my $class = shift;
Subroutine define_messages: called CC=4 SCAR=13.9
Pod undocumented
17 10 ▶ my %hash = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_;
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq 'HASH' ? : 10 0 10
18 10 ▶ while(my($k,$v) = each %hash) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %hash) 400 10 410
19 400 $MESSAGES{$k} = $v; # support inheritance
20 }
21 {
22 10 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
23 10 ▶ while(my($k,$v) = each %MESSAGES) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %CGI::FormBuilder::Messages::base::MESSAGES) 400 10 410
24 400 ▶ *{$k} = sub { $v };
Subroutine __ANON__: not called CC=1 SCAR=0.4
25 }
26 }
27 }
28  
29 # This method should remain unchanged
30 sub messages {
31 125 ▶ return wantarray ? %MESSAGES : \%MESSAGES;
Subroutine messages: called CC=2 SCAR=7.6
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 125 0 125
32 }
33  
34 10 1;
35 __END__
« blib/lib/CGI/FormBuilder/Field/file.pm ↑ Summary blib/lib/CGI/FormBuilder/Field/button.pm »