lib/Devel/Trepan/Position.pm

filter: Statementstmt 60.0% 21 / 35 Branchbran 20.0% 2 / 10 Conditioncond 27.7% 5 / 18 MC/DCmcdc 10.0% 1 / 10 Subroutinesub 66.6% 6 / 9 Podpod 0.0% 0 / 4 totaltotal 40.7% 35 / 86 CC 9 SCAR 20.9
CC
9
Cov
44%
eq
12.8
eq
12.8
inspect
2.0
CRAP 8.1
« blib/lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Highlight.pm ↑ Summary lib/Devel/Trepan/CmdProcessor/Command/Action.pm »
1 # Copyright (C) 2011-2014 Rocky Bernstein <rocky@cpan.org>
2 13 ▶use warnings; use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 13 ▶use Class::Struct;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 13 ▶no strict 'subs';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 13 struct Devel::Trepan::Position => {pkg => '$', filename => '$', line => '$',
7 event => '$'};
8 13 ▶use strict 'subs';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 package Devel::Trepan::Position;
11 sub eq($$)
12 2 ▶{
Subroutine eq: called CC=5 SCAR=25.5
Pod undocumented
13 0 ▶ my ($self, $other) = @_;
Subroutine eq: not called CC=5 SCAR=25.5
Pod undocumented
14 0 ▶ return 0 unless defined $self && defined $other;
Branch: 2 branches
BranchTrueFalseTotal
unless defined $self and defined $other 0 2 2
unless defined $self and defined $other 0 0 0
Condition16%1/6
defined $self and defined $other
!ll&&!rl&&r
002
defined $self and defined $other
!ll&&!rl&&r
000
MC/DC0%0/2
defined $self and defined $other
defined $self defined $other
MC/DC0%0/2
defined $self and defined $other
defined $self defined $other
Truth table33%1/3
A and B
A= defined $selfB= defined $other
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $selfB= defined $other
ABresult
0X0
100
111
15 return (
16 0 ▶ $self->filename eq $other->filename
Condition33%4/12
$self->filename eq $other->filename && $self->line eq $other->line && $self->event eq $other->event
!ll&&!rl&&r
101
$self->filename eq $other->filename and $self->line eq $other->line
!ll&&!rl&&r
011
$self->filename eq $other->filename && $self->line eq $other->line && $self->event eq $other->event
!ll&&!rl&&r
000
$self->filename eq $other->filename and $self->line eq $other->line
!ll&&!rl&&r
000
MC/DC33%1/3
$self->filename eq $other->filename && $self->line eq $other->line && $self->event eq $other->event
$self->filename eq $other->filename $self->line eq $other->line $self->event eq $other->event
MC/DC0%0/3
$self->filename eq $other->filename && $self->line eq $other->line && $self->event eq $other->event
$self->filename eq $other->filename $self->line eq $other->line $self->event eq $other->event
Truth table50%2/4
A and B && C
A= $self->filename eq $other->filenameB= $self->line eq $other->lineC= $self->event eq $other->event
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/4
A and B && C
A= $self->filename eq $other->filenameB= $self->line eq $other->lineC= $self->event eq $other->event
ABCresult
0XX0
10X0
1100
1111
17 && $self->line eq $other->line
18 && $self->event eq $other->event)
19 }
20  
21 0 ▶sub inspect($) {
Subroutine inspect: not called CC=1 SCAR=6.9
Pod undocumented
22 0 ▶ my $self = shift;
Subroutine inspect: not called CC=1 SCAR=6.9
Pod undocumented
23 0 return sprintf("pkg: %s, file: %s, line: %s, event: %s",
24 $self->pkg, $self->filename, $self->line, $self->event);
25 }
26  
27 13 ▶unless (caller) {
Branch: 1 branch
BranchTrueFalseTotal
unless (caller) 0 13 13
28 0 my $line = __LINE__;
29 0 my $pos1 = __PACKAGE__->new(pkg=>__PACKAGE__, filename=>__FILE__,
30 line => $line, event=>'brkpt');
31 0 my $pos2 = __PACKAGE__->new(pkg=>__PACKAGE__, filename=>__FILE__,
32 line => $line, event=>'brkpt');
33 0 my $pos3 = __PACKAGE__->new(pkg=>__PACKAGE__, filename=>__FILE__,
34 line => __LINE__, event=>'brkpt');
35 0 ▶ printf "pos1 is%s pos2\n", $pos1->eq($pos2) ? '' : ' not';
Branch: 1 branch
BranchTrueFalseTotal
$pos1->eq($pos2) ? : 0 0 0
36 0 ▶ printf "pos1 is%s pos3\n", $pos1->eq($pos3) ? '' : ' not';
Branch: 1 branch
BranchTrueFalseTotal
$pos1->eq($pos3) ? : 0 0 0
37 0 print $pos1->inspect, "\n";
38  
39 }
40 13 1;
« blib/lib/Devel/Trepan/CmdProcessor/Command/Show_Subcmd/Highlight.pm ↑ Summary lib/Devel/Trepan/CmdProcessor/Command/Action.pm »