blib/lib/Devel/StatProfiler/Html.pm

filter: Statementstmt 78.7% 26 / 33 Branchbran 75.0% 3 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 2 totaltotal 70.2% 33 / 47 CC 6 SCAR 14.1
CC
6
Cov
74%
process_and_output
6.0
process
5.2
BEGIN
1.0
CRAP 4.1
« blib/lib/Devel/StatProfiler/SourceMap.pm ↑ Summary blib/lib/Devel/StatProfiler/NameMap.pm »
1 package Devel::StatProfiler::Html;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use Devel::StatProfiler::Report;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶sub process {
Subroutine process: called CC=5 SCAR=16.5
Pod undocumented
9 2 my (%opts) = @_;
10 2 my $report = Devel::StatProfiler::Report->new(
11 flamegraph => 1,
12 sources => 1,
13 mixed_process => 1,
14 );
15  
16 2 my %state;
17 2 for my $f (@{$opts{files}}) {
18 6 my $r = Devel::StatProfiler::Reader->new($f);
19 6 my ($process_id) = @{$r->get_genealogy_info};
20 6 ▶ if (my $process_state = $state{$process_id}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $process_state = $state{$process_id}) 2 4 6
21 2 $r->set_reader_state(delete $process_state->{reader_state});
22 }
23 eval {
24 6 $report->add_trace_file($r);
25  
26 6 1;
27 6 ▶ } or do {
Branch: 1 branch
BranchTrueFalseTotal
eval { do { $report->add_trace_file($r); 1 } } or do { my $error = $@ || "Zombie error"; warn sprintf(q[Error reading trace file '%s': %s'], $f, $error) } 6 0 6
28 0 ▶ my $error = $@ || "Zombie error";
Condition0%0/2
$@ || 'Zombie error'
l!l
00
MC/DC0%0/1
$@ || 'Zombie error'
$@
Truth table0%0/2
A
A= $@
Aresult
11
00
29  
30 0 warn sprintf "Error reading trace file '%s': %s'", $f, $error;
31 };
32 6 $report->map_source($process_id);
33 6 $state{$process_id}->{reader_state} = $r->get_reader_state
34 }
35  
36 2 return $report;
37 }
38  
39 0 ▶sub process_and_output {
Subroutine process_and_output: not called CC=2 SCAR=17.9
Pod undocumented
40 0 my (%opts) = @_;
41 0 my $report = process(%opts);
42 0 my $diagnostics = $report->output($opts{output});
43  
44 0 for my $diagnostic (@$diagnostics) {
45 0 print STDERR $diagnostic, "\n";
46 }
47 }
48  
49 4 1;
50  
51 __END__
« blib/lib/Devel/StatProfiler/SourceMap.pm ↑ Summary blib/lib/Devel/StatProfiler/NameMap.pm »