line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PlantUML::ClassDiagram::Class::Factory; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
14184
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
68
|
|
4
|
3
|
|
|
3
|
|
7
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
51
|
|
5
|
3
|
|
|
3
|
|
8
|
use utf8; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
11
|
|
6
|
3
|
|
|
3
|
|
664
|
use PlantUML::ClassDiagram::Class::Method; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
14
|
|
7
|
3
|
|
|
3
|
|
729
|
use PlantUML::ClassDiagram::Class::Variable; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
11
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $METHOD = 'PlantUML::ClassDiagram::Class::Method'; |
10
|
|
|
|
|
|
|
my $VARIABLE = 'PlantUML::ClassDiagram::Class::Variable'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub create { |
13
|
53
|
|
|
53
|
0
|
2996
|
my ($class, $string) = @_; |
14
|
|
|
|
|
|
|
|
15
|
53
|
100
|
|
|
|
64
|
return undef if $class->_check_is_separator($string); |
16
|
49
|
100
|
|
|
|
62
|
return undef if $class->_check_is_comment($string); |
17
|
|
|
|
|
|
|
|
18
|
48
|
100
|
|
|
|
54
|
return $METHOD->build($string) if $class->_check_is_method($string); |
19
|
31
|
100
|
|
|
|
35
|
return $VARIABLE->build($string) if $class->_check_is_variable($string); |
20
|
|
|
|
|
|
|
|
21
|
10
|
|
|
|
|
14
|
return undef; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _check_is_separator { |
25
|
53
|
|
|
53
|
|
38
|
my ($class, $string) = @_; |
26
|
|
|
|
|
|
|
|
27
|
53
|
100
|
|
|
|
147
|
return 1 if ($string =~ /(--|__|==|\.\.)/); |
28
|
49
|
|
|
|
|
78
|
return 0; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _check_is_comment { |
32
|
49
|
|
|
49
|
|
42
|
my ($class, $string) = @_; |
33
|
|
|
|
|
|
|
|
34
|
49
|
100
|
|
|
|
78
|
return 1 if ($string =~ /'.*'/); |
35
|
48
|
|
|
|
|
66
|
return 0; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _check_is_method { |
39
|
48
|
|
|
48
|
|
37
|
my ($class, $string) = @_; |
40
|
|
|
|
|
|
|
|
41
|
48
|
100
|
|
|
|
157
|
return 1 if ($string =~ /\w+\(.*\)/); |
42
|
31
|
|
|
|
|
46
|
return 0; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _check_is_variable { |
46
|
31
|
|
|
31
|
|
24
|
my ($class, $string) = @_; |
47
|
|
|
|
|
|
|
|
48
|
31
|
100
|
|
|
|
133
|
return 1 if ($string =~ /\w+/); |
49
|
10
|
|
|
|
|
14
|
return 0; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |