Report/Score.pm

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