Message.pm

filter: Statementstmt 100% 30 / 30 Branchbran 75.0% 3 / 4 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 95.7% 45 / 47 CC 4 SCAR 7.9
CC
4
Cov
97%
new
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
↑ Summary Message/Tag/Qt.pm »
1 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package WebService::ChatWork::Message;
4 8 ▶use Carp ( );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 8 ▶use String::CamelCase qw( camelize );
Subroutine BEGIN: called CC=1 SCAR=0.0
6 8 ▶use Class::Load qw( try_load_class );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 8 ▶use WebService::ChatWork::Message::Tag;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 # ABSTRACT: A Tag Builder of ChatWork
10  
11 8 our $VERSION = '0.02';
12  
13 13 ▶sub new {
Subroutine new: called CC=4 SCAR=13.9
Pod undocumented
14 13 my $class = shift;
15 13 my $tag = shift;
16 13 my @params = @_;
17 13 my $package = "$class\::Tag";
18  
19 13 ▶ if ( !@params && $tag ne "hr" ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not @params and $tag ne 'hr') { } 1 12 13
Condition100%3/3
not @params and $tag ne "hr"
!ll&&!rl&&r
1111
MC/DC100%2/2
not @params and $tag ne "hr"
not @params $tag ne "hr"
Truth table100%3/3
not(A) and B
A= not @paramsB= $tag ne "hr"
ABresult
0X0
100
111
20 1 @params = ( $tag );
21 1 $tag = q{};
22 }
23 else {
24 12 $package = sprintf "$class\::Tag::%s", camelize( $tag );
25 }
26  
27 13 ▶ try_load_class( $package )
Branch: 1 branch
BranchTrueFalseTotal
try_load_class($package) or die "Could not load $package." 13 0 13
28 or die "Could not load $package.";
29  
30 13 return $package->new( @params );
31 }
32  
33 8 1;
34  
35 __END__
↑ Summary Message/Tag/Qt.pm »