blib/lib/SWIFT/Factory/Tag/Tag17.pm

filter: Statementstmt 72.4% 21 / 29 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 70.0% 7 / 10 Podpod 100% 2 / 2 totaltotal 62.5% 30 / 48 CC 3 SCAR 13.7
CC
3
Cov
62%
_init
12.0
new
2.0
string
2.0
CRAP 3.9
↑ Summary
1 package SWIFT::Factory::Tag::Tag17;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 $VERSION='0.01';
7  
8 # Three potentially (and typically) overridden class methods.
9 1 ▶use constant TAG_ID=>'';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use constant INDICATOR_TRUE=>'Y';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use constant INDICATOR_FALSE=>'N';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶BEGIN{
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 *provide=*string;
15 }
16  
17 ###########################################################################################################
18 # Constructor. Rarely overridden.
19 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
20 0 my$self={};
21 0 bless($self,shift())->_init(@_);
22 }
23  
24 ###########################################################################################################
25 # Object method, potentially (but rarely) overridden.
26 # In normal cases, a subclass would override TAG_ID, INDICATOR_FALSE and INDICATOR_TRUE to achieve
27 # a specialized behaviour.
28 0 ▶sub string {
Subroutine string: not called CC=1 SCAR=6.9
Pod documented
29 0 my$self=shift;
30 ':17'.
31 $self->TAG_ID.
32 ':'.
33 $self->{INDICATOR}.
34 0 chr(13). # CR
35 chr(10); # LF
36 }
37  
38 ###########################################################################################################
39 ###########################################################################################################
40 #
41 # 'Internal' subs. Don't call these since they may, and will, change without notice.
42 #
43 ###########################################################################################################
44 ###########################################################################################################
45  
46 ###########################################################################################################
47 0 ▶sub _init {
Subroutine _init: not called CC=3 SCAR=24.8
48 0 my$self=shift();
49 0 my%args=(
50 INDICATOR=>'',
51 @_);
52  
53 0 ▶ $self->{INDICATOR}=(defined($args{INDICATOR})&&$args{INDICATOR}?$self->INDICATOR_TRUE:$self->INDICATOR_FALSE);
Branch: 1 branch
BranchTrueFalseTotal
defined $args{'INDICATOR'} && $args{'INDICATOR'} ? : 0 0 0
Condition0%0/3
defined $args{"INDICATOR"} and $args{"INDICATOR"}
!ll&&!rl&&r
000
MC/DC0%0/2
defined $args{"INDICATOR"} and $args{"INDICATOR"}
defined $args{"INDICATOR"} $args{"INDICATOR"}
Truth table0%0/3
A and B
A= defined $args{"INDICATOR"}B= $args{"INDICATOR"}
ABresult
0X0
100
111
54 0 $self;
55 }
56  
57 ###########################################################################################################
58 1 'Choppers rule';
59 __END__
↑ Summary