Report/Score.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 85.7% 24 / 28 SCAR 0.0
CC
1
Cov
90%
as_string
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Report/Distribution.pm ↑ Summary
1 package CPANTS::Kwalitee::Report::Score;
2  
3 3 $CPANTS::Kwalitee::Report::Score::VERSION = '0.09';
4 3 $CPANTS::Kwalitee::Report::Score::AUTHORITY = 'cpan:MANWAR';
5  
6 =head1 NAME
7  
8 CPANTS::Kwalitee::Report::Score - Interface to Kwalitee Score.
9  
10 =head1 VERSION
11  
12 Version 0.09
13  
14 =cut
15  
16 3 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 3 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 3 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 3 ▶use overload q{""} => 'as_string', fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 3 has 'indicator' => (is => 'ro');
25 3 has 'value' => (is => 'ro');
26  
27 =head1 DESCRIPTION
28  
29 It represents the kwalitee score details.
30  
31 =head1 SYNOPSIS
32  
33 use strict; use warnings;
34 use CPANTS::Kwalitee::Report;
35  
36 my $report = CPANTS::Kwalitee::Report->new;
37  
38 my $dist = $report->scores('Map::Tube');
39 my $scores = $dist->scores;
40  
41 print sprintf("Indicator: %s\n", $scores->[0]->indicator);
42 print sprintf("Value : %d\n", $scores->[0]->value);
43  
44 =head1 METHODS
45  
46 =head2 indicator()
47  
48 Returns an object of type L<CPANTS::Kwalitee::Report::Indicator>.
49  
50 =head2 value()
51  
52 Returns the indicator value assigned to the corresponding distribution.
53  
54 =cut
55  
56 sub as_string {
57 0 ▶ my ($self) = @_;
Subroutine as_string: not called CC=1 SCAR=6.9
Pod undocumented
58  
59 0 return sprintf("%s: %d", $self->indicator->name, $self->value);
60 }
61  
62 =head1 AUTHOR
63  
64 Mohammad S Anwar, C<< <mohammad.anwar at yahoo.com> >>
65  
66 =head1 REPOSITORY
67  
68 L<https://github.com/manwar/CPANTS-Kwalitee-Report>
69  
70 =head1 BUGS
71  
72 Please report any bugs or feature requests to C<bug-cpants-kwalitee-report at rt.cpan.org>,
73 or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CPANTS-Kwalitee-Report>.
74 I will be notified and then you'll automatically be notified of progress on your
75 bug as I make changes.
76  
77 =head1 SUPPORT
78  
79 You can find documentation for this module with the perldoc command.
80  
81 perldoc CPANTS::Kwalitee::Report::Score
82  
83 You can also look for information at:
84  
85 =over 4
86  
87 =item * RT: CPAN's request tracker (report bugs here)
88  
89 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=CPANTS-Kwalitee-Report>
90  
91 =item * AnnoCPAN: Annotated CPAN documentation
92  
93 L<http://annocpan.org/dist/CPANTS-Kwalitee-Report>
94  
95 =item * CPAN Ratings
96  
97 L<http://cpanratings.perl.org/d/CPANTS-Kwalitee-Report>
98  
99 =item * Search CPAN
100  
101 L<http://search.cpan.org/dist/CPANTS-Kwalitee-Report/>
102  
103 =back
104  
105 =head1 LICENSE AND COPYRIGHT
106  
107 Copyright (C) 2017 Mohammad S Anwar.
108  
109 This program is free software; you can redistribute it and / or modify it under
110 the terms of the the Artistic License (2.0). You may obtain a copy of the full
111 license at:
112  
113 L<http://www.perlfoundation.org/artistic_license_2_0>
114  
115 Any use, modification, and distribution of the Standard or Modified Versions is
116 governed by this Artistic License.By using, modifying or distributing the Package,
117 you accept this license. Do not use, modify, or distribute the Package, if you do
118 not accept this license.
119  
120 If your Modified Version has been derived from a Modified Version made by someone
121 other than you,you are nevertheless required to ensure that your Modified Version
122 complies with the requirements of this license.
123  
124 This license does not grant you the right to use any trademark, service mark,
125 tradename, or logo of the Copyright Holder.
126  
127 This license includes the non-exclusive, worldwide, free-of-charge patent license
128 to make, have made, use, offer to sell, sell, import and otherwise transfer the
129 Package with respect to any patent claims licensable by the Copyright Holder that
130 are necessarily infringed by the Package. If you institute patent litigation
131 (including a cross-claim or counterclaim) against any party alleging that the
132 Package constitutes direct or contributory patent infringement,then this Artistic
133 License to you shall terminate on the date that such litigation is filed.
134  
135 Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND
136 CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
137 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
138 NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS
139 REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT,
140 INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
141 OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
142  
143 =cut
144  
145 3 1; # End of CPANTS::Kwalitee::Report::Score
« Report/Distribution.pm ↑ Summary