Pipe/Tube/Uniq.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.9% 32 / 33 CC 4 SCAR 9.2
CC
4
Cov
100%
run
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« Pipe/Tube/Cat.pm ↑ Summary Pipe/Tube/Tuple.pm »
1 package Pipe::Tube::Uniq;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use base 'Pipe::Tube';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '0.06';
9  
10 28 ▶sub run {
Subroutine run: called CC=4 SCAR=13.9
Pod undocumented
11 28 my ($self, @input) = @_;
12  
13 28 my @result;
14 28 foreach my $v (@input) {
15 24 ▶ next if defined $self->{last} and $self->{last} eq $v;
Branch: 1 branch
BranchTrueFalseTotal
if defined $self->{"last"} and $self->{"last"} eq $v 14 10 24
Condition100%3/3
defined $self->{"last"} and $self->{"last"} eq $v
!ll&&!rl&&r
2814
MC/DC100%2/2
defined $self->{"last"} and $self->{"last"} eq $v
defined $self->{"last"} $self->{"last"} eq $v
Truth table100%3/3
A and B
A= defined $self->{"last"}B= $self->{"last"} eq $v
ABresult
0X0
100
111
16  
17 10 $self->{last} = $v;
18 10 push @result, $v;
19 }
20 28 return @result;
21 }
22  
23  
24 1 1;
25  
26  
27  
« Pipe/Tube/Cat.pm ↑ Summary Pipe/Tube/Tuple.pm »