web/cgi-bin/yatt.lib/YATT/Class/ArrayScanner.pm

filter: Statementstmt 94.5% 35 / 37 Branchbran 50.0% 5 / 10 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 10 / 12 Podpod 0.0% 0 / 8 totaltotal 71.2% 52 / 73 CC 8 SCAR 7.2
CC
8
Cov
82%
current
3.2
readable
3.1
read
2.0
CRAP 2.1
« web/cgi-bin/yatt.lib/YATT/LRXML/MetaInfo.pm ↑ Summary web/cgi-bin/yatt.lib/YATT/Util/redundant_sprintf.pm »
1 # -*- mode: perl; coding: utf-8 -*-
2 package YATT::Class::ArrayScanner;
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings qw(FATAL all NONFATAL misc);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 7 ▶use base qw(YATT::Class::Configurable);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 ▶use YATT::Fields qw(^cf_array cf_index);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 9546 ▶sub readable {
Subroutine readable: called CC=3 SCAR=11.4
Pod undocumented
9 9546 (my MY $path, my ($more)) = @_;
10 9546 ▶ return unless defined $path->{cf_index};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $path->{"cf_index"} 0 9546 9546
11 9546 ▶ $path->{cf_index} + ($more || 0) < @{$path->{cf_array}};
Condition50%1/2
$more || 0
l!l
09546
MC/DC0%0/1
$more || 0
$more
Truth table50%1/2
A
A= $more
Aresult
11
00
12 }
13  
14 818 ▶sub read {
Subroutine read: called CC=2 SCAR=7.0
Pod undocumented
15 818 (my MY $path) = @_;
16 818 ▶ return undef unless defined $path->{cf_index};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $path->{"cf_index"} 0 818 818
17 818 my $value = $path->{cf_array}->[$path->{cf_index}];
18 818 $path->after_read($path->{cf_index}++);
19 818 $value;
20 }
21  
22 3 ▶sub after_read {}
Subroutine after_read: called CC=1 SCAR=0.0
Pod undocumented
23 0 ▶sub after_next {}
Subroutine after_next: not called CC=1 SCAR=0.0
Pod undocumented
24  
25 5711 ▶sub current {
Subroutine current: called CC=3 SCAR=11.7
Pod undocumented
26 5711 (my MY $path, my ($offset)) = @_;
27 5711 ▶ return undef unless defined $path->{cf_index};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $path->{"cf_index"} 0 5711 5711
28 5711 ▶ $path->{cf_array}->[$path->{cf_index} + ($offset || 0)]
Condition50%1/2
$offset || 0
l!l
05711
MC/DC0%0/1
$offset || 0
$offset
Truth table50%1/2
A
A= $offset
Aresult
11
00
29 }
30  
31 1699 ▶sub next {
Subroutine next: called CC=2 SCAR=7.0
Pod undocumented
32 1699 (my MY $path) = @_;
33 1699 ▶ return undef unless defined $path->{cf_index};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $path->{"cf_index"} 0 1699 1699
34 1699 my $val = $path->{cf_array}->[$path->{cf_index}++];
35 1699 $path->after_next;
36 1699 $val;
37 }
38  
39 89 ▶sub go_next {
Subroutine go_next: called CC=2 SCAR=7.0
Pod undocumented
40 89 (my MY $path) = @_;
41 89 ▶ return undef unless defined $path->{cf_index};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $path->{"cf_index"} 0 89 89
42 89 $path->{cf_index}++;
43 89 $path->after_next;
44 89 $path;
45 }
46  
47 0 ▶sub peek {
Subroutine peek: not called CC=1 SCAR=6.9
Pod undocumented
48 0 (my MY $path, my ($pos)) = @_;
49 0 $path->{cf_array}[$pos];
50 }
51  
52 7 1;
« web/cgi-bin/yatt.lib/YATT/LRXML/MetaInfo.pm ↑ Summary web/cgi-bin/yatt.lib/YATT/Util/redundant_sprintf.pm »