This file is indexed.

/usr/lib/x86_64-linux-gnu/perl5/5.24/Devel/Cover/Report/Compilation.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Copyright 2001-2016, Paul Johnson (paul@pjcj.net)

# This software is free.  It is licensed under the same terms as Perl itself.

# ############################################################################ #
# 2006-09-14 Denis Howe
# Cloned from 0.59 Text.pm and hacked to give a minimal output in a
# format similar to that output by Perl itself so that it's easier to
# step through the untested locations with Emacs compilation mode
# Copyright assigned to Paul Johnson
# ############################################################################ #

# The latest version of this software should be available from my homepage:
# http://www.pjcj.net

package Devel::Cover::Report::Compilation;

use strict;
use warnings;

our $VERSION = '1.23'; # VERSION

use Devel::Cover::DB;

# TODO - uncoverable code?

sub print_statement {
    my ($db, $file, $options) = @_;

    my $statements = $db->cover->file($file)->statement or return;

    for my $location ($statements->items) {
        my $l = $statements->location($location);
        for my $statement (@$l) {
            next if $statement->covered;
            print "Uncovered statement at $file line $location:\n";
        }
    }
}

sub print_branches {
    my ($db, $file, $options) = @_;

    my $branches = $db->cover->file($file)->branch or return;

    for my $location (sort { $a <=> $b } $branches->items) {
        for my $b (@{$branches->location($location)}) {
            next unless $b->error;

            # One or both paths from this branch weren't reached.
            # $b->covered(0) and (1) say whether the first and second
            # paths were reached.  If the branch condition text begins
            # with "unless" then the meanings of 0 and 1 are swapped.
            # The output is easier to understand if we strip off
            # "unless" and say whether the remaining condition was
            # true or false.

            my $text = $b->text;
            my ($t, $f) = map $b->covered($_),
                $text =~ s/^(if|unless) // && $1 eq "unless" ? (1, 0) : (0, 1);
            # TODO - uncoverable code?
            print "Branch never ",
                $t ? ($f ? "???" : "false") : ($f ? "true" : "reached"),
                " at $file line $location: $text\n";
        }
    }
}

sub print_conditions {
    my ($db, $file, $options) = @_;

    my $conditions = $db->cover->file($file)->condition or return;

    my $template = sub { "%-5s %3s %6s " . ( "%6s " x shift ) . "  %s\n" };

    my %r;
    for my $location (sort { $a <=> $b } $conditions->items) {
        my %seen;
        for my $c (@{$conditions->location($location)}) {
            push @{$r{$c->type}}, [ $c, $seen{$c->type}++ ? "" : $location ];
        }
    }

    my %seen;
    for my $type (sort keys %r) {
        my $tpl;
        for (@{$r{$type}}) {
            my ($c, $location) = @$_;
            next unless $c->error;
            my @headers = @{$c->headers};
            print "Uncovered condition (", join(", ",
                map (!$c->covered($_) ? $headers[$_] : (), 0..$c->total-1)),
                ") at $file line $location: ", $c->text, "\n";
        }
    }
}

sub print_subroutines {
    my ($db, $file, $options) = @_;

    my $subroutines = $db->cover->file($file)->subroutine or return;

    for my $location ($subroutines->items) {
        my $l = $subroutines->location($location);
        for my $sub (@$l) {
            next if $sub->covered;
            print "Uncovered subroutine ", $sub->name,
                  " at $file line $location\n";
        }
    }
}

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

    for my $file (@{$options->{file}}) {
        print_statement  ($db, $file, $options) if $options->{show}{statement};
        print_branches   ($db, $file, $options) if $options->{show}{branch};
        print_conditions ($db, $file, $options) if $options->{show}{condition};
        print_subroutines($db, $file, $options) if $options->{show}{subroutine};
    }
}

1

__END__

=head1 NAME

Devel::Cover::Report::Compilation - backend for Devel::Cover

=head1 VERSION

version 1.23

=head1 SYNOPSIS

 cover -report compilation

=head1 DESCRIPTION

This module provides a textual reporting mechanism for coverage data.
It is designed to be called from the C<cover> program.

It produces one report per line, in a format like Perl's own compilation error
messages.  This makes it easy to, e.g. use Emacs compilation mode to step
through the reports.

=head1 SEE ALSO

 Devel::Cover

=head1 BUGS

Huh?

=head1 LICENCE

Copyright 2001-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