line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Checkstyle::Problem; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
216499
|
use strict; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
302
|
|
4
|
9
|
|
|
9
|
|
48
|
use warnings; |
|
9
|
|
|
|
|
17
|
|
|
9
|
|
|
|
|
370
|
|
5
|
|
|
|
|
|
|
|
6
|
9
|
|
|
9
|
|
2121
|
use overload q{""} => \&as_string; |
|
9
|
|
|
|
|
1490
|
|
|
9
|
|
|
|
|
107
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
47
|
|
|
47
|
1
|
3347
|
my ($class, $severity, $message, $line, $file) = @_; |
10
|
|
|
|
|
|
|
|
11
|
47
|
|
66
|
|
|
211
|
$class = ref $class || $class; |
12
|
47
|
100
|
100
|
|
|
252
|
if (defined $line && ref $line) { |
13
|
41
|
100
|
|
|
|
176
|
if (UNIVERSAL::isa($line, 'PPI::Element')) { |
14
|
39
|
|
|
|
|
197
|
$line = $line->location(); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
# Assume this is comming from a PPI::Element->location(); |
17
|
41
|
50
|
|
|
|
4402
|
if (ref $line eq 'ARRAY') { |
18
|
41
|
|
|
|
|
82
|
$line = $line->[0]; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
47
|
|
|
|
|
220
|
my $self = bless [ $severity, $message, $line, $file ], $class; |
23
|
47
|
|
|
|
|
178
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub as_string { |
27
|
4
|
|
|
4
|
1
|
11264
|
my $self = shift; |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
13
|
my $str = q{}; |
30
|
4
|
100
|
|
|
|
19
|
if (defined $self->[0]) { |
31
|
3
|
|
|
|
|
18
|
$str .= uc("[$self->[0]] "); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
4
|
100
|
|
|
|
20
|
if (defined $self->[1]) { |
35
|
3
|
|
|
|
|
8
|
$str .= $self->[1]; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
4
|
100
|
|
|
|
15
|
if (defined $self->[2]) { |
39
|
3
|
|
|
|
|
12
|
$str .= " at line $self->[2]"; |
40
|
|
|
|
|
|
|
} |
41
|
4
|
100
|
|
|
|
120
|
if (defined $self->[3]) { |
42
|
2
|
|
|
|
|
6
|
$str .= " in $self->[3]"; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
4
|
|
|
|
|
239
|
return $str; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub get_severity { |
49
|
4
|
|
|
4
|
1
|
971
|
return $_[0]->[0]; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub get_message { |
53
|
4
|
|
|
4
|
1
|
459
|
return $_[0]->[1]; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub get_line { |
57
|
4
|
|
|
4
|
1
|
35
|
return $_[0]->[2]; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub get_file { |
61
|
2
|
|
|
2
|
1
|
10
|
return $_[0]->[3]; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |
65
|
|
|
|
|
|
|
__END__ |