blib/lib/App/Project/Doctor/Check/Base.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 85.7% 6 / 7 totaltotal 97.5% 39 / 40 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« /usr/local/bin/prove ↑ Summary blib/lib/App/Project/Doctor/Check/Role.pm »
1 package App::Project::Doctor::Check::Base;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use autodie qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 our $VERSION = '0.02';
10  
11 # ---------------------------------------------------------------------------
12 # Constructor
13 # ---------------------------------------------------------------------------
14  
15 153 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
16 153 my ($class, %args) = @_;
17 153 return bless {%args}, $class;
18 }
19  
20 # ---------------------------------------------------------------------------
21 # Required interface -- subclasses MUST override these three
22 # ---------------------------------------------------------------------------
23  
24 =head2 name (required)
25  
26 Short label used in the report table, e.g. C<Tests>.
27  
28 =cut
29  
30 2 ▶sub name {
Subroutine name: called CC=1 SCAR=0.0
Pod documented
31 2 croak ref(shift) . ' must implement name()';
32 }
33  
34 =head2 description (required)
35  
36 One-sentence description of what the check verifies.
37  
38 =cut
39  
40 2 ▶sub description {
Subroutine description: called CC=1 SCAR=0.0
Pod documented
41 2 croak ref(shift) . ' must implement description()';
42 }
43  
44 =head2 check( $context ) (required)
45  
46 Accepts an L<App::Project::Doctor::Context> and returns a list of
47 L<App::Project::Doctor::Finding> objects (empty list on a clean pass).
48  
49 =cut
50  
51 4 ▶sub check {
Subroutine check: called CC=1 SCAR=0.0
Pod documented
52 4 croak ref(shift) . ' must implement check()';
53 }
54  
55 # ---------------------------------------------------------------------------
56 # Optional interface with sensible defaults
57 # ---------------------------------------------------------------------------
58  
59 =head2 can_fix
60  
61 Returns true when this check can produce fixable findings. Default 0.
62  
63 =cut
64  
65 5 ▶sub can_fix { 0 }
Subroutine can_fix: called CC=1 SCAR=0.0
Pod documented
66  
67 =head2 category
68  
69 Grouping label for report presentation. Default C<general>.
70  
71 =cut
72  
73 15 ▶sub category { 'general' }
Subroutine category: called CC=1 SCAR=0.0
Pod documented
74  
75 =head2 order
76  
77 Numeric sort key: lower numbers appear first in the report. Default 50.
78  
79 =cut
80  
81 5 ▶sub order { 50 }
Subroutine order: called CC=1 SCAR=0.0
Pod documented
82  
83 5 1;
84  
85 __END__
« /usr/local/bin/prove ↑ Summary blib/lib/App/Project/Doctor/Check/Role.pm »