This file is indexed.

/usr/lib/x86_64-linux-gnu/perl5/5.24/Devel/Cover/Report/Sort.pm is in libdevel-cover-perl 1.23-2+b1.

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
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
# Copyright 2004-2016, 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::Sort;

use strict;
use warnings;

our $VERSION = '1.23'; # VERSION

use Devel::Cover::DB;

sub print_sort {
    my ($db, $options) = @_;
    my %runs;
    my @collected = grep $_ ne "time", @{$options->{coverage}};
    # use Devel::Cover::Dumper; print Dumper [$db->runs];
    for my $r (sort {$a->{start} <=> $b->{start}} $db->runs) {
        print "Run:          ", $r->run,  "\n";
        print "Perl version: ", $r->perl, "\n";
        print "OS:           ", $r->OS,   "\n";
        print "Start:        ", scalar gmtime $r->start  / 1e6, "\n";
        print "Finish:       ", scalar gmtime $r->finish / 1e6, "\n";
        # use Devel::Cover::Dumper; print Dumper $r;

        @{$runs{$r->run}}{"vec", "size"} = ("", 0);
        my $run = $runs{$r->run};
        # use Devel::Cover::Dumper; print Dumper $run;
        my $vec = $r->vec;
        for my $file (@{$options->{file}}) {
            # print "$file\n";
            for my $criterion (@collected) {
                my ($v, $sz) = @{$vec->{$file}{$criterion}}{"vec", "size"};
                $sz |= 0;
                printf "$file:%10s %5d: ", $criterion, $sz;
                unless($sz) {
                    print "\n";
                    next;
                }
                for (0 .. $sz - 1) {
                    print vec $v, $_, 1;
                    vec($run->{vec}, $run->{size}++, 1) = vec $v, $_, 1;
                }
                print "\n";
            }
        }
        $run->{count} += vec $run->{vec}, $_, 1 for 0 .. $run->{size} - 1;
        print "Vec:          ";
        print vec $run->{vec}, $_, 1 for 0 .. $run->{size} - 1;
        print "\n";
        print "Count:        $run->{count} / $run->{size}\n\n";
    }
}

sub report {
    my ($pkg, $db, $options) = @_;
    print_sort($db, $options);
}

1

__END__

=head1 NAME

Devel::Cover::Report::Sort - backend for Devel::Cover

=head1 VERSION

version 1.23

=head1 SYNOPSIS

 cover -report sort

=head1 DESCRIPTION

This module reports coverage runs in an optimal order.
It is designed to be called from the C<cover> program.

=head1 SEE ALSO

 Devel::Cover

=head1 BUGS

Huh?

=head1 LICENCE

Copyright 2004-2016, 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