line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use utf8; |
3
|
2
|
|
|
2
|
|
104967
|
|
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
12
|
|
4
|
|
|
|
|
|
|
use 5.010; |
5
|
2
|
|
|
2
|
|
101
|
|
|
2
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
use strict; |
7
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
47
|
|
8
|
2
|
|
|
2
|
|
10
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
108
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
1; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=pod |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=encoding utf8 |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Mardem::RefactoringPerlCriticPolicies - Perl-Critic policies for simple and isolated Refactoring-Support. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 VERSION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Version 0.01 |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
This Perl-Crictic Policy-Modules should help where to start a safe |
31
|
|
|
|
|
|
|
refactoring in old leagacy Perl code. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
The McCabe complexity check within the standard Perl-Critic Module are a good |
34
|
|
|
|
|
|
|
overall starting point see: |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=over 4 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=item * L<Perl::Critic::Policy::Modules::ProhibitExcessMainComplexity> |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=item * L<Perl::Critic::Policy::Subroutines::ProhibitExcessComplexity> |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=back |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
but these are for some bigger scans, so these new policies should check (or begin) in smaller chunks: |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 L<Perl::Critic::Policy::Mardem::ProhibitReturnBooleanAsInt> |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
return boolean as int "return 1;" |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 L<Perl::Critic::Policy::Mardem::ProhibitConditionComplexity> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
condition complexity "if/while/for/... (...){}" |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 L<Perl::Critic::Policy::Mardem::ProhibitManyConditionsInSub> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
subs has many conditionals "if, while, for, ..." |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 L<Perl::Critic::Policy::Mardem::ProhibitLargeBlock> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
large code block as statement count "{...}" |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 L<Perl::Critic::Policy::Mardem::ProhibitBlockComplexity> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
code block complexity "{...}" |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 L<Perl::Critic::Policy::Mardem::ProhibitLargeSub> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
large subs as statement count |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AFFILIATION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This module has no functionality, but instead contains documentation for this |
73
|
|
|
|
|
|
|
distribution and acts as a means of pulling other modules into a bundle. |
74
|
|
|
|
|
|
|
All of the Policy modules contained herein will have an "AFFILIATION" section |
75
|
|
|
|
|
|
|
announcing their participation in this grouping. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 BUG REPORTS |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Please report bugs on GitHub. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
The source code repository can be found at L<https://github.com/mardem1//mardem-refactoring-perlcritic-policies> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Markus Demml, mardem@cpan.com |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Copyright (c) 2022, Markus Demml |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it |
92
|
|
|
|
|
|
|
under the same terms as the Perl 5 programming language system itself. |
93
|
|
|
|
|
|
|
The full text of this license can be found in the LICENSE file included |
94
|
|
|
|
|
|
|
with this module. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 DISCLAIMER |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
This package is distributed in the hope that it will be useful, but WITHOUT |
99
|
|
|
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
100
|
|
|
|
|
|
|
FOR A PARTICULAR PURPOSE. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=cut |