line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes; |
2
|
|
|
|
|
|
|
|
3
|
40
|
|
|
40
|
|
26914
|
use 5.010001; |
|
40
|
|
|
|
|
173
|
|
4
|
40
|
|
|
40
|
|
234
|
use strict; |
|
40
|
|
|
|
|
113
|
|
|
40
|
|
|
|
|
835
|
|
5
|
40
|
|
|
40
|
|
213
|
use warnings; |
|
40
|
|
|
|
|
118
|
|
|
40
|
|
|
|
|
1036
|
|
6
|
40
|
|
|
40
|
|
224
|
use Readonly; |
|
40
|
|
|
|
|
91
|
|
|
40
|
|
|
|
|
2173
|
|
7
|
|
|
|
|
|
|
|
8
|
40
|
|
|
40
|
|
302
|
use Perl::Critic::Utils qw{ :severities }; |
|
40
|
|
|
|
|
116
|
|
|
40
|
|
|
|
|
2175
|
|
9
|
40
|
|
|
40
|
|
5334
|
use parent 'Perl::Critic::Policy'; |
|
40
|
|
|
|
|
120
|
|
|
40
|
|
|
|
|
267
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.146'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Readonly::Scalar my $DESC => q{Subroutine prototypes used}; |
16
|
|
|
|
|
|
|
Readonly::Scalar my $EXPL => [ 194 ]; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
19
|
|
|
|
|
|
|
|
20
|
91
|
|
|
91
|
0
|
1685
|
sub supported_parameters { return () } |
21
|
76
|
|
|
76
|
1
|
362
|
sub default_severity { return $SEVERITY_HIGHEST } |
22
|
92
|
|
|
92
|
1
|
399
|
sub default_themes { return qw(core pbp bugs certrec ) } |
23
|
38
|
|
|
38
|
1
|
146
|
sub applies_to { return 'PPI::Statement::Sub' } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub violates { |
28
|
9
|
|
|
9
|
1
|
27
|
my ( $self, $elem, undef ) = @_; |
29
|
9
|
100
|
|
|
|
38
|
if ( $elem->prototype() ) { |
30
|
2
|
|
|
|
|
123
|
return $self->violation( $DESC, $EXPL, $elem ); |
31
|
|
|
|
|
|
|
} |
32
|
7
|
|
|
|
|
281
|
return; #ok! |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=pod |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Perl::Critic::Policy::Subroutines::ProhibitSubroutinePrototypes - Don't write C<sub my_function (@@) {}>. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 AFFILIATION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
This Policy is part of the core L<Perl::Critic|Perl::Critic> |
50
|
|
|
|
|
|
|
distribution. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 DESCRIPTION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Contrary to common belief, subroutine prototypes do not enable |
56
|
|
|
|
|
|
|
compile-time checks for proper arguments. Don't use them. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 CONFIGURATION |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This Policy is not configurable except for the standard options. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
73
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
74
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# Local Variables: |
79
|
|
|
|
|
|
|
# mode: cperl |
80
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
81
|
|
|
|
|
|
|
# fill-column: 78 |
82
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
83
|
|
|
|
|
|
|
# c-indentation-style: bsd |
84
|
|
|
|
|
|
|
# End: |
85
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |