|
1 | 1 | % Perl::Critic::Violation::set_format('%m at line %l, column %c.'); |
2 | 2 | % |
3 | 3 | <div class="m-3 overflow-auto"> |
4 | | - <h2><%= maketext('PG Critic Results') %></h2> |
5 | | - % my @goodResults = grep { ref($_->explanation) eq 'HASH' && ($_->explanation->{score} // 0) > 0 } @$results; |
6 | | - % if (@goodResults) { |
7 | | - <h3 class="mt-2"><%= maketext('The following are good aspects of this problem:') %></h3> |
| 4 | + <h2><%= maketext('PG Critic Violations') %></h2> |
| 5 | + % my @pgCriticViolations = grep { $_->policy =~ /^Perl::Critic::Policy::PG::/ } @$violations; |
| 6 | + % if (@pgCriticViolations) { |
| 7 | + <h3 class="mt-2"><%= maketext('The following PG issues should be fixed:') %></h3> |
8 | 8 | <ul class="list-group"> |
9 | | - % for (@goodResults) { |
10 | | - <li class="list-group-item"> |
11 | | - <div><%= $_->to_string %></div> |
12 | | - <div> |
13 | | - <%= $_->explanation->{explanation} %> |
14 | | - See <%= link_to( |
15 | | - ($_->policy =~ s/^Perl::Critic::Policy:://r) |
16 | | - => pod_viewer => { filePath => 'lib/' . ($_->policy =~ s/::/\//gr) . '.pm' }, |
17 | | - target => '_blank' |
18 | | - ) %>. |
19 | | - </div> |
20 | | - </li> |
21 | | - % } |
22 | | - </ul> |
23 | | - %} |
24 | | - % my @badResults = grep { ref($_->explanation) eq 'HASH' && ($_->explanation->{score} // 0) < 0 } @$results; |
25 | | - % if (@badResults) { |
26 | | - <h3 class="mt-2"><%= maketext('The following are things that can be improved:') %></h3> |
27 | | - <ul class="list-group"> |
28 | | - % for (@badResults) { |
| 9 | + % for (@pgCriticViolations) { |
29 | 10 | <li class="list-group-item"> |
30 | 11 | <div><%= $_->to_string %></div> |
31 | 12 | <div> |
|
55 | 36 | % } |
56 | 37 | </ul> |
57 | 38 | %} |
58 | | - % my @badPerlResults = grep { !ref($_->explanation) } @$results; |
59 | | - % if (@badPerlResults) { |
60 | | - <h3 class="mt-2"><%= maketext('The following are general Perl issues that can be improved:') %></h3> |
| 39 | + % my @perlCriticViolations = grep { $_->policy !~ /^Perl::Critic::Policy::PG::/ } @$violations; |
| 40 | + % if (@perlCriticViolations) { |
| 41 | + <h3 class="mt-2"><%= maketext('The following general Perl issues should be fixed:') %></h3> |
61 | 42 | <ul class="list-group"> |
62 | | - % for (@badPerlResults) { |
| 43 | + % for (@perlCriticViolations) { |
63 | 44 | <li class="list-group-item"> |
64 | 45 | <div><%= $_->to_string %></div> |
65 | 46 | <div> |
|
0 commit comments