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