/usr/lib/x86_64-linux-gnu/perl5/5.22/Devel/Cover/Report/Json.pm is in libdevel-cover-perl 1.21-1ubuntu1.
This file is owned by root:root, with mode 0o644.
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 | # Copyright 2014-2015, Paul Johnson (paul@pjcj.net)
# This software is free. It is licensed under the same terms as Perl itself.
# The latest version of this software should be available from my homepage:
# http://www.pjcj.net
package Devel::Cover::Report::Json;
use strict;
use warnings;
our $VERSION = '1.21'; # VERSION
use Devel::Cover::DB::IO::JSON;
use Devel::Cover::Dumper; # For debugging
sub add_runs
{
my ($db) = @_;
my @runs;
for my $r (sort {$a->{start} <=> $b->{start}} $db->runs) {
push @runs, {
map { $_ => $r->$_ }
qw( run perl OS dir name version abstract start finish )
};
}
\@runs
}
sub report
{
my ($pkg, $db, $options) = @_;
my %options = map { $_ => 1 } grep !/path|time/, $db->all_criteria, "force";
$db->calculate_summary(%options);
my $json = {
runs => add_runs($db),
summary => $db->{summary},
};
# print "JSON: ", Dumper $json;
print "JSON sent to $options->{outputdir}/cover.json\n";
my $io = Devel::Cover::DB::IO::JSON->new(options => "pretty");
$io->write($json, "$options->{outputdir}/cover.json");
}
1
__END__
=head1 NAME
Devel::Cover::Report::Json - JSON backend for Devel::Cover
=head1 VERSION
version 1.21
=head1 SYNOPSIS
cover -report json
=head1 DESCRIPTION
This module provides JSON output for coverage data.
It is designed to be called from the C<cover> program.
=head1 SEE ALSO
Devel::Cover
=head1 BUGS
Huh?
=head1 LICENCE
Copyright 2014-2015, Paul Johnson (paul@pjcj.net)
This software is free. It is licensed under the same terms as Perl itself.
The latest version of this software should be available from my homepage:
http://www.pjcj.net
=cut
|