blib/lib/Devel/Cover/DB/File.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 44 CC 3 SCAR 13.9
CC
3
Cov
0%
calculate_summary
6.0
calculate_percentage
6.0
BEGIN
2.0
CRAP 4.0
1 # Copyright 2001-2026, Paul Johnson (paul@pjcj.net)
2  
3 # This software is free. It is licensed under the same terms as Perl itself.
4  
5 # The latest version of this software should be available from my homepage:
6 # https://pjcj.net
7  
8 package Devel::Cover::DB::File;
9  
10 use strict;
11 use warnings;
12  
13 our $VERSION = '1.52'; # VERSION
14  
15 use Devel::Cover::Criterion;
16  
17 use Devel::Cover::Dumper;
18  
19 sub calculate_summary {
20 my $self = shift;
21 my ($db, $file, $options) = @_;
22  
23 my $s = $db->{summary}{$file} ||= {};
24  
25 for my $criterion ($self->items) {
26 next unless $options->{$criterion};
27 for my $location ($self->$criterion()->locations) {
28 for my $cover (@$location) {
29 $cover->calculate_summary($db, $file);
30 }
31 }
32 }
33 }
34  
35 sub calculate_percentage {
36 my $self = shift;
37 my ($db, $s) = @_;
38  
39 # print STDERR Dumper $s;
40 for my $criterion ($self->items) {
41 next unless exists $s->{$criterion};
42 my $c = "Devel::Cover::\u$criterion";
43 # print "$c\n";
44 $c->calculate_percentage($db, $s->{$criterion});
45 }
46 Devel::Cover::Criterion->calculate_percentage($db, $s->{total});
47 # print STDERR Dumper $s;
48 }
49  
50 1
51  
52 __END__