/usr/bin/kwalitee-metrics is in libtest-kwalitee-perl 1.17-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | #!/usr/bin/perl
# ABSTRACT: list details of all kwalitee metrics installed on the system
# PODNAME: kwalitee-metrics
use strict;
use warnings;
use Module::CPANTS::Analyse 0.87;
my $verbose = @ARGV && ($ARGV[0] eq '--verbose' || $ARGV[0] eq '-v');
my $analyzer = Module::CPANTS::Analyse->new({
distdir => '.',
dist => '.',
opts => { no_capture => 1 },
});
# TODO: MCA needs an API for doing this iteration.
my @generators =
map { $_->[1] } # Schwartzian transform out
sort {
$a->[0] <=> $b->[0] # sort by run order
||
$a->[1] cmp $b->[1] # falling back to generator name
}
map { [ $_->order, $_ ] } # Schwartzian transform in
@{ $analyzer->mck->generators };
for my $generator (@generators)
{
print $generator, "\n";
for my $indicator (sort { $a->{name} cmp $b->{name} } @{ $generator->kwalitee_indicators })
{
print " $indicator->{name}";
my @flags = grep { exists $indicator->{$_} }
qw(is_extra is_experimental needs_db);
print ' (', join(', ', @flags), ')' if @flags;
print "\n";
print " error: $indicator->{error}\n" if $verbose;
print " remedy: $indicator->{remedy}\n" if $verbose;
}
}
continue { print "\n"; }
__END__
=pod
=encoding UTF-8
=for :stopwords chromatic Karen Etheridge Gavin Sherlock Kenichi Ishigaki Nathan Haigh
programmatically
=head1 NAME
kwalitee-metrics - list details of all kwalitee metrics installed on the system
=head1 VERSION
version 1.17
=head1 DESCRIPTION
Dumps all of the kwalitee metrics, along with their source class, currently
installed on the system.
If C<--verbose> or C<-v> is passed as an argument, the 'error' and 'remedy'
strings for the metric are included, as a sort of documentation (the only kind
programmatically available).
=head1 SEE ALSO
=over 4
=item *
L<Test::Kwalitee>
=item *
L<Module::CPANTS::Analyse>
=back
=head1 AUTHORS
=over 4
=item *
chromatic <chromatic@wgz.org>
=item *
Karen Etheridge <ether@cpan.org>
=back
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2005 by chromatic.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|