blib/lib/Devel/StatProfiler/SectionChangeReader.pm

filter: Statementstmt 91.8% 34 / 37 Branchbran 100% 8 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 82.3% 14 / 17 Podpod 0.0% 0 / 14 totaltotal 73.6% 56 / 76 CC 5 SCAR 5.9
CC
5
Cov
93%
read_traces
4.0
get_source_stack_sample_depth
2.0
clear_custom_metadata
2.0
CRAP 1.8
« blib/lib/Devel/StatProfiler/Metadata.pm ↑ Summary blib/lib/Devel/StatProfiler/Reader.pm »
1 package Devel::StatProfiler::SectionChangeReader;
2  
3 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 15 ▶use Devel::StatProfiler::Reader;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 8565 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
9 8565 my ($class, $reader) = @_;
10  
11 8565 return bless {
12 reader => $reader,
13 traces => [],
14 sections_changed => 0,
15 }, $class;
16 }
17  
18 15751 ▶sub read_traces {
Subroutine read_traces: called CC=4 SCAR=13.9
Pod undocumented
19 15751 my ($self) = @_;
20 15751 my ($r, $traces) = @{$self}{qw(reader traces)};
21  
22 15751 $self->{sections_changed} = 0;
23 15751 ▶ while (my $trace = $r->read_trace) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $trace = $r->read_trace) 10510 15551 26061
24 10510 push @$traces, $trace;
25 10510 ▶ if ($trace->sections_changed) {
Branch: 1 branch
BranchTrueFalseTotal
if ($trace->sections_changed) 200 10310 10510
26 200 $self->{sections_changed} = 1;
27 200 return 1;
28 }
29 }
30  
31 15551 ▶ return @$traces ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
@$traces ? : 7775 7776 15551
32 }
33  
34 7975 ▶sub sections_changed { $_[0]->{sections_changed} }
Subroutine sections_changed: called CC=1 SCAR=0.0
Pod undocumented
35 7982 ▶sub empty { !@{$_[0]->{traces}} }
Subroutine empty: called CC=1 SCAR=0.0
Pod undocumented
36  
37 # Devel::StatProfiler::Reader methods
38  
39 7975 ▶sub get_source_tick_duration { $_[0]->{reader}->get_source_tick_duration }
Subroutine get_source_tick_duration: called CC=1 SCAR=0.0
Pod undocumented
40 0 ▶sub get_source_stack_sample_depth { $_[0]->{reader}->get_source_stack_sample_depth }
Subroutine get_source_stack_sample_depth: not called CC=1 SCAR=6.9
Pod undocumented
41 7975 ▶sub get_source_perl_version { $_[0]->{reader}->get_source_perl_version }
Subroutine get_source_perl_version: called CC=1 SCAR=0.0
Pod undocumented
42 7975 ▶sub get_genealogy_info { $_[0]->{reader}->get_genealogy_info }
Subroutine get_genealogy_info: called CC=1 SCAR=0.0
Pod undocumented
43 7775 ▶sub get_active_sections { $_[0]->{reader}->get_active_sections }
Subroutine get_active_sections: called CC=1 SCAR=0.0
Pod undocumented
44 15744 ▶sub get_custom_metadata { $_[0]->{reader}->get_custom_metadata }
Subroutine get_custom_metadata: called CC=1 SCAR=0.0
Pod undocumented
45 0 ▶sub clear_custom_metadata { $_[0]->{reader}->clear_custom_metadata }
Subroutine clear_custom_metadata: not called CC=1 SCAR=6.9
Pod undocumented
46 708 ▶sub delete_custom_metadata { $_[0]->{reader}->delete_custom_metadata($_[1]) }
Subroutine delete_custom_metadata: called CC=1 SCAR=0.0
Pod undocumented
47 0 ▶sub get_source_code { $_[0]->{reader}->get_source_code }
Subroutine get_source_code: not called CC=1 SCAR=6.9
Pod undocumented
48  
49 18485 ▶sub read_trace {
Subroutine read_trace: called CC=2 SCAR=6.9
Pod undocumented
50 18485 ▶ return @{$_[0]->{traces}} ? shift @{$_[0]->{traces}} : undef;
Branch: 1 branch
BranchTrueFalseTotal
@{$_[0]{'traces'};} ? : 10510 7975 18485
51 }
52  
53 15 1;
54  
55 __END__
« blib/lib/Devel/StatProfiler/Metadata.pm ↑ Summary blib/lib/Devel/StatProfiler/Reader.pm »