libmodule-cpants-analyse-perl-0.92+dfsg.orig/0000755000175000017500000000000012217663661020206 5ustar salvisalvilibmodule-cpants-analyse-perl-0.92+dfsg.orig/META.yml0000444000175000017500000000575312217464565021471 0ustar salvisalvi--- abstract: 'Generate Kwalitee ratings for a distribution' author: - 'Lars Dɪᴇᴄᴋᴏᴡ ' build_requires: Cwd: 0 Test::Deep: 0 Test::More: 0 Test::NoWarnings: 0 Test::Warn: 0.11 configure_requires: Module::Build: 0.4 dynamic_config: 1 generated_by: 'Module::Build version 0.4007, CPAN::Meta::Converter version 2.132620' keywords: - CPANTS - kwalitee license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Module-CPANTS-Analyse provides: Module::CPANTS::Analyse: file: lib/Module/CPANTS/Analyse.pm version: 0.92 Module::CPANTS::Kwalitee: file: lib/Module/CPANTS/Kwalitee.pm version: 0.92 Module::CPANTS::Kwalitee::BrokenInstaller: file: lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm version: 0.92 Module::CPANTS::Kwalitee::CpantsErrors: file: lib/Module/CPANTS/Kwalitee/CpantsErrors.pm version: 0.92 Module::CPANTS::Kwalitee::Distname: file: lib/Module/CPANTS/Kwalitee/Distname.pm version: 0.92 Module::CPANTS::Kwalitee::Distros: file: lib/Module/CPANTS/Kwalitee/Distros.pm version: 0.92 Module::CPANTS::Kwalitee::Files: file: lib/Module/CPANTS/Kwalitee/Files.pm version: 0.92 Module::CPANTS::Kwalitee::FindModules: file: lib/Module/CPANTS/Kwalitee/FindModules.pm version: 0.92 Module::CPANTS::Kwalitee::License: file: lib/Module/CPANTS/Kwalitee/License.pm version: 0.92 Module::CPANTS::Kwalitee::Manifest: file: lib/Module/CPANTS/Kwalitee/Manifest.pm version: 0.92 Module::CPANTS::Kwalitee::MetaYML: file: lib/Module/CPANTS/Kwalitee/MetaYML.pm version: 0.92 Module::CPANTS::Kwalitee::NeedsCompiler: file: lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm version: 0.92 Module::CPANTS::Kwalitee::Pod: file: lib/Module/CPANTS/Kwalitee/Pod.pm version: 0.92 Module::CPANTS::Kwalitee::Prereq: file: lib/Module/CPANTS/Kwalitee/Prereq.pm version: 0.92 Module::CPANTS::Kwalitee::Repackageable: file: lib/Module/CPANTS/Kwalitee/Repackageable.pm version: 0.92 Module::CPANTS::Kwalitee::Signature: file: lib/Module/CPANTS/Kwalitee/Signature.pm version: 0.92 Module::CPANTS::Kwalitee::Uses: file: lib/Module/CPANTS/Kwalitee/Uses.pm version: 0.92 Module::CPANTS::Kwalitee::Version: file: lib/Module/CPANTS/Kwalitee/Version.pm version: 0.92 requires: Archive::Any::Lite: 0.06 Archive::Tar: 1.48 Array::Diff: 0.04 CPAN::DistnameInfo: 0.06 CPAN::Meta::Validator: 2.131490 CPAN::Meta::YAML: 0.008 Class::Accessor: 0.19 File::Find::Rule::VCS: 0 IO::Capture: 0.05 Module::ExtractUse: 0.30 Module::Pluggable: 2.96 Set::Scalar: 0 Software::License: 0.003 Text::Balanced: 0 YAML::Any: 0 perl: 5.006 version: 0.73 resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Module-CPANTS-Analyse homepage: http://cpants.cpanauthors.org license: http://dev.perl.org/licenses/ repository: https://github.com/cpants/Module-CPANTS-Analyse version: 0.92 libmodule-cpants-analyse-perl-0.92+dfsg.orig/MANIFEST0000444000175000017500000000417412217663661021343 0ustar salvisalviAUTHORS bin/cpants_lint.pl Build.PL Changes lib/Module/CPANTS/Analyse.pm lib/Module/CPANTS/Kwalitee.pm lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm lib/Module/CPANTS/Kwalitee/CpantsErrors.pm lib/Module/CPANTS/Kwalitee/Distname.pm lib/Module/CPANTS/Kwalitee/Distros.pm lib/Module/CPANTS/Kwalitee/Files.pm lib/Module/CPANTS/Kwalitee/FindModules.pm lib/Module/CPANTS/Kwalitee/License.pm lib/Module/CPANTS/Kwalitee/Manifest.pm lib/Module/CPANTS/Kwalitee/MetaYML.pm lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm lib/Module/CPANTS/Kwalitee/Pod.pm lib/Module/CPANTS/Kwalitee/Prereq.pm lib/Module/CPANTS/Kwalitee/Repackageable.pm lib/Module/CPANTS/Kwalitee/Signature.pm lib/Module/CPANTS/Kwalitee/Uses.pm lib/Module/CPANTS/Kwalitee/Version.pm Makefile.PL MANIFEST This list of files MANIFEST.SKIP META.json META.yml README t/00_load.t t/02_kwalitee.t t/03_plugins.t t/05_testdir.t t/05_testfile.t t/10_analyse.t t/11_hash_random.pl t/11_hash_random.t t/analyse_afs.t t/analyse_axkit_xsp_l10n.t t/analyse_devel_timer.t t/analyse_eg_c.t t/analyse_html_tiny.t t/analyse_test_yaml_meta.t t/calc.t t/calc_test_yaml_meta.t t/moose_as_strict.t t/older_test_kwalitee.t t/perl5i_as_strict.t t/perl5i_as_warnings.t t/plugin_manifest.t t/unpack.t t/unpack_notextractable.t TODO xt/99_critic.t xt/99_pod.t xt/99_pod_coverage.t xt/kwalitee.t xt/kwalitee/has_buildtool.t xt/kwalitee/has_changelog.t xt/kwalitee/has_human_readable_license.t xt/kwalitee/has_license_in_source_file.t xt/kwalitee/has_manifest.t xt/kwalitee/has_meta_yml.t xt/kwalitee/has_readme.t xt/kwalitee/has_separate_license_file.t xt/kwalitee/has_tests.t xt/kwalitee/has_tests_in_t_dir.t xt/kwalitee/manifest_matches_dist.t xt/kwalitee/metayml_conforms_spec_current.t xt/kwalitee/metayml_conforms_to_known_spec.t xt/kwalitee/metayml_declares_perl_version.t xt/kwalitee/metayml_has_license.t xt/kwalitee/metayml_has_provides.t xt/kwalitee/metayml_is_parsable.t xt/kwalitee/no_broken_auto_install.t xt/kwalitee/no_broken_module_install.t xt/kwalitee/no_stdin_for_prompting.t xt/kwalitee/no_symlinks.t xt/kwalitee/proper_libs.t xt/kwalitee/Test.pm xt/kwalitee/use_strict.t xt/kwalitee/use_warnings.t xt/strict_warnings_equiv.t libmodule-cpants-analyse-perl-0.92+dfsg.orig/Changes0000444000175000017500000004453312217464565021512 0ustar salvisalvi=encoding UTF-8 =head1 NAME Changes - Revision history for Module-CPANTS-Analyse =head2 0.92 2013-09-22 =over =item Fixed a case when more than one license sections come in row (spotted by ysasaki++) (ishigaki) =item stopped checking auto_features (ishigaki) =back =head2 0.91 2013-09-05 =over =item Fixed RT#69233 - doesn't detect use >= 5.012 as use strict (ishigaki) =item Fixed RT#83336 - Fails to detect strict via `use MooseX::Types` (ether) =item Fixed RT#83851 - 'use v5.16' and greater not deemed "strict" (ishigaki) =item Fixed RT#86504 - fix sort order of Kwalitee generators (ether) =item Fixed RT#87155 - more Module::Install tests needed (1.04 is broken) (ishigaki) =item Fixed RT#87597 - proper_libs is a dubious test (ishigaki) =item Fixed RT#87598 - Can't use an undefined value as an ARRAY reference at .../FindModules.pm line 115. (ishigaki) =item Fixed RT#87988 - Fix use of $Test::Kwalitee::VERSION (ether) =item Fixed RT#88216 - extracts_nicely metric fails for -TRIAL releases (ishigaki) =item Fixed RT#88365 - YAML/JSON tests are not failing when improperly encoded characters are seen (ishigaki) =item Moose::Exporter also provides strict and warnings (doy) =back =head2 0.90_02 2013-08-03 =over =item Fixed L - incorrect version specification in 0.90_01 (L) =item Fixed L - Test failure in 0.90_01 (L) =item Fixed L - t/11_hash_random.t fails due to undeclared test dependency (L) =back =head2 0.90_01 2013-08-01 =over =item Applied all the changes in 0.88 again, and removed a few non-portable metrics for Test::Kwalitee. =back =head2 0.89 2013-08-01 =over =item Tentatively reverted all the changes in 0.88 =back =head2 0.88 2013-08-01 =over =item add metric C (L, L) =item remove metrics C, C, C, C, C, C, C, C, C (L) =item add metric C (L) =item numerous fixes for a smoother operation of www-cpants (L) =back =head2 0.87 2013-02-12 =over =item fix L - Test failures due to Test::CPAN::Meta::YAML::Version interface change (L) =item fix L - Hash-Randomization causes 10_analyse.t to fail (L, L) =item fix L - Module::CPANTS::Kwalitee::Manifest broken for MANIFESTs containing files with spaces (L) =back =head2 0.86 2012-04-11 =over =item add several strict and warnings equivalents & make it easy to add more =item fix when L is used and strict is not used =item add info about C =item better remedy for L =item L moved from experimental to extra =item some pod improvements (L) =item fix L - no more C on CPAN (L) =item replace L with L (L) =item L checks only files in F, use L (L) =item add more equivalents for L and L tests (L) =item implement L metric (L) =back =head2 0.85 2009-07-12, L =over =item fix fails on non-Win32 =back =head2 0.84 2009-07-08, L =over =item require L 0.11 =item add L to deps =item add L to deps =item fix F =item better F =item list of changes for L<0.83|/"0.83 2009-06-10"> (L) =back =head2 0.83 2009-06-10 =over =item ignore C when searching for examples (L) =item skip the debian metrics and downloading the debian file when in LINT (L) =item L and L are now optional metrics (L) =back =head2 0.82 2008-07-08 10:23:30 =over =item update F L =item fixed experimental metrics =item use L now counts for using L =item lots of commits from L =item honor F key C. Fixes L and an IRC complaint by L =back =head2 0.81 Sun Apr 13 16:45:29 CEST 2008 =over =item fixed doc bug in SYNOPSIS (reported by L as L) =item made L smarter (L): If available, use F C. If not, look for C statements in files. It now also finds stuff like L and L =item upgrade to L 0.003 (L) =back =head2 0.80 Sat Apr 12 10:53:40 CEST 2008 L: =over =item add L metric =back L: =over =item simplify the way the VERSION number is looked up, keep the full version line =item increase the L limit to 200_000 =item some unit test fixes thanks to L =item some of {error} fields are now ARRAY refs instead of strings =item more detailed unit tests =item add C to the list of special files (not only LICENSE) =item collect the license information of each file using L =item add L metric =item add L metric =back =head2 0.79 Tue Apr 8 01:25:12 CEST 2008 released at the Oslo QA Hackathon 2008 L: =over =item replace L by L =item add L metrics =item add L metric that was inside the L metric =item add C flag to some of the metrics =item add aggregating key to metric to list the other metrics being aggregated =item unhide some errors during testing =item renamed some error fields =item add L metric =back =head2 0.78 2008-04-06 released at the Oslo QA Hackathon 2008 =over =item very hacky workaround for problems with F, version objects, etc =item moved C into L & fixed a bug in it =back L: =over =item add L metric that was inside the L metric =item add C and C flags to some of the metrics =item unhide some errors during testing =item add L metric =item add L, L and L metric =item add L metric =item add L metric =item add L metric checking for STDIN in F and F =back =head2 0.77 2008-01-29 =over =item made L and L optional metrics =item changed data structure: all errors are now in a hashref called C =back =head2 0.76 2007-11-14 =over =item added new metrics L and L =item added C to metrics and removed hardcoded workaround for L =item removed workaround in L (L fixed it the problem in L) =item reworded L remedy =back =head2 0.75 2007-10-29 =over =item added optional metric L =item added directory F as a potential location for test files =item finally applied patch provided by L to fix some issues in L. See L =back =head2 0.74 2007-10-24 =over =item removed metric C =item fixed bug in L, which caused wrong results in L =item switched to L =item work around L returning strange data =back =head2 0.73 2007-09-12 =over =item added version of dist to dump file name =item fixed bug in L (L plus all reported merged into that one) =back =head2 0.72 2007-06-30 =over =item added docs to F =item F can now dump metadata to a file =item added L output to F =back L: =over =item added L MCK::NeedsCompiler does not contain any C, but adds much needed metadata. =back L: =over =item L assumes Unix paths after munging with L, thus breaking portability at every turn in a non-Unix-like environment… bad Thomas no biscuit! =item Refined F metrics using L and brought I up to date with L :) =back =head2 0.71 2007-04-23 =over =item moved svn repo to L =item L now also checks for F (as suggested by L) =item fixed L reported by L =item L now also checks for C files (as suggested by L) =item fixed L reported by L - F now only runs if C<$ENV{AUTHOR_TEST}> is set =item resolved L reported by L using his patch =item L: do not check F for C because F might list semi-garbage (eg according to F, L provides L, which it does not.) =item skip very large test-files and only check F<*.t> files (not everything in F) as suggested by L =item F: switched from L to L added C<--no_capture> option for easier debugging added C<--verbose> options =item hopefully fixed L (test failures on Win32) reported (and patched…) by L. This should also solve L reported by L =item applied doc patch submitted by L as L =back =head2 0.69 2006-11-04 =over =item split up C to L and C (which is optional) =item added C and docu pointers to it. =back =head2 0.68 2006-10-28 =over =item fixed bug in L reported by L in L (the module name of modules living in the top-level namespace (eg 'threads.pm') was not guessed correctly =item use F C (if it exists) instead of guessing module names in L =item modifed changelog-regex in L as suggested by L in L =item added L =item moved license checking to L =item added checks for F file and C POD section =item moved C parsing to L =item changed C error text after L (and L) suggested that L now supports a C field =back =head2 0.67 2006-09-13 =over =item F now handles reporting of optional metrics better. =item added F (L) =item some code cleanups as reported by L (L) =item new metric: C; L (L) =item L now reports the error messages returned by L (suggested by L) =back =head2 0.66 2006-09-06 =over =item added L method =back =head2 0.65 2006-09-05 (YAPC::Europe hackathon release) =over =item updated test suite =item added C to L =item added C to L =item added L (C) =back =head2 0.64 2006-08-29 =over =item updated L submitted by L =back =head2 0.63 2006-07-31 =over =item we now also find F resolves L reported by L (thanks for the patch!) =back =head2 0.62 2006-07-20 =over =item added L submitted by L =back =head2 0.61 2006-07-17 =over =item Kwalitee metrics can now be marked as C Such metrics do not count for available kwalitee =item marked L as C =item F now reports percentages additional to absolute values =item F won't list failed C metrics =item added some method caching to L =item added Ctotal_kwalitee> to L. =back =head2 0.60 2006-05-18 =over =item activated L metric =item added helper method (C) =item L: skip stuff in F (L) =back =head2 0.52 2006-03-12 =over =item added some dependencies to F/F (thanks to L and L (L)) =item enhanced output of F (list failed tests) =item L: die if we cannot find a namespace =item L: remove stuff that doesn't seem to be namespace (eg lowercase) from module names =item changed the name of some fields to work with the (upcoming) DB =item added some tests =back =head2 0.51 2006-02-16 =over =item adapted L to work with newer versions of L (reported by L as L) =back =head2 0.50 2006-01-26 =over =item first release to CPAN =back =head2 0.01 =over =item started rewrite =back libmodule-cpants-analyse-perl-0.92+dfsg.orig/README0000444000175000017500000000214412217464565021067 0ustar salvisalvi=encoding UTF-8 Module-CPANTS-Analyse version 0.87 is Copyright © 2012, Perl QA team =head1 NAME README - basic information for users prior to downloading =head1 DESCRIPTION Module-CPANTS-Analyse tests a dist for Kwalitee. This module is part of the L. =head1 AUTHOR =head2 Distribution maintainer L, C<< >> =head2 Contributors See file F. =head1 COPYRIGHT Copyright © 2003–2009 L, C<< >> Some files are Copyright © 2006–2008 L, C<< >> Some files are Copyright © 2006 L, C<< >> Some files are Copyright © 2012 L, C<< >> The module distributions in the F directory are copyright by their respective authors. =head1 LICENSE This code is distributed under the same license as Perl. libmodule-cpants-analyse-perl-0.92+dfsg.orig/Build.PL0000444000175000017500000000370512217464565021507 0ustar salvisalviuse utf8; use strict; use Module::Build; my $build = Module::Build->new( dist_author => 'Lars Dɪᴇᴄᴋᴏᴡ ', module_name => 'Module::CPANTS::Analyse', license => 'perl', requires => { 'Class::Accessor' => '0.19', 'Archive::Any::Lite' => '0.06', 'Archive::Tar' => '1.48', #depends on IO::Compress without memory leak 'CPAN::DistnameInfo' => '0.06', 'CPAN::Meta::YAML' => '0.008', 'CPAN::Meta::Validator' => '2.131490', 'YAML::Any' => 0, 'Module::ExtractUse' => '0.30', # for used_in_eval 'Module::Pluggable' => '2.96', 'IO::Capture' => '0.05', 'Array::Diff' => '0.04', 'version' => '0.73', 'File::Find::Rule::VCS' => '0', 'Software::License' => '0.003', 'perl' => 5.006, 'Set::Scalar' => 0, 'Text::Balanced' => 0, }, build_requires => { 'Test::More' => '0', 'Test::Deep' => '0', 'Test::Warn' => '0.11', #less problems with new Sub::Uplevel 'Test::NoWarnings' => '0', 'Cwd' => '0', }, configure_requires => { 'Module::Build' => '0.4', }, meta_merge => { resources => { homepage => 'http://cpants.cpanauthors.org', repository => 'https://github.com/cpants/Module-CPANTS-Analyse', bugtracker => 'https://rt.cpan.org/Public/Dist/Display.html?Name=Module-CPANTS-Analyse', }, keywords => [ 'CPANTS','kwalitee', ], }, script_files=>[qw(bin/cpants_lint.pl)], create_makefile_pl=>'traditional', ); $build->add_to_cleanup('Debian_CPANTS.txt'); $build->create_build_script; libmodule-cpants-analyse-perl-0.92+dfsg.orig/MANIFEST.SKIP0000444000175000017500000000151712217464565022110 0ustar salvisalvi# Avoid version control files. \bRCS\b \bCVS\b \bSCCS\b ,v$ \B\.svn\b \B\.git\b \B\.gitignore\b \b_darcs\b \B\.cvsignore$ # Avoid VMS specific MakeMaker generated files \bDescrip.MMS$ \bDESCRIP.MMS$ \bdescrip.mms$ # Avoid Makemaker generated and utility files. \bMANIFEST\.bak \bMakefile$ \bblib/ \bMakeMaker-\d \bpm_to_blib\.ts$ \bpm_to_blib$ \bblibdirs\.ts$ # 6.18 through 6.25 generated this # Avoid Module::Build generated and utility files. \bBuild$ \b_build/ \bBuild.bat$ \bBuild.COM$ \bBUILD.COM$ \bbuild.com$ # Avoid temp and backup files. ~$ \.old$ \#$ \b\.# \.bak$ \.tmp$ \.# \.rej$ # Avoid OS-specific files/dirs # Mac OSX metadata \B\.DS_Store # Mac OSX SMB mount metadata files \B\._ # Avoid Devel::Cover and Devel::CoverX::Covered files. \bcover_db\b \bcovered\b # Avoid MYMETA files ^MYMETA\. ^Module-CPANTS-Analyse libmodule-cpants-analyse-perl-0.92+dfsg.orig/TODO0000444000175000017500000001521012217464565020675 0ustar salvisalvi#----------------------------------------------------------------- # TODO Module-CPANTS-Analyse # $Rev: 409 $ # $Date: 2006-09-14 19:42:31 +0200 (Thu, 14 Sep 2006) $ #----------------------------------------------------------------- #----------------------------------------------------------------- # BUGS #----------------------------------------------------------------- Robert 'phaylon' Sedlacek Meldung, dass 'has_proper_version' nicht bestanden wird. http://rt.cpan.org/Ticket/Display.html?id=21370 Win32 test fail: analyse.t, analyse_afs.t, calc.t, testfile.t Moose and MooseX turn on strict, so count Moose[X] as use_strict The "ownership of a modules does not seem to get updated" e.g. still shows DAGOLDEN even tough it should be ADAMK http://cpants.perl.org/dist/external/Perl-Dist-Strawberry #----------------------------------------------------------------- # New Metrics #----------------------------------------------------------------- - no_boilerplate - has_valid_filenames - declares_dependencies - no_open_bugs - no_old_open_bugs (older than a year?) - license_is_actual might be a good addition, like "copyright 2001-2002" is rather outdated - add list of modules that fail the use_warnings to $d->{error}{use_warnings} - same for use_strict - Allow the Debian and/or the Fedora packagers to "manually" report problems they encounter with certain packages directly from their systems. So if there is a module that cannot automatically packaged (or tested?) because they are interactive (in the wrong way) or they need network access... On the Debian list it was discussed that they might start saving this information from themself and then export this information with the rest of the data about packages. - Signature checking ? - has_rating ? - relation of subs to lines of code ? - easily_repackagable - easily_repackagable_by_debian - easily_repackagable_by_fedora on http://www.perlfoundation.org/perl5/index.cgi?cpan_packaging there are guidelines for module authors to make their modules easily repackagable by downstream distros. It would be great if we could add as many to CPANTS as possible. Some we can check without executing code. Others might be verified by the CPAN Testers, reported by the tools and then collected from the reports by CPANTS. - version_number_is_sane There are several issues here: 1) Is the version number sane for perl (I think there is a metric already) 2) Is the version number sane for Debian/RedHat (they have different meaning of sane) 3) Is the scheme of the version numbers stable? (In Debian they don't like when ppl are changing from D.DD to a D.D scheme or vice versa. 1.1.1 is not considered correct by MakeMaker but it is currently accepted by CPANTS http://cpants.perl.org/dist/kwalitee/Sys-HostIP http://www.nntp.perl.org/group/perl.qa/2007/12/msg10025.html - has_same_version_number_in_all_files ??? Some people will argue that when one of the files does not change, there is no need to change its version number. So this might not be a good metric. - no_bugs_in_freebsd - has_patches_in_freebsd The Debian and FreeBSD ppl will provide the interface for this -probably a csv file that can be fetched using http. This should be (an optional?) negative metric in case the module is included in FreeBSD or Debian but it had to be patched. (Maybe we need to make sure that we set this negative metric only when the module versions are the same so we won't penalize a module because XYZ has not yet integrated the newer version that possibly already includes the patch. - We might even have an optional metric to show that "the latest version of the module is included in Debian/FreeBSD etc". This will be lost every time a new version of a module is released but over time it will become ok again. (in xt/ or in t/ and the same file has RELEASE_TESTING in it) - has_no_indirect_code Check the source code (and/or) the documentation if you see new Module::Name anywhere mark the metric as failed. - all_links_in_the_documentation_still_exist - declares_minimal_version_of_perl It has "use N" somewhere in the Makefile.PL and/or Build.PL and/or the source code. (and they match to each other :-) (No specific N should be required) - "something about has good perl code" (e.g. if uses 3 param open but does not say use perl 5.6 or similar) - has_humanreadable_license the actual name of the license (perl, etc.) is in the database, use it Module::License::Report integration (though I am not sure if that should mean the main .pm file only or all the files or what) - licenses_are_consistent Locate places where hard-coded pathes to perl (or other files?) are: > > my @cmd = qw{/usr/bin/perl -Ilib -MPod::HtmlEasy -e}; actually try to locate places where perl is called instead of $^X <@Tux> has no open bugs in RT older than 2 months <@Tux> and debian shipped last version is only ok is last version is older than 3 months #----------------------------------------------------------------- # Other Stuff #----------------------------------------------------------------- - include more dists in test (for better test coverage) - improve NeedsCompiler (see its TODO) - Perl Critic report: As this is not really in the consensus probably it is better not add it as a metric now but it might be nice to run it on each module (starting at level 5 ) and display it along with the metrics. Maybe it can be added as an optional metric. - http://cpants.perl.org/author/search should also work on partial names adding % % automatically (or at least tell the users on the search page to use % as wildcards. - create stats (or metrics) for distros that were uploaded recently with failing metrics. e.g. the fact that 9920 Distributions failing 'metayml_has_license' is skewed by the many modules that were not updated in the past 1-2 years. It would be more important to see the number of modules uploaded in the last year without metayml of without license field in the metayaml. - Export the kwalitee of each distro in a csv file like so it can be easily integrated into other web sites such as the search engines. - Export the kwalitee of each distro in a csv file like so it can be easily integrated into other web sites such as the search engines. - Create a hierarchical report (aka CPANDepth) showing all the dependencies their kwalitee, their age, their license (the name of the license from META.yml for now) - honor the META.yml key no_index. See RT#32777 - Display the version of CPANTS used for indexing and show the date when the last update was executed. Maybe do so per distribution? libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/0000755000175000017500000000000012217464565020756 5ustar salvisalvilibmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/0000755000175000017500000000000012217464565022203 5ustar salvisalvilibmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/0000755000175000017500000000000012217464565023173 5ustar salvisalvilibmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/0000755000175000017500000000000012217464565024740 5ustar salvisalvilibmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Repackageable.pm0000444000175000017500000000330712217464565030005 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Repackageable; use warnings; use strict; our $VERSION = '0.92'; sub order { 900 } ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; # NOTE: The analysis/metric in this module has moved to # Module::CPANTS::SiteKwalitee. # Note also that this stub should not be removed so that # this can replace the old ::Signature module, and the old # metrics will not be loaded while loading plugins. return; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators{ return []; } q{Favourite record of the moment: Lili Allen - Allright, still}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Repackageable - Checks for various signs that make a module packageable =head1 SYNOPSIS There are several agregate metrics in here. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. =head3 analyse =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =head1 SEE ALSO L =head1 AUTHOR L and L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2009 L Copyright © 2006–2008 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Manifest.pm0000444000175000017500000000673312217464565027053 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Manifest; use warnings; use strict; use File::Spec::Functions qw(catfile); use Array::Diff; our $VERSION = '0.92'; sub order { 100 } ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; my @files=@{$me->d->{files_array} || []}; if (my $ignore = $me->d->{ignored_files_array}) { push @files, @$ignore; } my $distdir=$me->distdir; my $manifest_file=catfile($distdir,'MANIFEST'); if (-e $manifest_file) { # read manifest open(my $fh, '<', $manifest_file) || die "cannot read MANIFEST $manifest_file: $!"; my @manifest; while (<$fh>) { chomp; next if /^\s*#/; # discard pure comments if (s/^'(\\[\\']|.+)+'\s*.*/$1/) { s/\\([\\'])/$1/g; } else { s/\s.*$//; } # strip quotes and comments next unless $_; # discard blank lines push(@manifest,$_); } close $fh; @manifest=sort @manifest; my @files=sort @files; my $diff=Array::Diff->diff(\@manifest,\@files); if ($diff->count == 0) { $me->d->{manifest_matches_dist}=1; } else { $me->d->{manifest_matches_dist}=0; my @error = ( 'MANIFEST ('.@manifest.') does not match dist ('.@files."):", "Missing in MANIFEST: ".join(', ',@{$diff->added}), "Missing in Dist: " . join(', ',@{$diff->deleted})); $me->d->{error}{manifest_matches_dist} = \@error; } } else { $me->d->{manifest_matches_dist}=0; $me->d->{error}{manifest_matches_dist}=q{Cannot find MANIFEST in dist.}; } } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators { return [ { name=>'manifest_matches_dist', error=>q{MANIFEST does not match the contents of this distribution.}, remedy=>q{Run a proper command ("make manifest" or "./Build manifest", maybe with a force option), or use a distribution builder to generate the MANIFEST. Or update MANIFEST manually.}, code=>sub { shift->{manifest_matches_dist} ? 1 : 0 }, details=>sub { my $d = shift; my $error = $d->{error}{manifest_matches_dist}; return $error unless ref $error; return join "\n", @$error; }, } ]; } q{Listening to: YAPC::Europe 2007}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Manifest - Check MANIFEST =head1 SYNOPSIS Check if MANIFEST and dist contents match. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<100>. =head3 analyse Check if MANIFEST and dist contents match. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =over =item * manifest_matches_dist =back =head1 SEE ALSO L =head1 AUTHOR Thomas Klausner, , http://domm.plix.at =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Distname.pm0000444000175000017500000000372512217464565027047 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Distname; use warnings; use strict; our $VERSION = '0.92'; sub order { 20 } ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; # NOTE: The analysis code has moved to ::Analyse to avoid # duplication. # Note also that this stub should not be removed so that # this can replace the old ::Signature module, and the old # metrics will not be loaded while loading plugins. return; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators { # NOTE: The metrics in this module have moved to # Module::CPANTS::SiteKwalitee because these require an archived # distribution which you don't have while testing local Kwalitee # with Test::Kwalitee. return []; } q{Favourite record of the moment: Fat Freddys Drop: Based on a true story}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Distname - Proper Distname layout =head1 SYNOPSIS Checks if a distname is well-formed. A wellformed distname looks like C =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<20>, as data generated by C is used by other tests. =head3 analyse C uses C to split a distname into it's components. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =over =back =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm0000444000175000017500000000466612217464565030041 0ustar salvisalvipackage Module::CPANTS::Kwalitee::NeedsCompiler; use warnings; use strict; our $VERSION = '0.92'; sub order { 200 } ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; my $files=$me->d->{files_array}; foreach my $f (@$files) { if ($f =~ /\.[hc]$/i or $f =~ /\.xs$/i) { $me->d->{needs_compiler}=1; return; } } if (defined ref($me->d->{prereq}) and ref($me->d->{prereq}) eq 'ARRAY') { for my $m (@{ $me->d->{prereq} }) { if ($m->{requires} =~ /^Inline::/ or $m->{requires} eq 'ExtUtils::CBuilder' or $m->{requires} eq 'ExtUtils::ParseXS') { $me->d->{needs_compiler}=1; return; } } } return; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators{ return [ ]; } q{Favourite compiler: gcc}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::NeedsCompiler - Checks if the module needs a (probably C) compiler =head1 SYNOPSIS Checks if there is some indication in the module that it needs a C compiler to build and install =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<200>. =head3 analyse Checks for file with .c, .h or .xs extensions. Check is the module depends on any of the Inline:: modules or on ExtUtils::CBuilder or ExtUtils::ParseXS. =head3 TODO: How to recognize cases such as http://search.cpan.org/dist/Perl-API/ and http://search.cpan.org/dist/Term-Size-Perl that generate the .c files during installation In addition there are modules that can work without their XS part. E.g. Scalar-List-Utils, Net-DNS, Template-Toolkit For our purposes these all should be marked as "need C compiler" as they need it for their full functionality and speed. =head3 kwalitee_indicators No Kwalitee Indicator. =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2006–2008 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Uses.pm0000444000175000017500000002050612217464565026216 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Uses; use warnings; use strict; use File::Spec::Functions qw(catfile); use Module::ExtractUse; use Set::Scalar qw(); use Data::Dumper; use version; our $VERSION = '0.92'; # These equivalents should be reasonably well-known and, preferably, # well-documented. Don't add obscure modules used by only one person # or a few people, to keep the list relatively small and to encourage # people to use a better equivalent. # "use_(strict|warnings)" should fail if someone feels the need # to add "use $1;" in the modules. our @STRICT_EQUIV = qw( strict ); our @WARNINGS_EQUIV = qw( warnings ); our @STRICT_WARNINGS_EQUIV = qw( common::sense Any::Moose Catmandu::Sane Coat Dancer Mo Modern::Perl Moo Moo::Role Moose Moose::Role Moose::Exporter MooseX::Declare MooseX::Role::Parameterized MooseX::Types Mouse Mouse::Role perl5 perl5i::1 perl5i::2 perl5i::latest Role::Tiny strictures ); # These modules require a flag to enforce strictness. push @STRICT_WARNINGS_EQUIV, qw( Mojo::Base Spiffy ); sub order { 100 } ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; my $distdir=$me->distdir; my $modules=$me->d->{modules}; my $files=$me->d->{files_array}; # NOTE: all files in xt/ should be ignored because they are # for authors only and their dependencies may not be (and # often are not) listed in meta files. my @tests=grep {m|^t\b.*\.t|} @$files; $me->d->{test_files} = \@tests; my @test_modules = map { my $m = $_; $m =~ s|/|::|g; $m =~ s|\.pm$||; $m } grep {m|^t\b.*\.pm$|} @$files; my %skip=map {$_->{module}=>1 } @$modules; my %uses; # used in modules foreach (@$modules) { my $p = Module::ExtractUse->new; my $file = catfile($distdir,$_->{file}); $p->extract_use($file) if -f $file; $_->{uses} = $p->used; while (my ($mod,$cnt)=each%{$p->used}) { next if $skip{$mod}; next if $mod =~ /::$/; # see RT#35092 next unless $mod =~ /^[A-Za-z0-9:_]+$/; $uses{$mod}{module} = $mod; $uses{$mod}{in_code} += $cnt; $uses{$mod}{evals_in_code} += $p->used_in_eval($mod) || 0; } } # used in tests foreach my $tf (@tests) { my $pt=Module::ExtractUse->new; my $file = catfile($distdir,$tf); $pt->extract_use($file) if -f $file && -s $file < 1_000_000; # skip very large test files while (my ($mod,$cnt)=each%{$pt->used}) { next if $skip{$mod}; next if $mod =~ /::$/; # see RT#35092 next unless $mod =~ /^[A-Za-z0-9:_]+$/; if (@test_modules) { next if grep {/(?:^|::)$mod$/} @test_modules; } $uses{$mod}{module} = $mod; $uses{$mod}{in_tests} += $cnt; $uses{$mod}{evals_in_tests} += $pt->used_in_eval($mod) || 0; } } # used in Makefile.PL/Build.PL foreach my $f (grep /\b(?:Makefile|Build)\.PL$/, @{$me->d->{files_array} || []}) { my $p = Module::ExtractUse->new; my $file = catfile($distdir,$f); $p->extract_use($file) if -f $file; while (my ($mod,$cnt)=each%{$p->used}) { next if $skip{$mod}; next if $mod =~ /::$/; # see RT#35092 next unless $mod =~ /^[A-Za-z0-9:_]+$/; $uses{$mod}{module} = $mod; $uses{$mod}{in_config} += $cnt; $uses{$mod}{evals_in_config} += $p->used_in_eval($mod) || 0; } } $me->d->{uses}=\%uses; return; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators { return [ { name=>'use_strict', error=>q{This distribution does not 'use strict;' (or its equivalents) in all of its modules. Note that this is not about the actual strictness of the modules. It's bad if nobody can tell whether the modules are strictly written or not, without reading the source code of your favorite clever module that actually enforces strictness. In other words, it's bad if someone feels the need to add 'use strict' to the modules.}, remedy=>q{Add 'use strict' to all modules, or convince us that your favorite module is well-known enough and people can easily see the modules are strictly written.}, code=>sub { my $d = shift; my $modules = $d->{modules}; my $uses = $d->{uses}; return 0 unless $modules && $uses; # There are lots of acceptable strict alternatives my $strict_equivalents = Set::Scalar->new->insert(@STRICT_EQUIV, @STRICT_WARNINGS_EQUIV); my $perl_version_with_implicit_stricture = version->new('5.011'); my @no_strict; for my $module (@{ $modules }) { next if grep {/^5\./ && version->parse($_) >= $perl_version_with_implicit_stricture} keys %{$module->{uses}}; push @no_strict, $module->{module} if $strict_equivalents ->intersection(Set::Scalar->new(keys %{ $module->{uses} })) ->is_empty; } if (@no_strict) { $d->{error}{use_strict} = join ", ", @no_strict; return 0; } return 1; }, details=>sub { my $d = shift; return "The following modules don't use strict (or equivalents): " . $d->{error}{use_strict}; }, }, { name=>'use_warnings', error=>q{This distribution does not 'use warnings;' in all of its modules. Note that this is not about that your modules actually warn when something bad happens. It's bad if nobody can tell if modules warns or not, without reading the source code of your favorite module that actually enforces warnings. In other words, it's bad if someone feels the need to add 'use warnings' to the modules.}, is_extra=>1, remedy=>q{Add 'use warnings' to all modules (this will require perl > 5.6), or convince us that your favorite module is well-known enough and people can easily see the modules warn when something bad happens.}, code=>sub { my $d = shift; my $modules = $d->{modules}; my $uses = $d->{uses}; return 0 unless $modules && $uses; my $warnings_equivalents = Set::Scalar->new->insert(@WARNINGS_EQUIV, @STRICT_WARNINGS_EQUIV); my @no_warnings; for my $module (@{ $modules }) { push @no_warnings, $module->{module} if $warnings_equivalents ->intersection(Set::Scalar->new(keys %{ $module->{uses} })) ->is_empty; } if (@no_warnings) { $d->{error}{use_warnings} = join ", ", @no_warnings; return 0; } return 1; }, details=>sub { my $d = shift; return "The following modules don't use warnings (or equivalents): " . $d->{error}{use_warnings}; }, }, ]; } q{Favourite record of the moment: Fat Freddys Drop: Based on a true story}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Uses - Checks which modules are used =head1 SYNOPSIS Check which modules are actually used in the code. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<100>. =head3 analyse C uses C to find all C statements in code (actual code and tests). =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =over =item * use_strict =item * use_warnings =back =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/CpantsErrors.pm0000444000175000017500000000473612217464565027733 0ustar salvisalvipackage Module::CPANTS::Kwalitee::CpantsErrors; use warnings; use strict; use version; our $VERSION = '0.92'; sub order { 1000 } ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; return if $me->opts->{no_capture} or $INC{'Test/More.pm'}; my $sout=$me->capture_stdout; my $serr=$me->capture_stderr; $sout->stop; $serr->stop; my @eout=$sout->read; my @eerr=$serr->read; if (@eerr || @eout) { $me->d->{error}{cpants}=join("\n",'STDERR:',@eerr,'STDOUT:',@eout); } } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators { # NOTE: CPANTS error should be logged somewhere, but it # should not annoy people. If anything wrong or interesting # is found in the log, add some metrics (if it's worth), # or just fix our problems. # Older Test::Kwalitee (prior to 1.08) has hardcoded metrics # names in it, and if those metrics are gone from # Module::CPANTS::Kwalitee, it fails because the number of tests # is not as expected. This is not beautiful, but better than # to break others' distributions needlessly. if ($INC{"Test/Kwalitee.pm"}) { return [ map {+{name => $_, code => sub {1}}} qw/extractable no_pod_errors has_test_pod has_test_pod_coverage/ ] if version->parse(Test::Kwalitee->VERSION) < version->parse(1.08); } return []; } q{Listeing to: FM4 the early years}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::CpantsErrors - Check for CPANTS testing errors =head1 SYNOPSIS Checks if something strange happened during testing =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<1000>. =head3 analyse Uses C to check for any strange things that might happen during testing =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/License.pm0000444000175000017500000001646712217464565026674 0ustar salvisalvipackage Module::CPANTS::Kwalitee::License; use warnings; use strict; use File::Spec::Functions qw(catfile); use Software::LicenseUtils; our $VERSION = '0.92'; sub order { 100 } ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; my $distdir=$me->distdir; # check META.yml my $yaml=$me->d->{meta_yml}; $me->d->{license} = ''; if ($yaml) { if ($yaml->{license} and $yaml->{license} ne 'unknown') { $me->d->{license_from_yaml} = $yaml->{license}; $me->d->{license} = $yaml->{license}.' defined in META.yml'; } } my $files = $me->d->{files_hash}; # check if there's a LICEN[CS]E file if (my ($file) = grep {exists $files->{$_}} qw/LICENCE LICENSE/) { $me->d->{license} .= " defined in $file"; $me->d->{external_license_file}=$file; } # check pod my %licenses; foreach my $file (grep { /\.p(m|od|l)$/ } keys %$files ) { my $path = catfile($distdir, $file); next unless -r $path; # skip if not readable open my $fh, '<', $path or next; my $in_pod = 0; my $pod = ''; my @possible_licenses; my @unknown_license_texts; while(<$fh>) { if (/^=head\d\s+.*\b(?i:LICEN[CS]E|LICEN[CS]ING|COPYRIGHT|LEGAL)\b/) { if ($in_pod) { my @guessed = Software::LicenseUtils->guess_license_from_pod("$pod\n\n=cut\n"); if (@guessed) { push @possible_licenses, @guessed; } else { push @unknown_license_texts, $pod; } } $in_pod = 1; $pod = "=head1 LICENSE\n"; } elsif (/^=(?:head\d\s+|cut)\b/) { if ($in_pod) { my @guessed = Software::LicenseUtils->guess_license_from_pod("$pod\n\n=cut\n"); if (@guessed) { push @possible_licenses, @guessed; } else { push @unknown_license_texts, $pod; } } $in_pod = 0; $pod = ''; } elsif ($in_pod) { $pod .= $_; } } if ($pod) { my @guessed = Software::LicenseUtils->guess_license_from_pod("$pod\n\n=cut\n"); if (@guessed) { push @possible_licenses, @guessed; } else { push @unknown_license_texts, $pod; } } $me->d->{unknown_license_texts} = join "\n", @unknown_license_texts; next unless @possible_licenses; $me->d->{license_in_pod} = 1; $me->d->{license} ||= "defined in POD ($file)"; $licenses{$_} = $file for @possible_licenses; $files->{$file}{license} = join ',', @possible_licenses; } if (%licenses) { $me->d->{licenses} = \%licenses; my @possible_licenses = keys %licenses; if (@possible_licenses == 1) { my ($type) = @possible_licenses; $me->d->{license_type} = $type; $me->d->{license_file} = $licenses{$type}; } } return; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators{ return [ { name=>'has_human_readable_license', error=>q{This distribution does not have a license defined in the documentation or in a file called LICENSE}, remedy=>q{Add a section called "LICENSE" to the documentation, or add a file named LICENSE to the distribution.}, code=>sub { my $d = shift; return $d->{external_license_file} || $d->{license_in_pod} ? 1 : 0; }, details=>sub { my $d = shift; return "Neither LICENSE file nor LICENSE section in pod was found."; }, }, { name=>'has_separate_license_file', error=>q{This distribution does not have a LICENSE or LICENCE file in its root directory.}, remedy=>q{This is not a critical issue. Currently mainly informative for the CPANTS authors. It might be removed later.}, is_experimental=>1, code=>sub { shift->{external_license_file} ? 1 : 0 }, details=>sub { my $d = shift; return "LICENSE file was found."; }, }, # { # name=>'has_known_license_in_external_license_file', # error=>q{This distribution has a LICENSE or LICENCE file in its root directory but the license in it was not recognized by CPANTS.}, # remedy=>q{Either CPANTS needs to be fixed or your LICENSE file.}, # is_experimental=>1, # code=>sub { # my $d = shift; # return 1 if not $d->{external_license_file}; # return $d->{license_from_external_license_file} ? 1 : 0; # }, # }, { name=>'has_license_in_source_file', error=>q{Does not have license information in any of its source files}, remedy=>q{Add =head1 LICENSE and the text of the license to the main module in your code.}, code=>sub { my $d = shift; return $d->{license_in_pod} ? 1 : 0; }, details=>sub { my $d = shift; return "LICENSE section was not found in the pod."; }, }, ]; } q{Favourite record of the moment: Lili Allen - Allright, still}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::License - Checks if there is a license =head1 SYNOPSIS Checks if the disttribution specifies a license. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<100>. =head3 analyse C checks if there's a C field C. Additionally, it looks for a file called LICENSE and a POD section namend LICENSE =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =over =item * has_license_in_source_file =item * has_human_readable_license =item * has_separate_license_file =back =head2 License information Pleaces wher the licens information is taken from: Has a LICENSE file file_license 1|0 Content of LICENSE file matches License X from Software::License License in META.yml License in META.yml matches one of the known licenses License in source files recognized by Software::LicenseUtils For each file keep where is was it recognized. Has license or copyright entry in pod (that might not be recognized by Software::LicenseUtils) # has_license =head1 SEE ALSO L =head1 AUTHOR L and L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2009 L Copyright © 2006–2008 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Prereq.pm0000444000175000017500000002522712217464565026542 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Prereq; use warnings; use strict; use File::Spec::Functions qw(catfile); use Text::Balanced qw/extract_bracketed/; our $VERSION = '0.92'; sub order { 100 } ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; $class->_from_meta($me) or $class->_from_cpanfile($me) or $class->_from_build_pl($me) or $class->_from_makefile_pl($me) or $class->_from_dist_ini($me); } sub _from_meta { my ($class, $me) = @_; my $meta = $me->d->{meta_yml}; return unless $meta && ref $meta eq ref {}; my $spec = $meta->{'meta-spec'}; my %res; if ($spec && ref $spec eq ref {} && ($spec->{version} + 0) >= 2) { # meta spec ver2 my $prereqs = $meta->{prereqs}; %res = $class->_handle_prereqs_v2($meta->{prereqs}); } else { # meta spec ver1 my %map = ( requires => 'is_prereq', build_requires => 'is_build_prereq', recommends => 'is_optional_prereq', ); for my $rel (qw/requires recommends build_requires configure_requires conflicts/) { if ($meta->{$rel} && ref $meta->{$rel} eq ref {}) { my $prereqs_r = $meta->{$rel}; next unless $prereqs_r && ref $prereqs_r eq ref {}; for my $module (keys %$prereqs_r) { my $type = $rel =~ /_/ ? $rel : "runtime_$rel"; push @{$res{$module} ||= []}, { requires => $module, version => $prereqs_r->{$module}, type => $type, ($map{$rel} ? ($map{$rel} => 1) : ()), }; } } } # TODO: optional_features handling } return unless %res; $me->d->{prereq} = [map {@$_} values %res]; $me->d->{got_prereq_from} = 'META.yml'; } sub _from_cpanfile { my ($class, $me) = @_; my $cpanfile = catfile($me->distdir, "cpanfile"); return unless -f $cpanfile; eval { require Module::CPANfile; 1 }; return if $@; my $prereqs = Module::CPANfile->load($cpanfile)->prereqs->as_string_hash; my %res = $class->_handle_prereqs_v2($prereqs); return unless %res; $me->d->{prereq} = [map {@$_} values %res]; $me->d->{got_prereq_from} = 'cpanfile'; } sub _from_build_pl { my ($class, $me) = @_; my $build_pl_file = catfile($me->distdir, "Build.PL"); return unless -f $build_pl_file; my $build_pl = do { local $/; open my $fh, '<', $build_pl_file; <$fh> }; return unless $build_pl; my %map = ( requires => 'is_prereq', build_requires => 'is_build_prereq', test_requires => 'is_build_prereq', recommends => 'is_optional_prereq', ); my %res; # TODO: auto_features while($build_pl =~ s/^.*?((?:(?:configure|build|test)_)?requires|recommends|conflicts)\s*=>\s*\{/{/s) { my $rel = $1; my ($block, $left) = extract_bracketed($build_pl, '{}'); last unless $block; my $hashref = do { no strict; no warnings; eval $block }; if ($hashref && ref $hashref eq ref {}) { for my $module (keys %$hashref) { my $type = $rel =~ /_/ ? $rel : "runtime_$rel"; my ($version) = ($hashref->{$module} || 0) =~ /^([0-9.]+)/; push @{$res{$module} ||= []}, { requires => $module, version => $version, type => $type, ($map{$rel} ? ($map{$rel} => 1) : ()), }; } } $build_pl = $left; } $me->d->{prereq} = [map {@$_} values %res]; $me->d->{got_prereq_from} = 'Build.PL'; } sub _from_makefile_pl { my ($class, $me) = @_; my $distdir = $me->distdir; my %map = ( PREREQ_PM => 'is_prereq', BUILD_REQUIRES => 'is_build_prereq', TEST_REQUIRES => 'is_build_prereq', ); # There may be multiple Makefile.PLs in a distribution my %res; for my $file (@{$me->d->{files_array} || []}) { next unless $file =~ /Makefile\.PL$/; my $makefile_pl_file = catfile($distdir, $file); next unless -f $makefile_pl_file; my $makefile_pl = do { local $/; open my $fh, '<', $makefile_pl_file; <$fh> }; next unless $makefile_pl; if ($makefile_pl =~ /use\s+inc::Module::Install/) { # Module::Install # TODO while($makefile_pl =~ s/(?:^|;).+?((?:(?:configure|build|test)_)?requires|recommends)\s*([^;]+);//s) { my ($rel, $tuple_text) = ($1, $2); my @tuples = do { no strict; no warnings; eval $tuple_text }; my $type = $rel =~ /_/ ? $rel : "runtime_$rel"; while(@tuples) { my $module = shift @tuples or last; my $version = shift @tuples || 0; push @{$res{$module} ||= []}, { requires => $module, version => $version, type => $type, ($map{$rel} ? ($map{$rel} => 1) : ()), }; } } } else { # EUMM while($makefile_pl =~ s/^.*?((?:BUILD|TEST)_REQUIRES|PREREQ_PM)\s*=>\s*\{/{/s) { my $rel = $1; my ($block, $left) = extract_bracketed($makefile_pl, '{}'); last unless $block; my $hashref = do { no strict; no warnings; eval $block }; if ($hashref && ref $hashref eq ref {}) { for my $module (keys %$hashref) { my $type = $rel eq 'PREREQ_PM' ? "runtime_requires" : lc $rel; push @{$res{$module} ||= []}, { requires => $module, version => $hashref->{$module}, type => $type, ($map{$rel} ? ($map{$rel} => 1) : ()), }; } } $makefile_pl = $left; } } } $me->d->{prereq} = [map {@$_} values %res]; $me->d->{got_prereq_from} = 'Makefile.PL'; } # for META spec v2 and cpanfile sub _handle_prereqs_v2 { my ($class, $prereqs) = @_; return unless $prereqs && ref $prereqs eq ref {}; # XXX: this mapping is for backward compat only my %map = ( runtime_requires => 'is_prereq', build_requires => 'is_build_prereq', test_requires => 'is_build_prereq', runtime_recommends => 'is_optional_prereq', build_recommends => 'is_optional_prereq', test_recommends => 'is_optional_prereq', runtime_suggests => 'is_optional_prereq', build_suggests => 'is_optional_prereq', test_suggests => 'is_optional_prereq', ); my %res; for my $phase (keys %$prereqs) { my $prereqs_p = $prereqs->{$phase}; next unless $prereqs_p && ref $prereqs_p eq ref {}; for my $rel (keys %$prereqs_p) { my $prereqs_r = $prereqs_p->{$rel}; next unless $prereqs_r && ref $prereqs_r eq ref {}; for my $module (keys %$prereqs_r) { my $type = join '_', $phase, $rel; push @{$res{$module} ||= []}, { requires => $module, version => $prereqs_r->{$module}, type => $type, ($map{$type} ? ($map{$type} => 1) : ()), }; } } } %res; } sub _from_dist_ini { my ($class, $me) = @_; my $inifile = catfile($me->distdir, "dist.ini"); return unless -f $inifile; eval { require Config::INI::Reader } or return; my $config = Config::INI::Reader->read_file($inifile); return unless $config && ref $config eq ref {}; my %map = ( runtime_requires => 'is_prereq', build_requires => 'is_build_prereq', test_requires => 'is_build_prereq', runtime_recommends => 'is_optional_prereq', build_recommends => 'is_optional_prereq', test_recommends => 'is_optional_prereq', runtime_suggests => 'is_optional_prereq', build_suggests => 'is_optional_prereq', test_suggests => 'is_optional_prereq', ); my %res; for my $key (keys %$config) { next unless $key =~ /^Prereqs\b/; my ($phase, $rel) = qw(runtime requires); (undef, my $type) = split /\s*\/\s*/, $key, 2; if ($type) { if ($type =~ s/^(Configure|Build|Test|Runtime)//) { $phase = lc $1; } if ($type =~ s/^(Requires|Recommends|Suggests)//) { $rel = lc $1; } } my $conf = $config->{$key}; next unless $conf && ref $conf eq ref {}; if ($conf->{-phase}) { $phase = delete $conf->{-phase}; } if ($conf->{-relationship}) { $rel = delete $conf->{-relationship}; } for my $module (keys %$conf) { $type = join '_', $phase, $rel; push @{$res{$module} ||= []}, { requires => $module, version => $conf->{$module}, type => $type, ($map{$type} ? ($map{$type} => 1) : ()), }; } } $me->d->{prereq} = [map {@$_} values %res]; $me->d->{got_prereq_from} = 'dist.ini'; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators{ # NOTE: The metrics in this module have moved to # Module::CPANTS::SiteKwalitee because these requires databases. return []; } q{Favourite record of the moment: Fat Freddys Drop: Based on a true story}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Prereq - Checks listed prerequistes =head1 SYNOPSIS The metrics in this module have moved to L. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<100>. =head3 analyse Does nothing now. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm0000444000175000017500000001142612217464565030376 0ustar salvisalvipackage Module::CPANTS::Kwalitee::BrokenInstaller; use warnings; use strict; use File::Find; use File::Spec::Functions qw(catdir catfile abs2rel); use File::stat; our $VERSION = '0.92'; sub order { 100 } sub analyse { my $class = shift; my $me = shift; my $distdir = $me->distdir; # inc/Module/Install.pm file my $mi = catfile($distdir, 'inc', 'Module', 'Install.pm'); # Must be okay if not using Module::Install if (not -f $mi) { $me->d->{broken_module_install} = 0; return; } open my $ih, '<', $mi or die "Could not open file '$mi' for checking the bad_installer metric: $!"; my $buf; read $ih, $buf, 100000 or die $!; close $ih; if ($buf =~ /VERSION\s*=\s*("|'|)(\d+|\d*\.\d+(?:_\d+)?)\1/m) { $me->d->{module_install_version} = my $version = $2; my $non_devel = $version; $non_devel =~ s/_\d+$//; if ($non_devel < 0.61 or $non_devel == 1.04) { $me->d->{broken_module_install} = $version; } if ($non_devel < 0.89) { my $makefilepl = catfile($distdir, 'Makefile.PL'); return if not -f $makefilepl; open my $ih, '<', $makefilepl or die "Could not open file '$makefilepl' for checking the bad_installer metric: $!"; local $/ = undef; my $mftext = <$ih>; close $ih; return if not defined $mftext; if ($mftext =~ /auto_install/) { $me->d->{broken_auto_install} = 1; } else { return; } if ($non_devel < 0.64) { $me->d->{broken_module_install} = $version; } } } else { # Unknown version (parsing $VERSION failed) $me->d->{broken_module_install} = 1; } return; } sub kwalitee_indicators { return [ { name=>'no_broken_module_install', error=>q{This distribution uses an obsolete version of Module::Install. Versions of Module::Install prior to 0.61 might not work on some systems at all. Additionally if your Makefile.PL uses the 'auto_install()' feature, you need at least version 0.64. Also, 1.04 is known to be broken.}, remedy=>q{Upgrade the bundled version of Module::Install to the most current release. Alternatively, you can switch to another build system / installer that does not suffer from this problem. (ExtUtils::MakeMaker, Module::Build both of which have their own set of problems.)}, code=>sub { shift->{broken_module_install} ? 0 : 1 }, details=> sub { q{This distribution uses obsolete Module::Install version }.(shift->{module_install_version}); }, }, { name=>'no_broken_auto_install', error=>q{This distribution uses an old version of Module::Install. Versions of Module::Install prior to 0.89 does not detect correcty that CPAN/CPANPLUS shell is used.}, remedy=>q{Upgrade the bundled version of Module::Install to at least 0.89, but preferably to the most current release. Alternatively, you can switch to another build system / installer that does not suffer from this problem. (ExtUtils::MakeMaker, Module::Build both of which have their own set of problems.)}, code=>sub { shift->{broken_auto_install} ? 0 : 1 }, details=> sub { q{This distribution uses obsolete Module::Install version }.(shift->{module_install_version}); }, }, ]; } 1 __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::BrokenInstaller - Check for broken Module::Install =head1 SYNOPSIS Find out whether the distribution uses an outdaten version of Module::Install. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<100>, as data generated by this should not be used by any other tests. =head3 analyse C checks whether the distribution uses Module::Install and if so whether it uses a reasonably current version of it (0.61 or later). It also checks whether the F uses the C feature. If so, C should be at least version 0.64. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =over =item * no_broken_module_install =item * no_broken_auto_install =back =head1 SEE ALSO L =head1 AUTHOR L L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2009 L Copyright © 2006 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/MetaYML.pm0000444000175000017500000002346712217464565026560 0ustar salvisalvipackage Module::CPANTS::Kwalitee::MetaYML; use warnings; use strict; use File::Spec::Functions qw(catfile); use CPAN::Meta::YAML; use CPAN::Meta::Validator; use List::Util qw/first/; our $VERSION = '0.92'; sub order { 10 } my $CURRENT_SPEC = '1.4'; my $JSON_CLASS; ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; my $distdir=$me->distdir; my $meta_yml=catfile($distdir,'META.yml'); # META.yml is not always the most preferred meta file, # but test it anyway because it may be broken sometimes. if (-f $meta_yml) { eval { open my $fh, '<:utf8', $meta_yml or die $!; my $yaml = do { local $/; <$fh> }; my $meta = CPAN::Meta::YAML->read_string($yaml) or die CPAN::Meta::YAML->errstr; # Broken META.yml may return a "YAML 1.0" string first. # eg. M/MH/MHASCH/Date-Gregorian-0.07.tar.gz $me->d->{meta_yml}=first { ref $_ eq ref {} } @$meta; $me->d->{metayml_is_parsable}=1; }; if ($@) { $me->d->{error}{metayml_is_parsable}=$@; } } else { $me->d->{error}{metayml_is_parsable}="META.yml was not found"; } # If there's no META.yml, or META.yml has some errors, # check META.json. if (!$me->d->{meta_yml}) { unless ($JSON_CLASS) { for (qw/JSON::XS JSON::PP/) { if (eval "require $_; 1;") { $JSON_CLASS = $_; last; } } } my $meta_json = catfile($distdir,'META.json'); if ($JSON_CLASS && -f $meta_json) { eval { open my $fh, '<:utf8', $meta_json or return; my $json = do { local $/; <$fh> }; my $meta = $JSON_CLASS->new->utf8->decode($json); $me->d->{meta_yml} = $meta; $me->d->{metayml_is_parsable} = 1; }; if ($@) { $me->d->{error}{metajson_is_parsable} = $@; } } } # If we still don't have meta data, try MYMETA.yml as we may be # testing a local distribution. if (!$me->d->{meta_yml}) { my $mymeta_yml = catfile($distdir, 'MYMETA.yml'); if (-f $mymeta_yml) { eval { open my $fh, '<:utf8', $mymeta_yml or die $!; my $yaml = do { local $/; <$fh> }; my $meta = CPAN::Meta::YAML->read_string($yaml) or die CPAN::Meta::YAML->errstr; $me->d->{meta_yml}=first { ref $_ eq ref {} } @$meta; $me->d->{metayml_is_parsable} = 1; }; } } # Should we still try MYMETA.json? my $meta = $me->d->{meta_yml}; return unless $meta && ref $meta eq ref {}; $me->d->{dynamic_config} = $meta->{dynamic_config} ? 1 : 0; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators{ return [ { name=>'metayml_is_parsable', error=>q{The META.yml file of this distribution could not be parsed by the version of CPAN::Meta::YAML.pm CPANTS is using.}, remedy=>q{If you don't have one, add a META.yml file. Else, upgrade your YAML generator so it produces valid YAML.}, code=>sub { my $d = shift; !$d->{error}{metayml_is_parsable} && $d->{metayml_is_parsable} ? 1 : 0 }, details=>sub { my $d = shift; $d->{error}{metayml_is_parsable}; }, }, { name=>'metayml_has_license', error=>q{This distribution does not have a license defined in META.yml.}, remedy=>q{Define the license if you are using in Build.PL. If you are using MakeMaker (Makefile.PL) you should upgrade to ExtUtils::MakeMaker version 6.31.}, is_extra=>1, code=>sub { my $d=shift; my $yaml=$d->{meta_yml}; ($yaml->{license} and $yaml->{license} ne 'unknown') ? 1 : 0 }, details=>sub { my $d = shift; my $yaml = $d->{meta_yml}; return "No META.yml." unless $yaml; return "No license was found in META.yml." unless $yaml->{license}; return "Unknown license was found in META.yml."; }, }, { name=>'metayml_has_provides', is_experimental=>1, error=>q{This distribution does not have a list of provided modules defined in META.yml.}, remedy=>q{Add all modules contained in this distribution to the META.yml field 'provides'. Module::Build does this automatically for you.}, code=>sub { my $d=shift; return 1 if $d->{meta_yml} && $d->{meta_yml}{provides}; return 0; }, details=>sub { my $d = shift; return "No META.yml." unless $d->{meta_yml}; return q{No "provides" was found in META.yml.}; }, }, { name=>'metayml_conforms_to_known_spec', error=>q{META.yml does not conform to any recognised META.yml Spec.}, remedy=>q{Take a look at the META.yml Spec at http://module-build.sourceforge.net/META-spec-current.html and change your META.yml accordingly.}, code=>sub { my $d=shift; return check_spec_conformance($d); }, details=>sub { my $d = shift; return "No META.yml." unless $d->{meta_yml}; return join "; ", @{$d->{error}{metayml_conforms_to_known_spec}}; }, }, { name=>'metayml_conforms_spec_current', is_extra=>1, error=>qq{META.yml does not conform to the Current META.yml Spec ($CURRENT_SPEC).}, remedy=>q{Take a look at the META.yml Spec at http://module-build.sourceforge.net/META-spec-current.html and change your META.yml accordingly.}, code=>sub { my $d=shift; return check_spec_conformance($d,$CURRENT_SPEC,1); }, details=>sub { my $d = shift; return "No META.yml." unless $d->{meta_yml}; return join "; ", @{$d->{error}{metayml_conforms_spec_current}}; }, }, { name=>'metayml_declares_perl_version', error=>q{This distribution does not declare the minimum perl version in META.yml.}, is_extra=>1, remedy=>q{If you are using Build.PL define the {requires}{perl} = VERSION field. If you are using MakeMaker (Makefile.PL) you should upgrade ExtUtils::MakeMaker to 6.48 and use MIN_PERL_VERSION parameter. Perl::MinimumVersion can help you determine which version of Perl your module needs.}, code=>sub { my $d=shift; my $yaml=$d->{meta_yml}; return ref $yaml->{requires} eq ref {} && $yaml->{requires}{perl} ? 1 : 0; }, details=>sub { my $d = shift; my $yaml = $d->{meta_yml}; return "No META.yml." unless $yaml; return q{No "requires" was found in META.yml.} unless ref $yaml->{requires} eq ref {}; return q{No "perl" subkey was found in META.yml.} unless $yaml->{requires}{perl}; }, }, ]; } sub check_spec_conformance { my ($d,$version,$check_current)=@_; my $report_version= $version || 'known'; my $yaml=$d->{meta_yml}; unless ($yaml && ref $yaml eq ref {} && %$yaml) { my $errorname='metayml_conforms_'.($check_current?'spec_current':'to_known_spec'); $d->{error}{$errorname} = [$report_version, 'META.yml is missing/empty']; return 0; } my $spec = CPAN::Meta::Validator->new($yaml); $spec->{spec} = $version if $version; if (!$spec->is_valid) { my @errors; foreach my $e ($spec->errors) { next if $e=~/specification URL/ && $check_current; push @errors,$e; } if (@errors) { my $errorname='metayml_conforms_'.($check_current?'spec_current':'to_known_spec'); $d->{error}{$errorname} = [$report_version, sort @errors]; return 0; } } return 1; } q{Barbies Favourite record of the moment: Nine Inch Nails: Year Zero}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::MetaYML - Checks data availabe in META.yml =head1 SYNOPSIS Checks various pieces of information in META.yml =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<10>. MetaYML should be checked earlier than Files to handle no_index correctly. =head3 analyse C checks C. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =over =item * metayml_is_parsable =item * metayml_has_license =item * metayml_has_provides =item * metayml_conforms_to_known_spec =item * metayml_conforms_spec_current =item * metayml_declares_perl_version =back =head3 check_spec_conformance check_spec_conformance($d,$version); Validates META.yml using Test::CPAN::Meta. =head1 SEE ALSO L =head1 AUTHOR L and L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2009 L Copyright © 2006–2008 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Signature.pm0000444000175000017500000000253012217464565027235 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Signature; use strict; use warnings; our $VERSION = '0.92'; sub order { 100 } sub analyse { my ($class, $self) = @_; # NOTE: The analysis/metric in this module has moved to # Module::CPANTS::SiteKwalitee because this requires an external # tool (though optional) and decent network connection to # validate a signature. # Note also that this stub should not be removed so that # this can replace the old ::Signature module, and the old # metrics will not be loaded while loading plugins. } sub kwalitee_indicators { return []; } 1; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Signature - dist has a valid signature =head1 SYNOPSIS The metrics in this module have moved to L. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<100>. =head3 analyse Does nothing now. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =head1 SEE ALSO L =head1 AUTHOR Lars Dɪᴇᴄᴋᴏᴡ C<< >> =head1 LICENCE AND COPYRIGHT Copyright © 2012, Lars Dɪᴇᴄᴋᴏᴡ C<< >>. This module is free software; you can redistribute it and/or modify it under the same terms as Perl 5.14. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/FindModules.pm0000444000175000017500000001326312217464565027512 0ustar salvisalvipackage Module::CPANTS::Kwalitee::FindModules; use warnings; use strict; use Data::Dumper; use File::Spec::Functions; our $VERSION = '0.92'; sub order { 30 } ################################################################## # Analyse ################################################################## sub analyse { my $class=shift; my $me=shift; my $files=$me->d->{files_array} || []; if ($me->d->{meta_yml} && $me->d->{meta_yml}{provides}) { my $provides = $me->d->{meta_yml}{provides}; while (my ($module,$data)=each %$provides) { next unless ref $data eq ref {}; # ignore wrong format my $file=$data->{file} || ''; my $found={ module=>$module, file=>$file, in_basedir=>0, in_lib=>0, }; my $loc; if ($file=~/^lib\W/) { $found->{in_lib}=1; } elsif ($file !~/\//) { $found->{in_basedir}=1; } push(@{$me->d->{modules}},$found); } } else { my %in_basedir= map {$_=>1} grep {/^[^\/]+\.pm$/} @$files; foreach my $file (@$files) { next unless $file=~/\.pm$/; next if $file=~m{^x?t/}; next if $file=~m{^test/}; next if $file=~m/^(bin|scripts?|ex|eg|examples?|samples?|demos?)\/\w/i; next if $file=~m{^inc/}; # skip Module::Install stuff # proper file in lib/ if ($file=~m|^lib/(.*)\.pm$|) { my $module=$1; $module=~s|/|::|g; push (@{$me->d->{modules}},{ module=>$module, file=>$file, in_basedir=>0, in_lib=>1, }); } else { # open file and find first package my $module; my $max_lines_to_look_at=666; open (my $fh,"<",catfile($me->distdir,$file)) || die "__PACKAGE__: Cannot open $file to find package declaration: $!"; while (my $line = <$fh>) { next if $line =~/^\s*#/; # ignore comments if ($line =~/^\s*package\s*(.*?)\s*;/) { $module=$1; last; } last if $line =~/^__(DATA|END)__/; $max_lines_to_look_at--; last unless $max_lines_to_look_at; } # try to guess from filename unless ($module) { $file=~m|(.*)\.pm$|; $module=$1; $module=~s|^[a-z]+/||; # remove lowercase prefixes which most likely are not part of the distname (but something like 'src/') $module=~s|/|::|g; } if ($module) { push(@{$me->d->{modules}}, { module=>$module, file=>$file, in_basedir=> $in_basedir{$file} ? 1 : 0, in_lib=>0, }); } } } } return 1; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators { return [ { name=>'proper_libs', error=>q{There is more than one .pm file in the base dir, or the .pm files are not in lib/ directory.}, remedy=>q{Move your *.pm files in a directory named 'lib'. The directory structure should look like 'lib/Your/Module.pm' for a module named 'Your::Module'.}, is_extra => 1, code=>sub { my $d=shift; my @modules = @{$d->{modules} || []}; return 1 unless @modules; my @not_in_lib = grep { !$_->{in_lib} } @modules; return 1 unless @not_in_lib; my @in_basedir=grep { $_->{in_basedir} } @not_in_lib; return 1 if @in_basedir == 1; $d->{error}{proper_libs} = join ', ', map {$_->{file}} @not_in_lib; return 0; }, details=>sub { my $d = shift; my @modules = @{$d->{modules} || []}; return "No modules were found" unless @modules; return "The following files were found: ".$d->{error}{proper_libs}; }, }, ]; } q{Favourite record of the moment: Fat Freddys Drop: Based on a true story}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::FindModules - Find modules provided by a dist =head1 SYNOPSIS Finds and reports all modules (i.e. F<*.pm> files) in a distribution. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<30>, as data generated by C is used by other tests. =head3 analyse C first looks in C and F for C<*.pm> files. If it doesn't find any, it looks in the whole dist, but the C kwalitee point is only awarded if the modules are F or there's only one module in C. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =over =item * proper_libs =back =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Pod.pm0000444000175000017500000000355012217464565026021 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Pod; use warnings; use strict; our $VERSION = '0.92'; sub order { 100 } ################################################################## # Analyse ################################################################## sub analyse { # NOTE: This test has moved to Module::CPANTS::SiteKwalitee # because in many cases the pod correctness is tested by # another (author) test using Test::Pod (as it has long been # encouraged). Let's double check only on the server side. # Note also that this stub should not be removed so that # this can replace the old ::Pod module, and the old # metrics will not be loaded while loading plugins. } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators { return []; } q{Favourite record of the moment: Fat Freddys Drop: Based on a true story}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Pod - Check Pod =head1 SYNOPSIS The check in this module has moved to L to double-check the pod correctness on the server side. If you do care, it is recommended to add a test to test pod (with L) in "xt/" directory in your distribution. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<100>. =head3 analyse Does nothing now. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Version.pm0000444000175000017500000000322512217464565026723 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Version; use warnings; use strict; our $VERSION = '0.92'; sub order { 100 } ################################################################## # Analyse ################################################################## sub analyse { # NOTE: The analysis/metrics in this module have moved to # Module::CPANTS::SiteKwalitee because these requires # a finalized META file to detect (or ignore) versions # correctly. # Note also that this stub should not be removed so that # this can replace the old ::Prereq module, and the old # metrics will not be loaded while loading plugins. } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators { return []; } q{Favourite record of the moment: Fat Freddys Drop: Based on a true story}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Version - check versions =head1 SYNOPSIS The metrics in this module have moved to L. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<100>. =head3 analyse Does nothing now. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Distros.pm0000444000175000017500000000647412217464565026736 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Distros; use warnings; use strict; our $VERSION = '0.92'; sub order { 800 } ################################################################## # Analyse ################################################################## my $debian; sub analyse { my $class=shift; my $me=shift; # NOTE: The data source of these debian metrics has not been # updated for more than a year, and mirroring stuff from # external source every time you test is very nasty. # These metrics are deprecated and actually removed to # reduce unwanted dependencies for Test::Kwalitee users. # Note also that this stub should not be removed so that # this can replace the old ::Distro module, and the old # metrics will not be loaded while loading plugins. return; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators{ return []; } q{Favourite record of the moment: Lili Allen - Allright, still}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Distros - Information retrieved from the various Linux and other distributions =head1 SYNOPSIS The metrics here were based on data provided by the various downstream packaging systems, but are deprecated now. The list is only preserved for historical reasons. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. =head3 analyse =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =head1 Caveats CPAN_dist, the name of CPAN distribution is inferred from the download location, for Debian packages. It works 99% of the time, but it is not completely reliable. If it fails to detect something, it will spit out the known download location. CPAN_vers, the version number reported by Debian is inferred from the debian version. This fails a lot, since Debian has a mechanism for "unmangling" upstream versions which is non-reversible. We have to use that many times to fix versioning problems, and those packages will show a different version (e.g. 1.080 vs 1.80) The first problem is something the Debian people like to solve by adding metadata to the packages, for many other useful stuff (like automatic upstream bug tracking and handling). About the second... well, it's a difficult one. CPANTS does not yet handle the second issue. =head1 LINKS Basic homepage: http://packages.debian.org/src:$pkgname Detalied homepage: http://packages.qa.debian.org/$pkgname Bugs report: http://bugs.debian.org/src:$pkgname Public SVN repository: http://svn.debian.org/wsvn/pkg-perl/trunk/$pkg From that last URL, you might be interested in the debian/ and debian/patches subdirectories. =head1 SEE ALSO L =head1 AUTHOR L and L with the help of Martín Ferrari and the L. =head1 COPYRIGHT AND LICENSE Copyright © 2003–2009 L Copyright © 2006–2008 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee/Files.pm0000444000175000017500000002776612217464565026360 0ustar salvisalvipackage Module::CPANTS::Kwalitee::Files; use warnings; use strict; use File::Find::Rule::VCS; use File::Spec::Functions qw(catdir catfile abs2rel splitdir); use File::stat; use File::Basename; use Data::Dumper; our $VERSION = '0.92'; sub order { 15 } ################################################################## # Analyse ################################################################## my $large_file = 200_000; sub analyse { my $class=shift; my $me=shift; my $distdir=$me->distdir; my $file_find_rule = File::Find::Rule::VCS->file()->relative(); my $dir_find_rule = File::Find::Rule::VCS->directory()->relative(); if ($me->d->{is_local_distribution}) { $file_find_rule->ignore_vcs(); $dir_find_rule->ignore_vcs(); } my @files = $file_find_rule->in($distdir); my @dirs = $dir_find_rule->in($distdir); #my $unixy=join('/',splitdir($File::Find::name)); # Respect no_index if possible my $no_index_re = $class->_make_no_index_regex($me); my $size = 0; my %files; foreach my $name (@files) { my $path = catfile($distdir, $name); $files{$name}{size} += -s $path || 0; $size += $files{$name}{size}; } #die Dumper \%files; $me->d->{size_unpacked}=$size; # find symlinks my @symlinks; foreach my $f (@dirs, @files) { my $p = catfile($distdir,$f); if (-l $p) { push(@symlinks,$f); } } # above checks should be done even with files to be ignored if ($no_index_re) { my %ignored_files; for my $name (@files) { (my $name_to_test = $name) =~ s|\\|/|g; $name_to_test =~ s|/$||; if ($name_to_test =~ qr/$no_index_re/) { $ignored_files{$name} = 1; next; } } @files = grep { !$ignored_files{$_} } @files; $me->d->{ignored_files_array} = [sort keys %ignored_files]; } # store stuff $me->d->{files}=scalar @files; $me->d->{files_array}=\@files; $me->d->{files_hash}=\%files; $me->d->{dirs}=scalar @dirs; $me->d->{dirs_array}=\@dirs; $me->d->{symlinks}=scalar @symlinks; $me->d->{symlinks_list}=join(';',@symlinks); # find special files my %reqfiles; my @special_files=(qw(Makefile.PL Build.PL META.yml META.json MYMETA.yml MYMETA.json dist.ini cpanfile SIGNATURE MANIFEST test.pl LICENSE LICENCE)); map_filenames($me, \@special_files, \@files); # find more complex files my %regexs=( file_changelog=>qr{^chang|history}i, file_readme=>qr{^readme(?:\.(?:txt|md))?}i, ); while (my ($name,$regex)=each %regexs) { $me->d->{$name}=join(',',grep {$_=~/$regex/} @files); } # find special dirs my @special_dirs=(qw(lib t xt)); foreach my $dir (@special_dirs){ my $db_dir="dir_".$dir; $me->d->{$db_dir}=((grep {$_ eq "$dir"} @dirs)?1:0); } # get mtime my $mtime=0; foreach (@files) { next if /\//; my $to_stat=catfile($distdir,$_); next unless -e $to_stat; # TODO hmm, warum ist das kein File? my $stat=stat($to_stat); $files{$_}{mtime} = my $thismtime=$stat->mtime; $mtime=$thismtime if $mtime<$thismtime; } $me->d->{newest_file_epoch}=$mtime; # $me->d->{released}=scalar localtime($mtime); # check STDIN in Makefile.PL and Build.PL # objective: convince people to use prompt(); # http://www.perlfoundation.org/perl5/index.cgi?cpan_packaging { foreach my $file ('Makefile.PL', 'Build.PL') { (my $handle = $file) =~ s/\./_/; $handle = "stdin_in_" . lc $handle; my $path = catfile($me->distdir,$file); next if not -e $path; if (open my $fh, '<', $path) { if (grep {//} <$fh>) { $me->d->{$handle} = 1; } } } } return; } sub map_filenames { my ($me, $special_files, $files) = @_; my %ret; foreach my $file (@$special_files){ (my $db_file=$file)=~s/\./_/g; $db_file="file_".lc($db_file); $me->d->{$db_file}=((grep {$_ eq "$file"} @$files)?1:0); $ret{$db_file}=$file; } return %ret; } sub _make_no_index_regex { my ($class, $me) = @_; my $meta = $me->d->{meta_yml}; return unless $meta && ref $meta eq ref {}; my $no_index = $meta->{no_index} || $meta->{private}; return unless $no_index && ref $no_index eq ref {}; my %map = ( file => '\z', directory => '/', ); my @ignore; for my $type (qw/file directory/) { next unless $no_index->{$type}; my $rest = $map{$type}; my @entries = ref $no_index->{$type} eq ref [] ? @{ $no_index->{$type} } : ( $no_index->{$type} ); push @ignore, map {"^$_$rest"} @entries; } return unless @ignore; $me->d->{no_index} = join ';', sort @ignore; return '(?:' . (join '|', @ignore) . ')'; } ################################################################## # Kwalitee Indicators ################################################################## sub kwalitee_indicators { return [ { name=>'has_readme', error=>q{The file "README" is missing from this distribution. The README provides some basic information to users prior to downloading and unpacking the distribution.}, remedy=>q{Add a README to the distribution. It should contain a quick description of your module and how to install it.}, code=>sub { shift->{file_readme} ? 1 : 0 }, details=>sub { my $d = shift; return "README was not found."; }, }, { name=>'has_manifest', error=>q{The file "MANIFEST" is missing from this distribution. The MANIFEST lists all files included in the distribution.}, remedy=>q{Add a MANIFEST to the distribution. Your buildtool should be able to autogenerate it (eg "make manifest" or "./Build manifest")}, code=>sub { shift->{file_manifest} ? 1 : 0 }, details=>sub { my $d = shift; return "MANIFEST was not found."; }, }, { name=>'has_meta_yml', error=>q{The file "META.yml" is missing from this distribution. META.yml is needed by people maintaining module collections (like CPAN), for people writing installation tools, or just people who want to know some stuff about a distribution before downloading it.}, remedy=>q{Add a META.yml to the distribution. Your buildtool should be able to autogenerate it.}, code=>sub { my $d = shift; return 1 if $d->{file_meta_yml}; return 1 if $d->{is_local_distribution} && $d->{file_mymeta_yml}; return 0; }, details=>sub { my $d = shift; return "META.yml was not found."; }, }, { name=>'has_buildtool', error=>q{Makefile.PL and/or Build.PL are missing. This makes installing this distribution hard for humans and impossible for automated tools like CPAN/CPANPLUS/cpanminus.}, remedy=>q{Add a Makefile.PL (for ExtUtils::MakeMaker/Module::Install) or a Build.PL (for Module::Build and its friends), or use a distribution builder such as Dist::Zilla, Dist::Milla, Minilla.}, code=>sub { my $d=shift; return 1 if $d->{file_makefile_pl} || $d->{file_build_pl}; return 0; }, details=>sub { my $d = shift; return "Neither Makefile.PL nor Build.PL was found."; }, }, { name=>'has_changelog', error=>q{The distribution hasn't got a Changelog (named something like m/^chang(es?|log)|history$/i. A Changelog helps people decide if they want to upgrade to a new version.}, remedy=>q{Add a Changelog (best named 'Changes') to the distribution. It should list at least major changes implemented in newer versions.}, code=>sub { shift->{file_changelog} ? 1 : 0 }, details=>sub { my $d = shift; return "Any Changelog file was not found."; }, }, { name=>'no_symlinks', error=>q{This distribution includes symbolic links (symlinks). This is bad, because there are operating systems that do not handle symlinks.}, remedy=>q{Remove the symlinks from the distribution.}, code=>sub {shift->{symlinks} ? 0 : 1}, details=>sub { my $d = shift; return "The following symlinks were found: ".$d->{symlinks_list}; }, }, { name=>'has_tests', error=>q{This distribution doesn't contain either a file called 'test.pl' or a directory called 't'. This indicates that it doesn't contain even the most basic test-suite. This is really BAD!}, remedy=>q{Add tests!}, code=>sub { my $d=shift; # TODO: make sure if .t files do exist in t/ directory. return 1 if $d->{file_test_pl} || $d->{dir_t}; return 0; }, details=>sub { my $d = shift; return q{Neither "test.pl" nor "t/" directory was not found.}; }, }, { name=>'has_tests_in_t_dir', is_extra=>1, error=>q{This distribution contains either a file called 'test.pl' (the old test file) or is missing a directory called 't'. This indicates that it uses the old test mechanism or it has no test-suite.}, remedy=>q{Add tests or move tests.pl to the t/ directory!}, code=>sub { my $d=shift; # TODO: make sure if .t files do exist in t/ directory. return 1 if !$d->{file_test_pl} && $d->{dir_t}; return 0; }, details=>sub { my $d = shift; return q{"test.pl" was found.} if $d->{file_test_pl}; return q{"t/" directory was not found.}; }, }, { name=>'no_stdin_for_prompting', error=>q{This distribution is using direct call from STDIN instead of prompt(). Make sure STDIN is not used in Makefile.PL or Build.PL. See http://www.perlfoundation.org/perl5/index.cgi?cpan_packaging}, is_extra=>1, remedy=>q{Use the prompt() method from ExtUtils::MakeMaker/Module::Build.}, code=>sub { my $d=shift; if ($d->{stdin_in_makefile_pl}||$d->{stdin_in_build_pl}) { return 0; } return 1; }, details=>sub { my $d = shift; return " was found in Makefile.PL" if $d->{stdin_in_makefile_pl}; return " was found in Build.PL" if $d->{stdin_in_build_pl}; }, }, ]; } q{Favourite record of the moment: Fat Freddys Drop: Based on a true story}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee::Files - Check for various files =head1 SYNOPSIS Find various files and directories that should be part of every self-respecting distribution. =head1 DESCRIPTION =head2 Methods =head3 order Defines the order in which Kwalitee tests should be run. Returns C<15>, as data generated by C is used by all other tests. =head3 map_filenames get db_filenames from real_filenames =head3 analyse C uses C to get a list of all files and dirs in a dist. It checks if certain crucial files are there, and does some other file-specific stuff. =head3 get_files The subroutine used by C. Unfortunantly, it depends on some global values. =head3 kwalitee_indicators Returns the Kwalitee Indicators datastructure. =over =item * has_readme =item * has_manifest =item * has_meta_yml =item * has_buildtool =item * has_changelog =item * no_symlinks =item * has_tests =item * has_tests_in_t_dir =item * no_stdin_for_prompting =back =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Analyse.pm0000444000175000017500000001501412217464565025124 0ustar salvisalvipackage Module::CPANTS::Analyse; use 5.006; use strict; use warnings; use base qw(Class::Accessor); use File::Temp qw(tempdir); use File::Spec::Functions qw(catfile catdir splitpath); use File::Copy; use Archive::Any::Lite; use Carp; use Module::CPANTS::Kwalitee; use IO::Capture::Stdout; use IO::Capture::Stderr; use CPAN::DistnameInfo; our $VERSION = '0.92'; # setup logger if (! main->can('logger')) { *main::logger = sub { print "## $_[0]\n" if $main::logging; }; } use Module::Pluggable search_path=>['Module::CPANTS::Kwalitee']; __PACKAGE__->mk_accessors(qw(dist opts tarball distdir d mck capture_stdout capture_stderr)); __PACKAGE__->mk_accessors(qw(_testdir _dont_cleanup _tarball)); sub new { my $class=shift; my $opts=shift || {}; $opts->{d}={}; $opts->{opts} ||= {}; my $me=bless $opts,$class; $main::logging = 1 if $me->opts->{verbose}; Carp::croak("need a dist") if not defined $opts->{dist}; main::logger("distro: $opts->{dist}"); $me->mck(Module::CPANTS::Kwalitee->new); # For Test::Kwalitee and friends $me->d->{is_local_distribution} = 1 if -d $opts->{dist}; unless ($me->opts->{no_capture} or $INC{'Test/More.pm'}) { my $cserr=IO::Capture::Stderr->new; my $csout=IO::Capture::Stdout->new; $cserr->start; $csout->start; $me->capture_stderr($cserr); $me->capture_stdout($csout); } return $me; } sub unpack { my $me=shift; return 'cant find dist' unless $me->dist; my $di=CPAN::DistnameInfo->new($me->dist); my ($major,$minor); if ($di->version) { ($major,$minor)=$di->version=~/^(\d+)\.(.*)/; } $major=0 unless defined($major); my $ext=$di->extension || 'unknown'; $me->d->{package}=$di->filename; $me->d->{vname}=$di->distvname; $me->d->{extension}=$ext; $me->d->{version}=$di->version; $me->d->{version_major}=$major; $me->d->{version_minor}=$minor; $me->d->{dist}=$di->dist; $me->d->{author}=$di->cpanid; unless($me->d->{package}) { $me->d->{package}=$me->tarball; } copy($me->dist,$me->testfile); $me->d->{size_packed}=-s $me->testfile; my $archive; eval { $archive=Archive::Any::Lite->new($me->testfile); $archive->extract($me->testdir); }; if (my $error=$@) { if (not $INC{'Test/More.pm'}) { $me->capture_stdout->stop; $me->capture_stderr->stop; } $me->d->{extractable}=0; $me->d->{error}{cpants}=$error; $me->d->{kwalitee}{extractable}=0; my ($vol,$dir,$name)=splitpath($me->dist); $name=~s/\..*$//; $name=~s/\-[\d\.]+$//; $me->d->{dist}=$name; return $error; } $me->d->{extractable}=1; unlink($me->testfile); opendir(my $fh_testdir,$me->testdir) || die "Cannot open ".$me->testdir.": $!"; my @stuff=grep {/\w/} readdir($fh_testdir); if (@stuff == 1) { my $vname = $di->distvname; $vname =~ s/\-TRIAL//; $me->distdir(catdir($me->testdir,$stuff[0])); $me->d->{extracts_nicely}=1 if $vname eq $stuff[0]; } else { $me->distdir(catdir($me->testdir)); $me->d->{extracts_nicely}=0; } return; } sub analyse { my $me=shift; foreach my $mod (@{$me->mck->generators}) { main::logger("analyse $mod"); $mod->analyse($me); } } sub calc_kwalitee { my $me=shift; my $kwalitee=0; $me->d->{kwalitee}={}; foreach my $mod (@{$me->mck->generators}) { foreach my $i (@{$mod->kwalitee_indicators}) { next if $i->{needs_db}; main::logger($i->{name}); my $rv=$i->{code}($me->d, $i); $me->d->{kwalitee}{$i->{name}}=$rv; $kwalitee+=$rv; } } $me->d->{'kwalitee'}{'kwalitee'}=$kwalitee; main::logger("done"); } #---------------------------------------------------------------- # helper methods #---------------------------------------------------------------- sub testdir { my $me=shift; return $me->_testdir if $me->_testdir; if ($me->_dont_cleanup) { return $me->_testdir(tempdir()); } else { return $me->_testdir(tempdir(CLEANUP => 1)); } } sub testfile { my $me=shift; return catfile($me->testdir,$me->tarball); } sub tarball { my $me=shift; return $me->_tarball if $me->_tarball; my (undef,undef,$tb)=splitpath($me->dist); return $me->_tarball($tb); } q{Favourite record of the moment: Jahcoozi: Pure Breed Mongrel}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Analyse - Generate Kwalitee ratings for a distribution =head1 SYNOPSIS use Module::CPANTS::Analyse; my $analyser=Module::CPANTS::Analyse->new({ dist=>'path/to/Foo-Bar-1.42.tgz', }); $analyser->unpack; $analyser->analyse; $analyser->calc_kwalitee; # results are in $analyser->d; =head1 DESCRIPTION =head2 Methods =head3 new my $analyser=Module::CPANTS::Analyse->new({dist=>'path/to/file'}); Plain old constructor. =head3 unpack Unpack the distribution into a temporary directory. Returns an error if something went wrong, C if all went well. =head3 analyse Run all analysers (defined in C on the dist. =head3 calc_kwalitee Check if the dist conforms to the Kwalitee indicators. =head2 Helper Methods =head3 testdir Returns the path to the unique temp directory. =head3 testfile Returns the location of the unextracted tarball. =head3 tarball Returns the filename of the tarball. =head3 read_meta_yml Reads the META.yml file and returns its content. =head1 WEBSITE L =head1 BUGS Please report any bugs or feature requests, or send any patches, to bug-module-cpants-analyse at rt.cpan.org, or through the web interface at L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 AUTHOR L Please use the C mailing list for discussing all things CPANTS: L Based on work by L and the original idea proposed by L. =head1 LICENSE This code is Copyright © 2003–2006 L. All rights reserved. You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/lib/Module/CPANTS/Kwalitee.pm0000444000175000017500000001141212217464565025273 0ustar salvisalvipackage Module::CPANTS::Kwalitee; use 5.006; use strict; use warnings; use base qw(Class::Accessor); use Module::Pluggable search_path=>['Module::CPANTS::Kwalitee']; use Carp; our $VERSION = '0.92'; __PACKAGE__->mk_accessors(qw(generators _gencache _genhashcache _available _total)); sub new { my $class=shift; my $me=bless {},$class; my %generators; foreach my $gen ($me->plugins) { ## no critic (ProhibitStringyEval) eval "require $gen"; croak qq{cannot load $gen: $@} if $@; $generators{$gen}= [ $gen->order, $gen ]; } # sort by 'order' first, then name my @generators=sort { $generators{$a}->[0] <=> $generators{$b}->[0] || $generators{$a}->[1] cmp $generators{$b}->[1] } keys %generators; $me->generators(\@generators); $me->_gencache({}); return $me; } sub get_indicators { my $self=shift; my $type = shift || 'all'; $type='is_extra' if $type eq 'optional'; $type='is_experimental' if $type eq 'experimental'; my $indicators; if ($self->_gencache->{$type}) { $indicators=$self->_gencache->{$type}; } else { foreach my $gen (@{$self->generators}) { foreach my $ind (@{$gen->kwalitee_indicators}) { if ($type eq 'all' || ($type eq 'core' && !$ind->{is_extra} && !$ind->{is_experimental}) || $ind->{$type}) { $ind->{defined_in}=$gen; push(@$indicators,$ind); } } } $self->_gencache->{$type}=$indicators; } return wantarray ? @$indicators : $indicators; } sub get_indicators_hash { my $self=shift; my $indicators; if ($self->_genhashcache) { $indicators=$self->_genhashcache; } else { foreach my $gen (@{$self->generators}) { foreach my $ind (@{$gen->kwalitee_indicators}) { $ind->{defined_in}=$gen; $indicators->{$ind->{name}}=$ind; } } $self->_genhashcache($indicators); } return $indicators; } sub available_kwalitee { my $self=shift; my $mem=$self->_available; return $mem if $mem; my $available; foreach my $g ($self->get_indicators) { $available++ unless $g->{is_extra} || $g->{is_experimental}; } $self->_available($available); } sub total_kwalitee { my $self=shift; my $mem=$self->_total; return $mem if $mem; my $available; foreach my $g ($self->get_indicators) { $available++ unless $g->{is_experimental}; } $self->_total($available); } sub all_indicator_names { my $self=shift; my @all=map { $_->{name} } $self->get_indicators; return wantarray ? @all : \@all; } sub core_indicator_names { my $self=shift; my @all=map { $_->{name} } grep { !$_->{is_extra} && !$_->{is_experimental} } $self->get_indicators; return wantarray ? @all : \@all; } sub optional_indicator_names { my $self=shift; my @all=map { $_->{name} } grep { $_->{is_extra} } $self->get_indicators; return wantarray ? @all : \@all; } sub experimental_indicator_names { my $self=shift; my @all=map { $_->{name} } grep { $_->{is_experimental} } $self->get_indicators; return wantarray ? @all : \@all; } q{Favourite record of the moment: Jahcoozi: Pure Breed Mongrel}; __END__ =encoding UTF-8 =head1 NAME Module::CPANTS::Kwalitee - Interface to Kwalitee generators =head1 SYNOPSIS my $mck=Module::CPANTS::Kwalitee->new; my @generators=$mck->generators; =head1 DESCRIPTION =head2 Methods =head3 new Plain old constructor. Loads all Plugins. =head3 get_indicators Get the list of all Kwalitee indicators, either as an ARRAY or ARRAYREF. =head3 get_indicators_hash Get the list of all Kwalitee indicators as an HASHREF. =head3 core_indicator_names Get a list of core indicator names (NOT the whole indicator HASHREF). =head3 optional_indicator_names Get a list of optional indicator names (NOT the whole indicator HASHREF). =head3 experimental_indicator_names Get a list of experimental indicator names (NOT the whole indicator HASHREF). =head3 all_indicator_names Get a list of all indicator names (NOT the whole indicator HASHREF). =head3 available_kwalitee Get the number of available kwalitee points =head3 total_kwalitee Get the total number of kwalitee points. This is bigger the available_kwalitee as some kwalitee metrics are marked as 'extra' (eg is_prereq). =head1 SEE ALSO L =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/AUTHORS0000444000175000017500000000160212217464565021255 0ustar salvisalvi=encoding UTF-8 =head1 NAME AUTHORS - Authors of and contributors to Module-CPANTS-Analyse =head2 Principal authors =over =item L =item L =item L =item L =item L =back =head2 Contributors =over =item L =item L =item L =item L =item L =back Many other people who provided unattributed patches, advice and bug reports are mentioned in the F file. libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/0000755000175000017500000000000012217663661020451 5ustar salvisalvilibmodule-cpants-analyse-perl-0.92+dfsg.orig/t/analyse_test_yaml_meta.t0000444000175000017500000000112012217464565025353 0ustar salvisalviuse strict; use warnings; use Test::More tests => 7; use Module::CPANTS::Analyse; use File::Spec::Functions; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/Test-YAML-Meta-0.04.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; my $d=$a->d; is($d->{files},10,'files'); is(scalar @{$d->{ignored_files_array}},27,'ignored 27 files'); is(@{$d->{modules}},2,'module'); ok($d->{file_meta_yml},'has_yaml'); ok($d->{metayml_is_parsable},'metayml_is_parsable'); ok(!$d->{metayml_parse_error},'metayml_parse_error was not set'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/moose_as_strict.t0000444000175000017500000000073212217464565024035 0ustar salvisalviuse strict; use warnings; use Test::More tests => 4; use Test::NoWarnings; use Module::CPANTS::Analyse; use File::Spec::Functions; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/modified/DBIx-SchemaChecksum-0.06.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; $a->calc_kwalitee; my $d=$a->d; is($d->{uses}{'Moose'}{in_code},1,'uses Moose'); is($d->{kwalitee}{use_strict},1,'uses strict via Moose'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/00_load.t0000444000175000017500000000017412217464565022056 0ustar salvisalviuse strict; use warnings; use Test::More tests => 2; use Test::NoWarnings; BEGIN { use_ok( 'Module::CPANTS::Analyse' ); } libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/calc_test_yaml_meta.t0000444000175000017500000000267312217464565024637 0ustar salvisalviuse strict; use warnings; use Test::More tests => 4; use Module::CPANTS::Analyse; use File::Spec::Functions; use File::Copy qw(copy); use Test::Deep; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/Test-YAML-Meta-0.04.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; my $d=$a->d; is($d->{files},10,'files'); is(@{$d->{modules}},2,'module'); $a->calc_kwalitee; my $kw=$a->d->{kwalitee}; my $expected_kwalitee = { 'has_buildtool' => 1, 'has_readme' => 1, 'manifest_matches_dist' => 1, 'metayml_is_parsable' => 1, 'proper_libs' => 1, 'has_changelog' => 1, 'use_strict' => 1, 'has_tests' => 1, 'has_manifest' => 1, 'no_symlinks' => 1, 'metayml_has_license' => 1, 'has_meta_yml' => 1, 'metayml_conforms_spec_current' => 1, 'use_warnings' => 1, 'has_tests_in_t_dir' => 1, 'metayml_conforms_to_known_spec' => 1, 'no_stdin_for_prompting' => 1, 'metayml_declares_perl_version' => 0, 'has_license_in_source_file' => 1, 'metayml_has_provides'=>1, 'has_separate_license_file', => 1, }; $expected_kwalitee->{kwalitee} = ignore; cmp_deeply($kw, superhashof($expected_kwalitee), 'metrics are as expected'); #use Data::Dumper; #diag(Dumper $kw); #diag(Dumper $a->d); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/analyse_html_tiny.t0000444000175000017500000000135012217464565024360 0ustar salvisalviuse strict; use warnings; use Test::More tests => 10; use Test::NoWarnings; use Module::CPANTS::Analyse; use File::Spec::Functions; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/HTML-Tiny-0.904.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; my $d=$a->d; is($d->{files},18,'files'); my $modcount=grep {$_->{module} eq 'HTML::Tiny'} @{$d->{modules}}; is($modcount,1,'module'); ok($d->{file_meta_yml},'has_yaml'); ok($d->{metayml_is_parsable},'metayml_is_parsable'); ok(!$d->{metayml_parse_error},'metayml_parse_error was not set'); like($d->{license},qr/defined in META\.yml/,'license'); ok(!$d->{needs_compiler}, 'does not need compiler'); ok($d->{dir_xt},'dir_xt'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/05_testdir.t0000444000175000017500000000042712217464565022623 0ustar salvisalviuse strict; use warnings; use Test::More tests => 3; use Test::NoWarnings; use Module::CPANTS::Analyse; my $a=Module::CPANTS::Analyse->new({dist => 'dummy'}); my $td=$a->testdir; ok(-e $td,"testdir $td created"); my $td2=$a->testdir; is($td,$td2,"still the same testdir"); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/11_hash_random.pl0000444000175000017500000000173712217464565023602 0ustar salvisalviuse strict; use warnings; my $td = { dist => 't/eg/PPI-HTML-1.07.tar.gz', error => { 'metayml_conforms_spec_current' => [ '1.4', sort 'Missing mandatory field, \'url\' (meta-spec -> url) [Validation: 1.4]', 'Missing mandatory field, \'version\' (meta-spec -> version) [Validation: 1.4]', 'Expected a list structure (author) [Validation: 1.4]' ], }, }; require Module::CPANTS::Analyse; my $a = Module::CPANTS::Analyse->new({ dist => $td->{dist}, _dont_cleanup => $ENV{DONT_CLEANUP}, }); my $rv = $a->unpack; $a->analyse; $a->calc_kwalitee; my $d = $a->d; my $kw = $a->d->{kwalitee}; my $left = $d->{error}->{metayml_conforms_spec_current}; my $right = $td->{error}->{metayml_conforms_spec_current}; my ($pass, $fail) = (0, 0); for my $i (0 .. $#{$left}) { if ($left->[$i] ne $right->[$i]) { $fail++; } else { $pass++; } } print "$pass,$fail\n"; libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/11_hash_random.t0000444000175000017500000000060512217464565023423 0ustar salvisalviuse strict; use warnings; use Test::More tests => 2; for my $seed (qw(0xd8792d91 0x5be01872)) { local $ENV{PERL_HASH_SEED} = $seed; my @libs; for my $inc (@INC) { push @libs, '-I' . $inc; } my $cmd = join(' ', $^X, @libs, 't/11_hash_random.pl'); my $content = qx/$cmd/; is($content, "4,0\n", "Slave forked script passed 3/3 checks with seed $seed"); } libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/plugin_manifest.t0000444000175000017500000000223312217464565024022 0ustar salvisalviuse strict; use warnings; use Test::More 'no_plan'; use Data::Dumper qw(Dumper); # for testing the Manifest plugin use Module::CPANTS::Analyse; use File::Path qw(rmtree); { my $a=Module::CPANTS::Analyse->new({ dist => 't/eg/manifest/Good-Dist-0.01.tar.gz' }); $a->unpack; $a->analyse; is($a->d->{manifest_matches_dist}, 1, 'manifest matches dist'); } { my $a=Module::CPANTS::Analyse->new({ dist => 't/eg/manifest/no-manifest-0.01.tar.gz' }); $a->unpack; $a->analyse; is( $a->d->{manifest_matches_dist}, 0, 'manifest does not match dist' ); is( $a->d->{error}{manifest_matches_dist}, 'Cannot find MANIFEST in dist.','proper error message' ) or diag Dumper $a->d->{error}; } # a third with "bad-manifest-0.01" { my $a=Module::CPANTS::Analyse->new({ dist => 't/eg/manifest/bad-manifest-0.01.tar.gz' }); $a->unpack; $a->analyse; is( $a->d->{manifest_matches_dist}, 0, 'manifest does not match dist' ); is_deeply( $a->d->{error}{manifest_matches_dist}, [ "MANIFEST (11) does not match dist (11):", "Missing in MANIFEST: TODO", "Missing in Dist: eg/demo2.pl"], 'proper error message'); } libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/02_kwalitee.t0000444000175000017500000000254112217464565022746 0ustar salvisalviuse strict; use warnings; use Test::More; use Test::Deep; use Test::NoWarnings; use Module::CPANTS::Kwalitee; my $CORE = 15; my $EXTRA = 7; #is_extra set my $EXPERIMENTAL = 2; #experimental? my $METRICS = $CORE + $EXTRA + $EXPERIMENTAL; plan tests => 8 + 2 * $METRICS; my $k=Module::CPANTS::Kwalitee->new({}); is($k->available_kwalitee, $CORE, 'available kwalitee'); is($k->total_kwalitee, $CORE + $EXTRA, 'total kwalitee'); my $ind=$k->get_indicators_hash; is(ref($ind),'HASH','indicator_hash'); is(ref($ind->{use_strict}),'HASH','hash element'); { my @all=$k->all_indicator_names; is(@all, $METRICS, 'number of all indicators'); } { my @all=$k->core_indicator_names; is(@all, $CORE, 'number of core indicators'); } { my @all=$k->optional_indicator_names; is(@all, $EXTRA,'number of optional indicators'); } foreach my $mod (@{$k->generators}) { #$mod->analyse($me); foreach my $i (@{$mod->kwalitee_indicators}) { like $i->{name}, qr/^\w{3,}$/, $i->{name}; # to check if someone has put a $var in single quotes by mistake... unlike $i->{error}, qr/\$[a-z]/, "error of $i->{name} has no \$ sign"; # next if $i->{needs_db}; # print $i->{name}."\n" if $me->opts->{verbose}; # my $rv=$i->{code}($me->d, $i); # $me->d->{kwalitee}{$i->{name}}=$rv; # $kwalitee+=$rv; } } libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/perl5i_as_warnings.t0000444000175000017500000000072412217464565024434 0ustar salvisalviuse strict; use warnings; use Test::More tests => 4; use Test::NoWarnings; use Module::CPANTS::Analyse; use File::Spec::Functions; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/App-perlhl-0.002.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; $a->calc_kwalitee; my $d=$a->d; is($d->{uses}{'perl5i::2'}{in_code},1,'uses perl5i::2'); is($d->{kwalitee}{use_strict},1,'uses strict via perl5i::2'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/05_testfile.t0000444000175000017500000000060512217464565022762 0ustar salvisalviuse strict; use warnings; use Test::More tests => 4; use Test::NoWarnings; use Module::CPANTS::Analyse; use File::Basename; my $a=Module::CPANTS::Analyse->new({ dist=>'D/DO/DOMM/Foo-Bar-1.05.tgz', }); my $td=$a->testdir; ok(-e $td,"testdir $td created"); $td=basename($td); like($a->testfile,qr/$td/,"testdir in testfile"); like($a->testfile,qr/Foo-Bar/,"filename in testfile"); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/unpack_notextractable.t0000444000175000017500000000105412217464565025216 0ustar salvisalviuse strict; use warnings; use Test::More tests => 3; use Test::Warn; use Module::CPANTS::Analyse; use File::Spec::Functions; use Cwd qw(cwd); my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/not_extractable.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $dir = cwd; my $rv; warnings_like {$rv=$a->unpack} [ qr/^No handler available for/, ] , 'unpack warns'; like($rv,qr/Can.t call method .extract./,'unpack failed'); is($a->d->{extractable},0,'extractable'); END { chdir $dir; # work around RT #67509 } libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/analyse_devel_timer.t0000444000175000017500000000166312217464565024657 0ustar salvisalviuse strict; use warnings; use Test::More tests => 13; use Module::CPANTS::Analyse; use File::Spec::Functions; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/Devel-Timer-0.02.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; my $d=$a->d; is($d->{files},12,'files'); is($d->{size_packed},10646,'size_packed'); is(ref($d->{modules}),'ARRAY','modules is ARRAY'); my $modcount=grep {$_->{module} eq 'Devel::Timer'} @{$d->{modules}}; is($modcount,1,'module'); is(ref($d->{prereq}),'ARRAY','prereq is ARRAY'); is(ref($d->{uses}),'HASH','uses is HASH'); is($d->{uses}{'Test::More'}{in_tests},3,'uses'); ok($d->{file_meta_yml},'has_yaml'); ok($d->{metayml_is_parsable},'metayml_is_parsable'); ok(!$d->{metayml_parse_error},'metayml_parse_error was not set'); ok(!$d->{license},'no license'); ok(!$d->{needs_compiler}, 'does not need compiler'); #use Data::Dumper; #diag(Dumper $d); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/10_analyse.t0000444000175000017500000002063412217464565022577 0ustar salvisalviuse strict; use warnings; use Test::More; use Test::NoWarnings; use Test::Deep; use Module::CPANTS::Analyse; #use File::Spec::Functions; use Data::Dumper qw(Dumper); $Data::Dumper::Sortkeys = 1; my @tests = ( { dist => 't/eg/Text-CSV_XS-0.40.tgz', kwalitee => { 'has_buildtool' => 1, 'has_readme' => 1, 'manifest_matches_dist' => 1, 'metayml_declares_perl_version' => 0, 'metayml_is_parsable' => 1, 'proper_libs' => 1, 'has_changelog' => 1, 'use_strict' => 1, 'kwalitee' => 40, 'no_stdin_for_prompting' => 1, 'has_tests' => 1, 'has_manifest' => 1, 'no_symlinks' => 1, 'metayml_has_license' => 1, 'has_meta_yml' => 1, 'metayml_conforms_spec_current' => 1, 'use_warnings' => 1, 'has_tests_in_t_dir' => 1, 'metayml_conforms_to_known_spec' => 1, 'has_separate_license_file' => 0, 'has_license_in_source_file' => 1, 'metayml_has_provides'=>0, }, error => {}, }, { dist => 't/eg/Pipe-0.03.tar.gz', kwalitee => { 'has_buildtool' => 1, 'has_readme' => 1, 'manifest_matches_dist' => 0, 'metayml_declares_perl_version' => 0, 'metayml_is_parsable' => 0, 'proper_libs' => 1, 'has_changelog' => 1, 'use_strict' => 1, 'kwalitee' => 29, 'no_stdin_for_prompting' => 1, 'has_tests' => 1, 'has_manifest' => 1, 'no_symlinks' => 1, 'metayml_has_license' => 0, 'has_meta_yml' => 0, 'metayml_conforms_spec_current' => 0, 'use_warnings' => 1, 'has_tests_in_t_dir' => 1, 'metayml_conforms_to_known_spec' => 0, 'has_separate_license_file' => 0, 'has_license_in_source_file' => 1, 'metayml_has_provides'=>0, }, error => { 'metayml_conforms_spec_current' => ['1.4', sort 'META.yml is missing/empty', ], 'metayml_conforms_to_known_spec' => ['known', sort 'META.yml is missing/empty', ], 'manifest_matches_dist' => [ 'MANIFEST (27) does not match dist (26):', 'Missing in MANIFEST: ', 'Missing in Dist: META.yml' ], }, }, { dist => 't/eg/PPI-HTML-1.07.tar.gz', kwalitee => { 'has_buildtool' => 1, 'has_readme' => 1, 'manifest_matches_dist' => 1, 'metayml_declares_perl_version' => 1, 'metayml_is_parsable' => 1, 'proper_libs' => 1, 'has_changelog' => 1, 'use_strict' => 1, 'kwalitee' => 37, 'no_stdin_for_prompting' => 1, 'has_tests' => 1, 'has_manifest' => 1, 'no_symlinks' => 1, 'metayml_has_license' => 1, 'has_meta_yml' => 1, 'metayml_conforms_spec_current' => 0, 'use_warnings' => 0, 'has_tests_in_t_dir' => 1, 'metayml_conforms_to_known_spec' => 1, 'has_separate_license_file' => 1, 'has_license_in_source_file' => 1, 'metayml_has_provides'=>0, }, error => { 'metayml_conforms_spec_current' => [ '1.4', sort 'Missing mandatory field, \'url\' (meta-spec -> url) [Validation: 1.4]', 'Missing mandatory field, \'version\' (meta-spec -> version) [Validation: 1.4]', 'Expected a list structure (author) [Validation: 1.4]' ], }, }, { dist => 't/eg/App-Wack-0.05.tar.gz', kwalitee => { 'has_buildtool' => 1, 'has_readme' => 1, 'manifest_matches_dist' => 1, 'metayml_declares_perl_version' => 0, 'metayml_is_parsable' => 1, 'proper_libs' => 1, 'has_changelog' => 1, 'use_strict' => 1, 'kwalitee' => 38, 'no_stdin_for_prompting' => 1, 'has_tests' => 1, 'has_manifest' => 1, 'no_symlinks' => 1, 'metayml_has_license' => 1, 'has_meta_yml' => 1, 'metayml_conforms_spec_current' => 1, 'use_warnings' => 1, 'has_tests_in_t_dir' => 1, 'metayml_conforms_to_known_spec' => 1, 'has_separate_license_file' => 0, 'has_license_in_source_file' => 1, 'metayml_has_provides'=>1, }, error => { }, }, { dist => 't/eg/Term-Title-0.03.tar.gz', kwalitee => { 'has_buildtool' => 1, 'has_separate_license_file' => 1, 'has_readme' => 1, 'manifest_matches_dist' => 1, 'metayml_declares_perl_version' => 1, 'metayml_is_parsable' => 1, 'proper_libs' => 1, 'has_changelog' => 1, 'use_strict' => 1, 'kwalitee' => 40, 'no_stdin_for_prompting' => 1, 'has_license_in_source_file' => 1, 'has_tests' => 1, 'has_manifest' => 1, 'no_symlinks' => 1, 'metayml_has_license' => 1, 'metayml_has_provides' => 1, 'has_meta_yml' => 1, 'metayml_conforms_spec_current' => 1, 'use_warnings' => 1, 'has_tests_in_t_dir' => 1, 'metayml_conforms_to_known_spec' => 1, }, error => { }, }, { dist => 't/eg/Parse-Fedora-Packages-0.02.tar.gz', kwalitee => { 'has_buildtool' => 1, 'has_separate_license_file' => 0, 'has_readme' => 1, 'manifest_matches_dist' => 1, 'metayml_declares_perl_version' => 0, 'metayml_is_parsable' => 1, 'proper_libs' => 1, 'has_changelog' => 1, 'use_strict' => 1, 'kwalitee' => 38, 'no_stdin_for_prompting' => 1, 'has_license_in_source_file' => 1, 'has_tests' => 1, 'has_manifest' => 1, 'no_symlinks' => 1, 'metayml_has_license' => 1, 'metayml_has_provides' => 1, 'has_meta_yml' => 1, 'metayml_conforms_spec_current' => 1, 'use_warnings' => 1, 'has_tests_in_t_dir' => 1, 'metayml_conforms_to_known_spec' => 1, }, error => { }, }, { dist => 't/eg/Capture-Tiny-0.05.tar.gz', kwalitee => { 'has_buildtool' => 1, 'has_separate_license_file' => 1, 'has_readme' => 1, 'manifest_matches_dist' => 1, 'metayml_declares_perl_version' => 1, 'metayml_is_parsable' => 1, 'proper_libs' => 1, 'has_changelog' => 1, 'use_strict' => 1, 'kwalitee' => 41, 'no_stdin_for_prompting' => 1, 'has_license_in_source_file' => 1, 'has_tests' => 1, 'has_manifest' => 1, 'no_symlinks' => 1, 'metayml_has_license' => 1, 'metayml_has_provides' => 1, 'has_meta_yml' => 1, 'metayml_conforms_spec_current' => 1, 'use_warnings' => 1, 'has_tests_in_t_dir' => 1, 'metayml_conforms_to_known_spec' => 1, }, error => { }, }, ); plan tests => 1 + 3 * @tests; foreach my $t (@tests) { my $a=Module::CPANTS::Analyse->new({ dist=> $t->{dist}, _dont_cleanup=>$ENV{DONT_CLEANUP}, #opts => { verbose=>1 }, # enable for debugging }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; $a->calc_kwalitee; my $d=$a->d; my $kw=$a->d->{kwalitee}; $t->{kwalitee}{kwalitee} = ignore; # another Test::Deep import cmp_deeply($kw, superhashof($t->{kwalitee}), "kwalitee of $t->{dist}") or diag(Dumper $kw); cmp_deeply($d->{error} || {}, superhashof($t->{error}), "error of $t->{dist}") or diag(Dumper $d->{error}); #diag(Dumper $d); } libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/perl5i_as_strict.t0000444000175000017500000000072612217464565024116 0ustar salvisalviuse strict; use warnings; use Test::More tests => 4; use Test::NoWarnings; use Module::CPANTS::Analyse; use File::Spec::Functions; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/App-perlhl-0.002.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; $a->calc_kwalitee; my $d = $a->d; is($d->{uses}{'perl5i::2'}{in_code},1,'uses perl5i::2'); is($d->{kwalitee}{use_strict},1,'uses strict via perl5i::2'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/analyse_eg_c.t0000444000175000017500000000136312217464565023252 0ustar salvisalviuse strict; use warnings; use Test::More tests => 11; use Module::CPANTS::Analyse; use File::Spec::Functions; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/Eg-C-0.01.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; my $d=$a->d; is($d->{files}, 8,'files'); is($d->{size_packed},2223,'size_packed'); is(ref($d->{modules}),'ARRAY','modules is ARRAY'); is($d->{modules}[0]->{module},'Eg::C','module'); is(ref($d->{uses}),'HASH','uses is HASH'); ok($d->{file_meta_yml},'has_yaml'); ok($d->{metayml_is_parsable},'metayml_is_parsable'); ok(!$d->{metayml_parse_error},'metayml_parse_error was not set'); is($d->{license}, '', 'has no license'); ok($d->{needs_compiler}, 'need compiler'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/unpack.t0000444000175000017500000000103712217464565022120 0ustar salvisalviuse strict; use warnings; use Test::More tests => 5; use Module::CPANTS::Analyse; use File::Spec::Functions; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/Acme-DonMartin-0.06.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); ok(-d catdir($a->testdir,'Acme-DonMartin-0.06'),'dist dir'); ok(-e catfile($a->testdir,'Acme-DonMartin-0.06','META.yml'),'dist meta yaml'); is($a->distdir,catdir($a->testdir,'Acme-DonMartin-0.06'),'$a->distdir'); is($a->d->{size_packed},7736,'size_packed'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/analyse_afs.t0000444000175000017500000000232012217464565023120 0ustar salvisalviuse strict; use warnings; use Test::More tests => 16; use Test::NoWarnings; use Module::CPANTS::Analyse; use File::Spec::Functions; use Data::Dumper; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/AFS-2.4.0.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; my $d=$a->d; # some operating systems (win32) only report 383 files (maybe a problem with # case-insensitive filenames) ok($d->{files} == 382 || $d->{files} == 381,'files'); is($d->{size_packed},184395,'size_packed'); is(ref($d->{modules}),'ARRAY','modules is ARRAY'); is($d->{modules}[0]->{module},'AFS','module'); is(ref($d->{uses}),'HASH','uses is HASH'); ok($d->{file_meta_yml},'has_yaml'); ok($d->{metayml_is_parsable},'metayml_is_parsable'); ok(!$d->{metayml_parse_error},'metayml_parse_error was not set'); is($d->{license},'perl defined in META.yml','has license'); ok($d->{needs_compiler}, 'needs compiler'); ok(!$d->{metayml_has_license},'metayml_has_license'); ok(!$d->{metayml_conforms_spec_1_0},'metayml_conforms_spec_1_0'); ok(!$d->{metayml_conforms_known_spec},'metayml_conforms_known_spec'); ok(!$d->{metayml_conforms_spec_current},'metayml_conforms_spec_current'); #diag(Dumper $d); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/analyse_axkit_xsp_l10n.t0000444000175000017500000000150012217464565025212 0ustar salvisalviuse strict; use warnings; use Test::More tests => 12; use Test::NoWarnings; use Module::CPANTS::Analyse; use File::Spec::Functions; my $an=Module::CPANTS::Analyse->new({ dist=>'t/eg/AxKit-XSP-L10N-0.03.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$an->unpack; is($rv,undef,'unpack ok'); $an->analyse; my $d=$an->d; is($d->{files},28,'files'); is($d->{size_packed},14486,'size_packed'); is(ref($d->{modules}),'ARRAY','modules is ARRAY'); is($d->{modules}[0]->{module},'AxKit::XSP::L10N','module'); is(ref($d->{uses}),'HASH','uses is HASH'); is($d->{uses}{'Test::More'}{in_tests},6,'uses'); ok($d->{file_meta_yml},'has_yaml'); ok($d->{metayml_is_parsable},'metayml_is_parsable'); is($d->{license},'perl defined in META.yml defined in LICENSE','LICENSE'); ok(!$d->{needs_compiler}, 'does not need compiler'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/calc.t0000444000175000017500000000443312217464565021544 0ustar salvisalviuse strict; use warnings; use Test::More tests => 16; use Module::CPANTS::Analyse; use File::Spec::Functions; use Test::Deep; my $a=Module::CPANTS::Analyse->new({ dist=>'t/eg/Acme-DonMartin-0.06.tar.gz', _dont_cleanup=>$ENV{DONT_CLEANUP}, }); my $rv=$a->unpack; is($rv,undef,'unpack ok'); $a->analyse; my $d=$a->d; is($d->{files},9,'files'); is($d->{size_packed},7736,'size_packed'); is(ref($d->{modules}),'ARRAY','modules is ARRAY'); is($d->{modules}[0]->{module},'Acme::DonMartin','module'); is(ref($d->{uses}),'HASH','uses is HASH'); is($d->{uses}{'Compress::Zlib'}{module},'Compress::Zlib','uses Compress::Zlib in module'); is($d->{uses}{'Test::More'}{in_tests},1,'uses Test::More in tests'); ok($d->{file_meta_yml},'has_yaml'); ok($d->{metayml_is_parsable},'metayml_is_parsable'); ok(!$d->{metayml_parse_error},'metayml_parse_error was not set'); ok(!$d->{license},'no license in META.yml'); $a->calc_kwalitee; my $kw=$a->d->{kwalitee}; my $expected_kwalitee = { 'has_buildtool' => 1, 'has_readme' => 1, 'manifest_matches_dist' => 1, 'metayml_is_parsable' => 1, 'proper_libs' => 1, 'has_changelog' => 1, 'use_strict' => 1, 'has_tests' => 1, 'has_manifest' => 1, 'no_symlinks' => 1, 'metayml_has_license' => 0, 'has_meta_yml' => 1, 'metayml_conforms_spec_current' => 0, 'use_warnings' => 0, 'has_tests_in_t_dir' => 1, 'metayml_conforms_to_known_spec' => 1, 'no_stdin_for_prompting' => 1, 'metayml_declares_perl_version' => 0, 'has_separate_license_file' => 0, 'has_license_in_source_file' => 0, 'metayml_has_provides'=>0, }; $expected_kwalitee->{kwalitee} = ignore; cmp_deeply($kw, superhashof($expected_kwalitee), 'metrics are as expected'); is $a->d->{size_packed}, 7736, 'size_packed'; is $a->d->{size_unpacked}, 14805, 'size_unpacked'; cmp_bag $a->d->{files_array}, [ 'MANIFEST', 'META.yml', 'DonMartin.pm', 'Changes', 'README', 'Makefile.PL', 't/01-basic.t', 'eg/freq.pl', 'eg/hello.pl' ], 'files_array'; #use Data::Dumper; #diag(Dumper $kw); #diag(Dumper $a); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/03_plugins.t0000444000175000017500000000255712217464565022632 0ustar salvisalviuse strict; use warnings; use Test::More tests => 9; use Test::Deep; use Test::NoWarnings; use Module::CPANTS::Analyse; eval { my $an=Module::CPANTS::Analyse->new(); }; like($@, qr/need a dist/, 'exception'); my $a=Module::CPANTS::Analyse->new({dist => 'dummy'}); { my @plugins=$a->plugins; is(@plugins,16,'number of plugins'); } my $plugins=$a->mck->generators; is(shift(@$plugins),'Module::CPANTS::Kwalitee::MetaYML','plugin order 1 MetaYML'); is(shift(@$plugins),'Module::CPANTS::Kwalitee::Files','plugin order 2 Files'); is(shift(@$plugins),'Module::CPANTS::Kwalitee::Distname','plugin order 3 Distname'); is(shift(@$plugins),'Module::CPANTS::Kwalitee::FindModules','plugin order 4 FindModules'); is(pop(@$plugins),'Module::CPANTS::Kwalitee::CpantsErrors','plugin order last CpantsErrors'); cmp_deeply($plugins,bag( qw( Module::CPANTS::Kwalitee::Pod Module::CPANTS::Kwalitee::Prereq Module::CPANTS::Kwalitee::Uses Module::CPANTS::Kwalitee::BrokenInstaller Module::CPANTS::Kwalitee::Manifest Module::CPANTS::Kwalitee::License Module::CPANTS::Kwalitee::NeedsCompiler Module::CPANTS::Kwalitee::Repackageable Module::CPANTS::Kwalitee::Version Module::CPANTS::Kwalitee::Distros Module::CPANTS::Kwalitee::Signature )),'plugin the rest'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/t/older_test_kwalitee.t0000444000175000017500000000132412217464565024667 0ustar salvisalviuse strict; use warnings; use Test::More; use Module::CPANTS::Kwalitee; local $INC{"Test/Kwalitee.pm"} = 1; local $Test::Kwalitee::VERSION = 1.01; my @hardcoded_metrics = qw/ extractable has_readme has_manifest has_meta_yml has_buildtool has_changelog no_symlinks has_tests proper_libs no_pod_errors use_strict has_test_pod has_test_pod_coverage /; plan tests => scalar @hardcoded_metrics; my %seen; my $kwalitee = Module::CPANTS::Kwalitee->new; for my $generator (@{ $kwalitee->generators }) { for (@{ $generator->kwalitee_indicators }) { $seen{$_->{name}}++ if ref $_->{code} eq ref sub {}; } } for (@hardcoded_metrics) { is $seen{$_} => 1, "$_ is available for Test::Kwalitee"; } libmodule-cpants-analyse-perl-0.92+dfsg.orig/Makefile.PL0000444000175000017500000000247112217464565022164 0ustar salvisalvi# Note: this file was auto-generated by Module::Build::Compat version 0.4007 require 5.006; use ExtUtils::MakeMaker; WriteMakefile ( 'NAME' => 'Module::CPANTS::Analyse', 'VERSION_FROM' => 'lib/Module/CPANTS/Analyse.pm', 'PREREQ_PM' => { 'Archive::Any::Lite' => '0.06', 'Archive::Tar' => '1.48', 'Array::Diff' => '0.04', 'CPAN::DistnameInfo' => '0.06', 'CPAN::Meta::Validator' => '2.131490', 'CPAN::Meta::YAML' => '0.008', 'Class::Accessor' => '0.19', 'Cwd' => 0, 'File::Find::Rule::VCS' => '0', 'IO::Capture' => '0.05', 'Module::ExtractUse' => '0.30', 'Module::Pluggable' => '2.96', 'Set::Scalar' => 0, 'Software::License' => '0.003', 'Test::Deep' => 0, 'Test::More' => 0, 'Test::NoWarnings' => 0, 'Test::Warn' => '0.11', 'Text::Balanced' => 0, 'YAML::Any' => 0, 'version' => '0.73' }, 'INSTALLDIRS' => 'site', 'EXE_FILES' => [ 'bin/cpants_lint.pl' ], 'PL_FILES' => {} ) ; libmodule-cpants-analyse-perl-0.92+dfsg.orig/META.json0000444000175000017500000001074512217464565021636 0ustar salvisalvi{ "abstract" : "Generate Kwalitee ratings for a distribution", "author" : [ "Lars Dɪᴇᴄᴋᴏᴡ " ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.4007, CPAN::Meta::Converter version 2.132620", "keywords" : [ "CPANTS", "kwalitee" ], "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Module-CPANTS-Analyse", "prereqs" : { "build" : { "requires" : { "Cwd" : "0", "Test::Deep" : "0", "Test::More" : "0", "Test::NoWarnings" : "0", "Test::Warn" : "0.11" } }, "configure" : { "requires" : { "Module::Build" : "0.4" } }, "runtime" : { "requires" : { "Archive::Any::Lite" : "0.06", "Archive::Tar" : "1.48", "Array::Diff" : "0.04", "CPAN::DistnameInfo" : "0.06", "CPAN::Meta::Validator" : "2.131490", "CPAN::Meta::YAML" : "0.008", "Class::Accessor" : "0.19", "File::Find::Rule::VCS" : "0", "IO::Capture" : "0.05", "Module::ExtractUse" : "0.30", "Module::Pluggable" : "2.96", "Set::Scalar" : "0", "Software::License" : "0.003", "Text::Balanced" : "0", "YAML::Any" : "0", "perl" : "5.006", "version" : "0.73" } } }, "provides" : { "Module::CPANTS::Analyse" : { "file" : "lib/Module/CPANTS/Analyse.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee" : { "file" : "lib/Module/CPANTS/Kwalitee.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::BrokenInstaller" : { "file" : "lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::CpantsErrors" : { "file" : "lib/Module/CPANTS/Kwalitee/CpantsErrors.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Distname" : { "file" : "lib/Module/CPANTS/Kwalitee/Distname.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Distros" : { "file" : "lib/Module/CPANTS/Kwalitee/Distros.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Files" : { "file" : "lib/Module/CPANTS/Kwalitee/Files.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::FindModules" : { "file" : "lib/Module/CPANTS/Kwalitee/FindModules.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::License" : { "file" : "lib/Module/CPANTS/Kwalitee/License.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Manifest" : { "file" : "lib/Module/CPANTS/Kwalitee/Manifest.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::MetaYML" : { "file" : "lib/Module/CPANTS/Kwalitee/MetaYML.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::NeedsCompiler" : { "file" : "lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Pod" : { "file" : "lib/Module/CPANTS/Kwalitee/Pod.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Prereq" : { "file" : "lib/Module/CPANTS/Kwalitee/Prereq.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Repackageable" : { "file" : "lib/Module/CPANTS/Kwalitee/Repackageable.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Signature" : { "file" : "lib/Module/CPANTS/Kwalitee/Signature.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Uses" : { "file" : "lib/Module/CPANTS/Kwalitee/Uses.pm", "version" : "0.92" }, "Module::CPANTS::Kwalitee::Version" : { "file" : "lib/Module/CPANTS/Kwalitee/Version.pm", "version" : "0.92" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Module-CPANTS-Analyse" }, "homepage" : "http://cpants.cpanauthors.org", "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "url" : "https://github.com/cpants/Module-CPANTS-Analyse" } }, "version" : "0.92" } libmodule-cpants-analyse-perl-0.92+dfsg.orig/bin/0000755000175000017500000000000012217464565020760 5ustar salvisalvilibmodule-cpants-analyse-perl-0.92+dfsg.orig/bin/cpants_lint.pl0000444000175000017500000001405012217464565023631 0ustar salvisalvi#!/usr/bin/perl -w use strict; use Module::CPANTS::Analyse; use Getopt::Long; use IO::Capture::Stdout; use Data::Dumper; use YAML::Any; use File::Spec::Functions; use Cwd; use Pod::Usage; my %opts; GetOptions(\%opts,qw(help|? man dump no_capture! verbose! yaml to_file dir=s experimental!)); pod2usage(1) if $opts{help}; pod2usage(-exitstatus => 0, -verbose => 2) if $opts{man}; my $cwd=getcwd(); my $dist=shift(@ARGV); pod2usage(-exitstatus => 0, -verbose => 0) unless $dist; die "Cannot find $dist\n" unless -e $dist; $ENV{CPANTS_LINT} = 1; my $mca=Module::CPANTS::Analyse->new({ dist=>$dist, opts=>\%opts, }); my $output; my $cannot_unpack=$mca->unpack; if ($cannot_unpack) { if ($opts{dump}) { $output=Dumper($mca->d); } elsif ($opts{yaml}) { $output=Dump($mca->d); } else { $output="Cannot unpack \t\t".$mca->tarball."\n"; } } else { $mca->analyse; $mca->calc_kwalitee; if ($opts{dump}) { $Data::Dumper::Sortkeys=1; $output=Dumper($mca->d); } elsif ($opts{yaml}) { $output=Dump($mca->d); } else { # build up lists of failed metrics my (@core_failure,@opt_failure,@exp_failure); my ($core_kw,$opt_kw)=(0,0); my $kwl=$mca->d->{kwalitee}; my @need_db; foreach my $ind (@{$mca->mck->get_indicators}) { if ($ind->{needs_db}) { push(@need_db,$ind); next; } if ($ind->{is_extra}) { next if $ind->{name} eq 'is_prereq'; if ($kwl->{$ind->{name}}) { $opt_kw++; } else { push(@opt_failure,"* ".$ind->{name}."\n".$ind->{remedy}); } } elsif ($ind->{is_experimental}) { next unless $opts{experimental}; if (!$kwl->{$ind->{name}}) { push(@exp_failure,"* ".$ind->{name}."\n".$ind->{remedy}); } } else { if ($kwl->{$ind->{name}}) { $core_kw++; } else { push(@core_failure,"* ".$ind->{name}."\n".$ind->{remedy}); } } } # output results $output.="Checked dist \t\t".$mca->tarball."\n"; my $max_core_kw=$mca->mck->available_kwalitee; my $max_kw=$mca->mck->total_kwalitee; my $total_kw=$core_kw+$opt_kw; $output.="Kwalitee rating\t\t".sprintf("%.2f",100*$total_kw/$max_core_kw)."% ($total_kw/$max_core_kw)\n"; if (@need_db) { $output.="Ignoring metrics\t".join(', ',map {$_->{name} } @need_db); } if ($total_kw == $max_kw - @need_db) { $output.="\nCongratulations for building a 'perfect' distribution!\n"; } else { if (@core_failure) { $output.="\nHere is a list of failed Kwalitee tests and\nwhat you can do to solve them:\n\n"; $output.=join ("\n\n",@core_failure,''); } if (@opt_failure) { $output.="\nFailed optional Kwalitee tests and\nwhat you can do to solve them:\n\n"; $output.=join ("\n\n",@opt_failure,''); } if (@exp_failure) { $output.="\nFailed experimental Kwalitee tests and\nwhat you can do to solve them:\n\n"; $output.=join ("\n\n",@exp_failure,''); } } } } if ($opts{to_file}) { my $dir=$opts{dir} || $cwd ; my $extension='.txt'; $extension='.dmp' if $opts{dump}; $extension='.yml' if $opts{yaml}; my $outfile=catfile($dir,$mca->d->{vname}.$extension); open (my $fh,'>',$outfile) || die "Cannot write to $outfile: $!"; print $fh $output; close $fh; } else { print $output; } __END__ =encoding UTF-8 =head1 NAME cpants_lint.pl - commandline frontend to Module::CPANTS::Analyse =head1 SYNOPSIS cpants_lint.pl path/to/Foo-Dist-1.42.tgz Options: --help brief help message --man full documentation --verbose print more info during run --no_capture don't turn on capturing of STDERR and STDOUT --dump dump result using Data::Dumper --yaml dump result as YAML --to_file dump result to a file --dir directory to dump files to =head1 DESCRIPTION C checks the B of CPAN distributions. More exact, it checks how a given tarball will be rated on C, without needing to upload it first. C is also used by C itself to check all dists on CPAN. For more information on Kwalitee, and the whole of CPANTS, see C and / or C. =head1 OPTIONS If neither C<--dump> nor C<--yaml> are used, a short text describing the Kwalitee of the distribution and hints on how to raise Kwalitee will be displayed. The format of this text can change anytime, so don't use it for any automated processing! =head3 --help Print a brief help message. =head3 --man Print manpage. =head3 --verbose Print some informative messages during testing of dists. =head3 --no_capture Turn off capturing of STDOUT and STDERR. Mostly useful during debugging / development of new features. If C<--no_capture> is used, the value of C might be wrong. =head3 --dump Dump the result using Data::Dumper =head3 --yaml Dump the result as YAML. =head3 --to_file Output the result into a file instead of STDOUT. The name of the file will be F (well, the extension depends on the dump format and can be C<.yaml>, C<.dump> or C<.txt>) =head3 --dir Directory to dump files to. Defaults to the current working directory. =head1 AUTHOR L =head1 COPYRIGHT AND LICENSE Copyright © 2003–2006, 2009 L You may use and distribute this module according to the same terms that Perl is distributed under. libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/0000755000175000017500000000000012217464565020643 5ustar salvisalvilibmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/99_pod_coverage.t0000444000175000017500000000030312217464565024000 0ustar salvisalvi#!perl use strict; use warnings; use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; all_pod_coverage_ok(); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/99_pod.t0000444000175000017500000000024612217464565022133 0ustar salvisalvi#!perl -T use strict; use warnings; use Test::More; eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok(); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee.t0000444000175000017500000000101612217464565022631 0ustar salvisalviuse strict; use warnings; use FindBin; use Test::More tests => 1; use Module::CPANTS::Kwalitee; my %names = map {$_ => 1} Module::CPANTS::Kwalitee->new->all_indicator_names; my %files = map {$_ => 1} glob "$FindBin::Bin/kwalitee/*.t"; my @errors; for (keys %names) { my $file = "$FindBin::Bin/kwalitee/$_.t"; if (exists $files{$file}) { delete $files{$file}; } else { push @errors, "$file is missing"; } } push @errors, "$_ is obsolete" for keys %files; ok !@errors, "no errors" or diag join "\n", @errors; libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/strict_warnings_equiv.t0000444000175000017500000000532312217464565025462 0ustar salvisalviuse strict; use warnings; use FindBin; use File::Path; use Test::More; BEGIN { plan skip_all => "This is an author test" unless $ENV{AUTHOR_TESTING}; plan skip_all => "requires WorePAN" unless eval { require WorePAN; WorePAN->VERSION(0.04) }; plan skip_all => "This doesn't run well under Windows" if $^O eq 'MSWin32'; } use Module::CPANTS::Kwalitee::Uses; my $pid = $$; my $tempdir = "$FindBin::Bin/tmplib/"; mkpath $tempdir unless -d $tempdir; END { rmtree $tempdir if $pid eq $$ && -d $tempdir }; my %map = ( 'Catmandu::Sane' => 'Catmandu', 'Mojo::Base' => 'Mojolicious', 'perl5i::1' => 'perl5i', 'perl5i::2' => 'perl5i', 'perl5i::latest' => 'perl5i', ); my %flag_to_enable = ( 'Mojo::Base' => '-base', 'Spiffy' => '-Base', ); for my $module (@Module::CPANTS::Kwalitee::Uses::STRICT_EQUIV) { my $res = test($module); unless ($res) { note "SKIP $module"; next; } ok $res->{strict}, "$module enforces strict"; ok !$res->{warnings}, "$module does not enforce warnings"; note; } for my $module (@Module::CPANTS::Kwalitee::Uses::WARNINGS_EQUIV) { my $res = test($module); unless ($res) { note "SKIP $module"; next; } ok !$res->{strict}, "$module does not enforce strict"; ok $res->{warnings}, "$module enforces warnings"; note; } for my $module (@Module::CPANTS::Kwalitee::Uses::STRICT_WARNINGS_EQUIV) { my $res = test($module); unless ($res) { note "SKIP $module"; next; } ok $res->{strict}, "$module enforces strict"; ok $res->{warnings}, "$module enforce warnings"; note; } sub test { my $module = shift; my $dist = $map{$module} || $module; $dist =~ s|::|-|g; local $Parse::PMFile::ALLOW_DEV_VERSION = 1; my $worepan = WorePAN->new( root => "$FindBin::Bin/tmp/", dists => {$dist => 0}, use_backpan => 0, no_network => 0, verbose => 0, cleanup => 1, ); my ($version, $file) = $worepan->look_for($module); $file ||= $module; system("cpanm -nq -l $tempdir $file"); my $res = {}; { open my $fh, '>', 'strict_test.pl' or die $!; my $flag = $flag_to_enable{$module} || ''; print $fh <<"TEST_END"; package # Test::CPANTS::StrictWarningsEquiv; no warnings; my \$default_warning_bits; BEGIN { \$default_warning_bits = \${^WARNING_BITS}; } use local::lib "$tempdir"; use $module $flag; BEGIN { print "module: $module\n"; print "strict: ", (\$^H & (0x00000002|0x00000200|0x00000400)) ? 1 : 0, "\n"; print "warnings: ", (\${^WARNING_BITS} ne \$default_warning_bits ? 1 : 0), "\n"; } TEST_END close $fh; my $output = `$^X strict_test.pl`; return if $output =~ /Can't locate/; ($res->{strict}) = $output =~ /strict: ([01])/; ($res->{warnings}) = $output =~ /warnings: ([01])/; } $res; } done_testing; libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/99_critic.t0000444000175000017500000000051412217464565022624 0ustar salvisalviuse strict; use warnings; use Test::More; eval { require Test::Perl::Critic; import Test::Perl::Critic; }; plan skip_all => 'Test::Perl::Critic only run for author tests' unless $ENV{AUTHOR_TEST}; plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; all_critic_ok('blib'); #all_critic_ok('blib', 't'); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/0000755000175000017500000000000012217464565022450 5ustar salvisalvilibmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_changelog.t0000444000175000017500000000127112217464565025416 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['U/UN/UNBIT/Net-uwsgi-1.1.tar.gz', 0], # 2409 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['B/BE/BENNING/Math-BaseMulti-1.00.tar.gz', 0], # 2942 ['H/HE/HEYTRAV/Mojolicious-Plugin-Libravatar-1.08.tar.gz', 0], # 3415 ['T/TX/TXH/Template-Plugin-Filter-MinifyHTML-0.02.tar.gz', 0], # 3484 ['M/MA/MANIGREW/SEG7-1.0.1.tar.gz', 0], # 3847 ['M/MU/MUIR/modules/rinetd.pl-1.2.tar.gz', 0], # 4319 ['G/GS/GSB/WWW-Crab-Client-0.03.tar.gz', 0], # 4352 ['R/RS/RSHADOW/libmojolicious-plugin-human-perl_0.6.orig.tar.gz', 0], # 4504 ['S/SR/SRPATT/Finance-Bank-CooperativeUKPersonal-0.02.tar.gz', 0], # 4991 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_tests_in_t_dir.t0000444000175000017500000000121012217464565026471 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['S/SE/SEVEAS/Term-Multiplexed-0.1.0.tar.gz', 0], # 1701 ['U/UN/UNBIT/Net-uwsgi-1.1.tar.gz', 0], # 2409 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['M/MU/MUIR/modules/rinetd.pl-1.2.tar.gz', 0], # 4319 ['S/SR/SRPATT/Finance-Bank-CooperativeUKPersonal-0.02.tar.gz', 0], # 4991 ['I/IA/IAMCAL/Flickr-API-1.06.tar.gz', 0], # 5172 ['P/PJ/PJB/Speech-Speakup-1.04.tar.gz', 0], # 7410 ['F/FI/FIBO/Task-Viral-20130508.tar.gz', 0], # 8128 ['A/AD/ADAMBA/Algorithm-MOS-0.001.tar.gz', 0], # 8570 ['F/FI/FIBO/Task-BeLike-FIBO-20130508.tar.gz', 0], # 8922 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/no_broken_module_install.t0000444000175000017500000000144512217464565027706 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['G/GU/GUGOD/Kwiki-Session-0.01.tar.gz', 0], # 7880 ['G/GU/GUGOD/Kwiki-Widgets-Links-0.01.tar.gz', 0], # 8214 ['C/CL/CLSUNG/Lingua-ZH-Segment-0.02.tar.gz', 0], # 8236 ['R/RH/RHUNDT/Catalyst-Model-Oryx-0.01.tar.gz', 0], # 8255 ['X/XE/XERN/Template-Plugin-IO-All-0.01.tar.gz', 0], # 8462 ['I/IJ/IJLIAO/WWW-Scraper-ISBN-TWSrbook_Driver-0.01.tar.gz', 0], # 9139 ['I/IJ/IJLIAO/WWW-Scraper-ISBN-TWYlib_Driver-0.01.tar.gz', 0], # 9199 ['I/IJ/IJLIAO/WWW-Scraper-ISBN-TWTenlong_Driver-0.01.tar.gz', 0], # 9210 ['I/IJ/IJLIAO/WWW-Scraper-ISBN-TWPchome_Driver-0.01.tar.gz', 0], # 9308 ['I/IJ/IJLIAO/WWW-Scraper-ISBN-TWSoidea_Driver-0.01.tar.gz', 0], # 9348 # M::I 1.04 ['K/KA/KARMAN/Dezi-UI-0.001000.tar.gz', 0], ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/no_stdin_for_prompting.t0000444000175000017500000000121712217464565027416 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['G/GM/GMCCAR/Jabber-SimpleSend-0.03.tar.gz', 0], # 3455 ['S/SP/SPEEVES/Apache-AuthenNIS-0.13.tar.gz', 0], # 4517 ['S/SP/SPEEVES/Apache2-AuthenSmb-0.01.tar.gz', 0], # 5219 ['K/KR/KROW/DBIx-Password-1.9.tar.gz', 0], # 5478 ['G/GE/GEOTIGER/Data-Fax-0.02.tar.gz', 0], # 5944 ['G/GE/GEOTIGER/CGI-Getopt-0.13.tar.gz', 0], # 6014 ['S/SP/SPEEVES/Apache2-AuthNetLDAP-0.01.tar.gz', 0], # 6855 ['S/SP/SPEEVES/Apache-AuthNetLDAP-0.29.tar.gz', 0], # 6952 ['A/AM/AMALTSEV/XAO-MySQL-1.02.tar.gz', 0], # 7242 ['B/BH/BHODGES/Mail-IMAPFolderSearch-0.03.tar.gz', 0], # 7326 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/no_symlinks.t0000444000175000017500000000137012217464565025201 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; Test::More::plan skip_all => "This test doesn't work well under Windows" if $^O eq 'MSWin32'; xt::kwalitee::Test::run( ['C/CM/CMORRIS/Parse-Extract-Net-MAC48-0.01.tar.gz', 0], # 3094 ['B/BR/BRUMLEVE/autobless-1.0.1.tar.gz', 0], # 3318 ['B/BR/BRUMLEVE/wildproto-1.0.1.tar.gz', 0], # 3617 ['B/BR/BRUMLEVE/vm-1.0.1.tar.gz', 0], # 4236 ['C/CR/CRUSOE/Template-Plugin-Filter-ANSIColor-0.0.3.tar.gz', 0], # 4963 ['G/GS/GSLONDON/Devel-AutoProfiler-1.200.tar.gz', 0], # 6139 ['P/PH/PHAM/Business-Stripe-0.04.tar.gz', 0], # 6412 ['G/GA/GAVINC/Config-Directory-0.05.tar.gz', 0], # 8774 ['N/NE/NETVARUN/Net-Semantics3-0.10.tar.gz', 0], # 8930 ['G/GA/GAVINC/File-DirCompare-0.7.tar.gz', 0], # 9018 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_readme.t0000444000175000017500000000126712217464565024731 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['S/SE/SEVEAS/Term-Multiplexed-0.1.0.tar.gz', 0], # 1701 ['S/SR/SROMANOV/App-Nopaste-Service-Dpaste-0.01.tar.gz', 0], # 2448 ['S/SR/SROMANOV/Games-Chess-Position-Unicode-0.01.tar.gz', 0], # 2629 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['B/BO/BOOK/Bundle-MetaSyntactic-1.026.tar.gz', 0], # 3178 ['B/BE/BENMEYER/Finance-btce-0.02.tar.gz', 0], # 3575 ['S/SY/SYSADM/Mojolicious-Plugin-DeCSRF-0.94.tar.gz', 0], # 3654 ['B/BK/BKB/Lingua-EN-PluralToSingular-0.06.tar.gz', 0], # 3747 ['M/MA/MANIGREW/SEG7-1.0.1.tar.gz', 0], # 3847 ['B/BK/BKB/Lingua-JA-Gairaigo-Fuzzy-0.02.tar.gz', 0], # 4159 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_meta_yml.t0000444000175000017500000000115712217464565025301 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['U/UN/UNBIT/Net-uwsgi-1.1.tar.gz', 0], # 2409 ['A/AN/ANANSI/Anansi-Singleton-0.02.tar.gz', 0], # 2664 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['D/DA/DAVIEIRA/Data_Translate-0.3.tar.gz', 0], # 2970 ['A/AN/ANANSI/Anansi-Class-0.03.tar.gz', 0], # 3028 ['A/AN/ANANSI/Anansi-Actor-0.04.tar.gz', 0], # 3157 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['M/MA/MANIGREW/SEG7-1.0.1.tar.gz', 0], # 3847 ['H/HI/HITHIM/Socket-Mmsg-0.02.tar.gz', 0], # 3946 ['S/ST/STEFANOS/Net-SMTP_auth-SSL-0.2.tar.gz', 0], # 4058 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_manifest.t0000444000175000017500000000117612217464565025301 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['L/LA/LAWSONK/Gtk2-Ex-MPlayerEmbed-0.03.tar.gz', 0], # 465 ['W/WE/WEBY/Mojolicious-Plugin-Mobi-0.02.tar.gz', 0], # 474 ['W/WO/WOLDRICH/Bundle-Woldrich-Term-0.02.tar.gz', 0], # 530 ['W/WO/WOLDRICH/App-epic-0.014.tar.gz', 0], # 812 ['T/TA/TAG/AnyEvent-Peer39-0.32.tar.gz', 0], # 824 ['A/AB/ABCABC/CFTP_01.tar.gz', 0], # 897 ['S/SA/SAULIUS/Date-Holidays-LT-0.01.tar.gz', 0], # 1532 ['R/RU/RUFF/DJabberd-Authen-Dovecot-0.1.tar.gz', 0], # 2105 ['U/UN/UNBIT/Net-uwsgi-1.1.tar.gz', 0], # 2409 ['G/GV/GVENKAT/JSON-HPack-0.0.3.tar.gz', 0], # 2475 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/metayml_has_license.t0000444000175000017500000000126312217464565026642 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['C/CH/CHENGANG/Log-Lite-0.05.tar.gz', 0], # 2739 ['S/SC/SCILLEY/POE/Component/IRC/Plugin/IRCDHelp-0.02.tar.gz', 0], # 3243 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['H/HI/HITHIM/Socket-Mmsg-0.02.tar.gz', 0], # 3946 ['F/FA/FAYLAND/Acme-CPANAuthors-Chinese-0.26.tar.gz', 0], # 4474 ['B/BE/BENNIE/ACME-KeyboardMarathon-1.15.tar.gz', 0], # 4479 ['A/AL/ALEXP/Catalyst-Model-DBI-0.32.tar.gz', 0], # 4686 ['Y/YT/YTURTLE/Nephia-Plugin-Response-YAML-0.01.tar.gz', 0], # 4948 ['C/CH/CHENRYN/Nagios-Plugin-ByGmond-0.01.tar.gz', 0], # 5159 ['I/IA/IAMCAL/Flickr-API-1.06.tar.gz', 0], # 5172 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/use_warnings.t0000444000175000017500000000122512217464565025337 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['T/TO/TOBYINK/Platform-Windows-0.002.tar.gz', 0], # 2206 ['T/TO/TOBYINK/Platform-Unix-0.002.tar.gz', 0], # 2264 ['B/BO/BOOK/Acme-MetaSyntactic-errno-1.003.tar.gz', 0], # 2889 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['T/TX/TXH/Template-Plugin-Filter-MinifyHTML-0.02.tar.gz', 0], # 3484 ['L/LT/LTP/Game-Life-0.05.tar.gz', 0], # 6535 ['P/PJ/PJB/Speech-Speakup-1.04.tar.gz', 0], # 7410 ['J/JB/JBAZIK/Archive-Ar-1.15.tar.gz', 0], # 7983 ['S/SU/SULLR/Net-SSLGlue-1.03.tar.gz', 0], # 8720 ['S/SH/SHARYANTO/Term-ProgressBar-Color-0.00.tar.gz', 0], # 9746 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/metayml_has_provides.t0000444000175000017500000000124012217464565027046 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['T/TO/TOBYINK/Platform-Windows-0.002.tar.gz', 0], # 2206 ['T/TO/TOBYINK/Platform-Unix-0.002.tar.gz', 0], # 2264 ['C/CO/COOLMEN/Test-More-Color-0.04.tar.gz', 0], # 2963 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['H/HI/HITHIM/Socket-Mmsg-0.02.tar.gz', 0], # 3946 ['C/CO/COOLMEN/Test-Mojo-More-0.04.tar.gz', 0], # 4301 ['S/SM/SMUELLER/Math-SymbolicX-Complex-1.01.tar.gz', 0], # 4719 ['C/CH/CHENRYN/Nagios-Plugin-ByGmond-0.01.tar.gz', 0], # 5159 ['S/SM/SMUELLER/Math-Symbolic-Custom-CCompiler-1.03.tar.gz', 0], # 5244 ['L/LT/LTP/Game-Life-0.05.tar.gz', 0], # 6535 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_tests.t0000444000175000017500000000127112217464565024631 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['M/MS/MSTROUT/pumpkin-pragma-placeholder-0.001.tar.gz', 0], # 961 ['S/SE/SEVEAS/Term-Multiplexed-0.1.0.tar.gz', 0], # 1701 ['P/PB/PBLAIR/Copy-From-Git-0.000302.tar.gz', 0], # 2235 ['U/UN/UNBIT/Net-uwsgi-1.1.tar.gz', 0], # 2409 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['N/NK/NKH/Devel-Depend-Cl-0.06.tar.gz', 0], # 3540 ['S/SE/SEMUELF/WWW-Github-Files-0.02.tar.gz', 0], # 3634 ['M/MU/MUIR/modules/rinetd.pl-1.2.tar.gz', 0], # 4319 ['S/SR/SRPATT/Finance-Bank-CooperativeUKPersonal-0.02.tar.gz', 0], # 4991 ['N/NA/NANARDON/RT-Interface-Email-Filter-CheckMessageId-0.1.tar.gz', 0], # 5398 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/Test.pm0000444000175000017500000000164012217464565023724 0ustar salvisalvipackage # xt::kwalitee::Test; use strict; use warnings; use FindBin; use Test::More; BEGIN { eval { require WorePAN }; plan skip_all => "requires WorePAN" if $@ or $WorePAN::VERSION < 0.04; } use Module::CPANTS::Analyse; sub run { my (@tests) = @_; my ($caller, $file) = caller; my ($name) = $file =~ /(\w+)\.t$/; plan tests => scalar @tests; for my $test (@tests) { my $worepan = WorePAN->new( root => "$FindBin::Bin/tmp", files => [$test->[0]], no_indices => 1, use_backpan => 1, no_network => 0, cleanup => 1, ); my $tarball = $worepan->file($test->[0]); my $analyzer = Module::CPANTS::Analyse->new({dist => $tarball}); $analyzer->unpack; $analyzer->analyse; my $metric = $analyzer->mck->get_indicators_hash->{$name}; my $result = $metric->{code}->($analyzer->d); is $result => $test->[1], "$test->[0] $name: $result"; } } 1; libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_separate_license_file.t0000444000175000017500000000124212217464565027772 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['T/TO/TOBYINK/Platform-Windows-0.002.tar.gz', 0], # 2206 ['T/TO/TOBYINK/Platform-Unix-0.002.tar.gz', 0], # 2264 ['B/BO/BOOK/Acme-MetaSyntactic-errno-1.003.tar.gz', 0], # 2889 ['C/CO/COOLMEN/Test-More-Color-0.04.tar.gz', 0], # 2963 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['H/HI/HITHIM/Socket-Mmsg-0.02.tar.gz', 0], # 3946 ['C/CO/COOLMEN/Test-Mojo-More-0.04.tar.gz', 0], # 4301 ['M/MU/MUGENKEN/Bundle-Unicheck-0.02.tar.gz', 0], # 4596 ['S/SM/SMUELLER/Math-SymbolicX-Complex-1.01.tar.gz', 0], # 4719 ['C/CH/CHENRYN/Nagios-Plugin-ByGmond-0.01.tar.gz', 0], # 5159 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/manifest_matches_dist.t0000444000175000017500000000126712217464565027176 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['U/UN/UNBIT/Net-uwsgi-1.1.tar.gz', 0], # 2409 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['C/CO/COOLMEN/Test-More-Color-0.04.tar.gz', 0], # 2963 ['A/AP/APIOLI/YAMC-0.2.tar.gz', 0], # 3245 ['B/BE/BENMEYER/Finance-btce-0.02.tar.gz', 0], # 3575 ['S/SJ/SJQUINNEY/MooseX-Types-EmailAddress-1.1.2.tar.gz', 0], # 4257 ['R/RS/RSHADOW/libmojolicious-plugin-human-perl_0.6.orig.tar.gz', 0], # 4504 ['L/LE/LEPREVOST/Math-SparseMatrix-Operations-0.06.tar.gz', 0], # 4593 ['S/SR/SRPATT/Finance-Bank-CooperativeUKPersonal-0.02.tar.gz', 0], # 4991 ['S/SU/SULLR/Net-PcapWriter-0.71.tar.gz', 0], # 5337 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_license_in_source_file.t0000444000175000017500000000122512217464565030155 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['J/JJ/JJUDD/DBIx-Class-TimeStamp-HiRes-v1.0.0.tar.gz', 0], # 2596 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['Y/YV/YVES/Sereal-0.360.tar.gz', 0], # 3537 ['S/SM/SMUELLER/Math-SymbolicX-Complex-1.01.tar.gz', 0], # 4719 ['I/IA/IAMCAL/Flickr-API-1.06.tar.gz', 0], # 5172 # =head1 AUTHOR / COPYRIGHT / LICENSE ['B/BJ/BJOERN/AI-CRM114-0.01.tar.gz', 1], # has =head1 COPYRIGHT AND LICENSE without closing =cut ['D/DA/DAMI/DBIx-DataModel-2.39.tar.gz', 1], # has =head1 LICENSE followed by =head1 COPYRIGHT ['Y/YS/YSASAKI/App-pfswatch-0.08.tar.gz', 1], ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/proper_libs.t0000444000175000017500000000144612217464565025160 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( # pm files not in the lib/base dir ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 (Google/TTS.pm) # didn't extract nicely (dot underscore files) ['A/AQ/AQUILINA/WWW-LaQuinta-Returns-0.02.tar.gz', 0], # 4055 # multiple pm files in the basedir ['D/DG/DGRAHAM/simpleXMLParse/simplexmlparse_v1.4.tar.gz', 0], # 4336 # no modules ['L/LA/LAWSONK/Gtk2-Ex-MPlayerEmbed-0.03.tar.gz', 1], # 465 ['W/WO/WOLDRICH/App-epic-0.014.tar.gz', 1], # 812 ['T/TA/TAG/AnyEvent-Peer39-0.32.tar.gz', 1], # 824 ['C/CA/CASIANO/Git-Export-0.04.tar.gz', 1], # 2593 ['M/MI/MILOVIDOV/APP-Yatranslate-0.02.tar.gz', 1], # 3773 ['D/DB/DBR/pdoc-0.900.tar.gz', 1], # 3876 ['M/MU/MUIR/modules/rinetd.pl-1.2.tar.gz', 1], # 4319 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/metayml_declares_perl_version.t0000444000175000017500000000124212217464565030733 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['T/TO/TOBYINK/Platform-Windows-0.002.tar.gz', 0], # 2206 ['T/TO/TOBYINK/Platform-Unix-0.002.tar.gz', 0], # 2264 ['C/CO/COOLMEN/Test-More-Color-0.04.tar.gz', 0], # 2963 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['T/TX/TXH/Template-Plugin-Filter-MinifyHTML-0.02.tar.gz', 0], # 3484 ['H/HI/HITHIM/Socket-Mmsg-0.02.tar.gz', 0], # 3946 ['S/SM/SMUELLER/Math-SymbolicX-Complex-1.01.tar.gz', 0], # 4719 ['S/SM/SMUELLER/Math-Symbolic-Custom-CCompiler-1.03.tar.gz', 0], # 5244 ['L/LT/LTP/Game-Life-0.05.tar.gz', 0], # 6535 ['K/KP/KPEE/Carp-Growl-0.0.3.tar.gz', 0], # 6682 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/metayml_conforms_to_known_spec.t0000444000175000017500000000114312217464565031140 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['U/UN/UNBIT/Net-uwsgi-1.1.tar.gz', 0], # 2409 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['A/AN/ANANSI/Anansi-Actor-0.04.tar.gz', 0], # 3157 ['S/SC/SCILLEY/POE/Component/IRC/Plugin/IRCDHelp-0.02.tar.gz', 0], # 3243 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['H/HI/HITHIM/Socket-Mmsg-0.02.tar.gz', 0], # 3946 ['C/CI/CINDY/AnyEvent-HTTPD-CookiePatch-v0.1.0.tar.gz', 0], # 4162 ['B/BE/BENNIE/ACME-KeyboardMarathon-1.15.tar.gz', 0], # 4479 ['M/ML/MLX/Algorithm-Damm-1.001.002.tar.gz', 0], # 4537 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/no_broken_auto_install.t0000444000175000017500000000126412217464565027370 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['G/GU/GUGOD/WWW-Shorten-0rz-0.07.tar.gz', 0], # 14671 ['C/CL/CLKAO/IPC-Run-SafeHandles-0.04.tar.gz', 0], # 19431 ['T/TB/TBR/WKHTMLTOPDF-0.02.tar.gz', 0], # 19819 ['M/MO/MONS/Test-More-UTF8-0.04.tar.gz', 0], # 19952 ['S/SK/SKAUFMAN/Template-Plugin-Devel-StackTrace-0.02.tar.gz', 0], # 19960 ['L/LU/LUKEC/Test-Mock-LWP-0.06.tar.gz', 0], # 20054 ['G/GA/GAOU/Ubigraph-0.05.tar.gz', 0], # 20092 ['Y/YV/YVESAGO/Jifty-Plugin-Userpic-0.9.tar.gz', 0], # 20161 ['Y/YV/YVESAGO/Jifty-Plugin-SiteNews-0.9.tar.gz', 0], # 20249 ['B/BO/BOLAV/DateTime-Format-Duration-DurationString-0.03.tar.gz', 0], # 20527 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_buildtool.t0000444000175000017500000000122312217464565025461 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['L/LA/LAWSONK/Gtk2-Ex-MPlayerEmbed-0.03.tar.gz', 0], # 465 ['H/HE/HEDWIG/Template-Plugin-Duration-0.01.tar.gz', 0], # 474 ['W/WE/WEBY/Mojolicious-Plugin-Mobi-0.02.tar.gz', 0], # 474 ['T/TI/TIMA/Amazon-Bezos-0.001.tar.gz', 0], # 510 ['L/LE/LEOCHARRE/LEOCHARRE-X11-WMCtrl-0.01.tar.gz', 0], # 514 ['W/WO/WOLDRICH/Bundle-Woldrich-Term-0.02.tar.gz', 0], # 530 ['W/WO/WOLDRICH/App-epic-0.014.tar.gz', 0], # 812 ['T/TA/TAG/AnyEvent-Peer39-0.32.tar.gz', 0], # 824 ['A/AB/ABCABC/CFTP_01.tar.gz', 0], # 897 ['D/DA/DAMBAR/Catalyst-Plugin-Imager-0.01.tar.gz', 0], # 1026 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/use_strict.t0000444000175000017500000000147412217464565025025 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['T/TO/TOBYINK/Platform-Windows-0.002.tar.gz', 0], # 2206 ['T/TO/TOBYINK/Platform-Unix-0.002.tar.gz', 0], # 2264 ['S/SC/SCILLEY/POE/Component/IRC/Plugin/IRCDHelp-0.02.tar.gz', 0], # 3243 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['T/TX/TXH/Template-Plugin-Filter-MinifyHTML-0.02.tar.gz', 0], # 3484 ['A/AN/ANANSI/Anansi-ObjectManager-0.06.tar.gz', 0], # 5246 ['M/MA/MARCEL/Web-Library-0.01.tar.gz', 0], # 7345 ['P/PJ/PJB/Speech-Speakup-1.04.tar.gz', 0], # 7410 ['T/TE/TEMPIRE/Eponymous-Hash-0.01.tar.gz', 0], # 8503 ['S/SU/SULLR/Net-SSLGlue-1.03.tar.gz', 0], # 8720 # use 5.012 and higher ['Z/ZD/ZDM/Pharaoh-BootStrap-3.00.tar.gz', 1], # use 5.12.0 ['M/MA/MALLEN/Acme-Github-Test-0.03.tar.gz', 1] # use 5.014 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/metayml_conforms_spec_current.t0000444000175000017500000000114312217464565030764 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['U/UN/UNBIT/Net-uwsgi-1.1.tar.gz', 0], # 2409 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['A/AN/ANANSI/Anansi-Actor-0.04.tar.gz', 0], # 3157 ['S/SC/SCILLEY/POE/Component/IRC/Plugin/IRCDHelp-0.02.tar.gz', 0], # 3243 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['H/HI/HITHIM/Socket-Mmsg-0.02.tar.gz', 0], # 3946 ['C/CI/CINDY/AnyEvent-HTTPD-CookiePatch-v0.1.0.tar.gz', 0], # 4162 ['B/BE/BENNIE/ACME-KeyboardMarathon-1.15.tar.gz', 0], # 4479 ['M/ML/MLX/Algorithm-Damm-1.001.002.tar.gz', 0], # 4537 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/metayml_is_parsable.t0000444000175000017500000000130212217464565026643 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( # No META.yml ['U/UN/UNBIT/Net-uwsgi-1.1.tar.gz', 0], # 2409 ['A/AN/ANANSI/Anansi-Singleton-0.02.tar.gz', 0], # 2664 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['A/AN/ANANSI/Anansi-Class-0.03.tar.gz', 0], # 3028 ['A/AN/ANANSI/Anansi-Actor-0.04.tar.gz', 0], # 3157 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['M/MA/MANIGREW/SEG7-1.0.1.tar.gz', 0], # 3847 ['H/HI/HITHIM/Socket-Mmsg-0.02.tar.gz', 0], # 3946 ['S/ST/STEFANOS/Net-SMTP_auth-SSL-0.2.tar.gz', 0], # 4058 # Stream does not end with newline character ['S/SC/SCILLEY/POE/Component/IRC/Plugin/IRCDHelp-0.02.tar.gz', 0], # 3243 ); libmodule-cpants-analyse-perl-0.92+dfsg.orig/xt/kwalitee/has_human_readable_license.t0000444000175000017500000000107412217464565030121 0ustar salvisalviuse strict; use warnings; use xt::kwalitee::Test; xt::kwalitee::Test::run( ['J/JJ/JJUDD/DBIx-Class-TimeStamp-HiRes-v1.0.0.tar.gz', 0], # 2596 ['N/NI/NIELSD/Speech-Google-0.5.tar.gz', 0], # 2907 ['S/SC/SCILLEY/POE/Component/IRC/Plugin/IRCDHelp-0.02.tar.gz', 0], # 3243 ['A/AN/ANANSI/Anansi-Library-0.02.tar.gz', 0], # 3365 ['J/JE/JEEN/WebService-Aladdin-0.08.tar.gz', 0], # 4287 ['S/SM/SMUELLER/Math-SymbolicX-Complex-1.01.tar.gz', 0], # 4719 ['I/IA/IAMCAL/Flickr-API-1.06.tar.gz', 0], # 5172 ['A/AN/ANANSI/Anansi-ObjectManager-0.06.tar.gz', 0], # 5246 );