File Coverage

blib/lib/CPANTS/Kwalitee/Report/Distribution.pm
Criterion Covered Total %
statement 14 19 73.6
branch n/a
condition n/a
subroutine 5 6 83.3
pod 0 1 0.0
total 19 26 73.0


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