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