Class/Factory.pm

filter: Statementstmt 94.4% 34 / 36 Branchbran 87.5% 14 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 0.0% 0 / 1 totaltotal 92.0% 58 / 63 CC 9 SCAR 9.6
CC
9
Cov
92%
create
5.1
_check_is_variable
2.3
_check_is_separator
2.0
CRAP 2.6
« Relation.pm ↑ Summary Class/Base.pm »
1 package PlantUML::ClassDiagram::Class::Factory;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use PlantUML::ClassDiagram::Class::Method;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use PlantUML::ClassDiagram::Class::Variable;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 my $METHOD = 'PlantUML::ClassDiagram::Class::Method';
10 2 my $VARIABLE = 'PlantUML::ClassDiagram::Class::Variable';
11  
12 9 ▶sub create {
Subroutine create: called CC=5 SCAR=16.2
Pod undocumented
13 9 my ($class, $string) = @_;
14  
15 9 ▶ return undef if $class->_check_is_separator($string);
Branch: 1 branch
BranchTrueFalseTotal
if $class->_check_is_separator($string) 4 5 9
16 5 ▶ return undef if $class->_check_is_comment($string);
Branch: 1 branch
BranchTrueFalseTotal
if $class->_check_is_comment($string) 1 4 5
17  
18 4 ▶ return $METHOD->build($string) if $class->_check_is_method($string);
Branch: 1 branch
BranchTrueFalseTotal
if $class->_check_is_method($string) 3 1 4
19 1 ▶ return $VARIABLE->build($string) if $class->_check_is_variable($string);
Branch: 1 branch
BranchTrueFalseTotal
if $class->_check_is_variable($string) 1 0 1
20  
21 0 return undef;
22 }
23  
24 9 ▶sub _check_is_separator {
Subroutine _check_is_separator: called CC=2 SCAR=6.9
25 9 my ($class, $string) = @_;
26  
27 9 ▶ return 1 if ($string =~ /(--|__|==|\.\.)/);
Branch: 1 branch
BranchTrueFalseTotal
if $string =~ /(--|__|==|\.\.)/ 4 5 9
28 5 return 0;
29 }
30  
31 5 ▶sub _check_is_comment {
Subroutine _check_is_comment: called CC=2 SCAR=6.9
32 5 my ($class, $string) = @_;
33  
34 5 ▶ return 1 if ($string =~ /'.*'/);
Branch: 1 branch
BranchTrueFalseTotal
if $string =~ /'.*'/ 1 4 5
35 4 return 0;
36 }
37  
38 4 ▶sub _check_is_method {
Subroutine _check_is_method: called CC=2 SCAR=6.9
39 4 my ($class, $string) = @_;
40  
41 4 ▶ return 1 if ($string =~ /\w+\(.*\)/);
Branch: 1 branch
BranchTrueFalseTotal
if $string =~ /\w+\(.*\)/ 3 1 4
42 1 return 0;
43 }
44  
45 1 ▶sub _check_is_variable {
Subroutine _check_is_variable: called CC=2 SCAR=8.1
46 1 my ($class, $string) = @_;
47  
48 1 ▶ return 1 if ($string =~ /\w+/);
Branch: 1 branch
BranchTrueFalseTotal
if $string =~ /\w+/ 1 0 1
49 0 return 0;
50 }
51  
52 2 1;
« Relation.pm ↑ Summary Class/Base.pm »