Diff3/Range2.pm

filter: Statementstmt 83.7% 31 / 37 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 73.3% 11 / 15 Podpod 100% 9 / 9 totaltotal 80.9% 51 / 63 CC 2 SCAR 5.9
CC
2
Cov
79%
_as_line_range
6.0
rangeA
2.0
rangeB
2.0
CRAP 1.8
« Diff3/ListMixin.pm ↑ Summary Diff3/Base.pm »
1 package Text::Diff3::Range2;
2 6 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use base qw(Text::Diff3::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 6 ▶use version; our $VERSION = '0.08';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 ## no critic (NamingConventions::Capitalization)
10  
11 6 __PACKAGE__->mk_attr_accessor(qw(type loA hiA loB hiB));
12  
13 1 ▶sub set_type_a { return shift->set_type('a') }
Subroutine set_type_a: called CC=1 SCAR=0.0
Pod documented
14 1 ▶sub set_type_c { return shift->set_type('c') }
Subroutine set_type_c: called CC=1 SCAR=0.0
Pod documented
15 1 ▶sub set_type_d { return shift->set_type('d') }
Subroutine set_type_d: called CC=1 SCAR=0.0
Pod documented
16 0 ▶sub rangeA { return ($_[0]->loA .. $_[0]->hiA) }
Subroutine rangeA: not called CC=1 SCAR=6.9
Pod documented
17 0 ▶sub rangeB { return ($_[0]->loB .. $_[0]->hiB) }
Subroutine rangeB: not called CC=1 SCAR=6.9
Pod documented
18  
19 3 ▶sub set_type {
Subroutine set_type: called CC=1 SCAR=0.0
Pod documented
20 3 my($self, $x) = @_;
21 3 $self->{type} = $x;
22 3 return $self;
23 }
24  
25 10 ▶sub as_array {
Subroutine as_array: called CC=1 SCAR=0.0
Pod documented
26 10 my($self) = @_;
27 10 return @{$self}{qw(type loA hiA loB hiB)};
28 }
29  
30 0 ▶sub as_string {
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
31 0 my($self) = @_;
32 0 return $self->_as_line_range($self->loA, $self->hiA)
33 . $self->type
34 . $self->_as_line_range($self->loB, $self->hiB);
35 }
36  
37 55 ▶sub initialize {
Subroutine initialize: called CC=1 SCAR=0.0
Pod documented
38 55 my($self, @arg) = @_;
39 55 $self->SUPER::initialize(@arg);
40 55 @{$self}{qw(type loA hiA loB hiB)} = @arg[1 .. 5];
41 55 return $self;
42 }
43  
44 0 ▶sub _as_line_range {
Subroutine _as_line_range: not called CC=2 SCAR=17.9
45 0 my($self, $lo, $hi) = @_;
46 0 ▶ return $lo >= $hi ? $hi : $lo . q{,} . $hi;
Branch: 1 branch
BranchTrueFalseTotal
$lo >= $hi ? : 0 0 0
47 }
48  
49 6 1;
50  
51 __END__
« Diff3/ListMixin.pm ↑ Summary Diff3/Base.pm »