lib/Git/Wrapper/Plus/Support/Range.pm

filter: Statementstmt 83.3% 35 / 42 Branchbran 50.0% 7 / 14 Conditioncond 44.4% 4 / 9 MC/DCmcdc 16.6% 1 / 6 Subroutinesub 100% 8 / 8 Podpod 50.0% 1 / 2 totaltotal 69.1% 56 / 81 SCAR 26.4
CC
11
Cov
71%
supports_version
17.1
BUILD
4.9
BEGIN
1.0
CRAP 14.0
« blib/lib/Git/Wrapper/Plus/Support/Arguments.pm ↑ Summary blib/lib/Git/Wrapper/Plus/Ref/Tag.pm »
1 6 ▶use 5.008; # utf8
Subroutine BEGIN: called CC=1 SCAR=0.0
2 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package Git::Wrapper::Plus::Support::Range;
7 6 $Git::Wrapper::Plus::Support::Range::VERSION = '0.004010';
8 # ABSTRACT: A record describing a range of supported versions
9  
10 6 our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30 6 ▶use Moo qw( has );
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 6 our @CARP_NOT;
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60 6 has 'min' => ( is => ro =>, predicate => 'has_min' );
61 6 has 'max' => ( is => ro =>, predicate => 'has_max' );
62  
63 6 has 'min_tag' => ( is => ro =>, predicate => 'has_min_tag' );
64 6 has 'max_tag' => ( is => ro =>, predicate => 'has_max_tag' );
65  
66 6 has 'min_sha1' => ( is => ro =>, predicate => 'has_min_sha1' );
67 6 has 'max_sha1' => ( is => ro =>, predicate => 'has_max_sha1' );
68  
69  
70  
71  
72  
73  
74 sub BUILD {
75 118 ▶ my ($self) = @_;
Subroutine BUILD: called CC=3 SCAR=16.0
Pod undocumented
76 118 ▶ if ( not $self->min and not $self->max ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $self->min || $self->max) 0 118 118
Condition33%1/3
$self->min || $self->max
l!l&&r!l&&!r
11800
MC/DC0%0/2
$self->min || $self->max
$self->min $self->max
Truth table33%1/3
A || B
A= $self->minB= $self->max
ABresult
1X1
011
000
77 0 require Carp;
78 ## no critic (Variables::ProhibitLocalVars)
79 0 local (@CARP_NOT) = ('Git::Wrapper::Plus::Support::Range');
80 0 Carp::croak('Invalid range, must specify either min or max, or both');
81 }
82 }
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97 sub supports_version {
98 35 ▶ my ( $self, $versions_object ) = @_;
Subroutine supports_version: called CC=9 SCAR=28.4
Pod documented
99 35 ▶ if ( $self->has_min and not $self->has_max ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_min and not $self->has_max) 34 1 35
Condition66%2/3
$self->has_min and not $self->has_max
!ll&&!rl&&r
0134
MC/DC50%1/2
$self->has_min and not $self->has_max
$self->has_min not $self->has_max
Truth table66%2/3
A and not(B)
A= $self->has_minB= not $self->has_max
ABresult
0X0
100
111
100 34 ▶ return 1 if $versions_object->newer_than( $self->min );
Branch: 1 branch
BranchTrueFalseTotal
if $versions_object->newer_than($self->min) 34 0 34
101 0 return;
102 }
103 1 ▶ if ( $self->has_max and not $self->has_min ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_max and not $self->has_min) 0 1 1
Condition33%1/3
$self->has_max and not $self->has_min
!ll&&!rl&&r
010
MC/DC0%0/2
$self->has_max and not $self->has_min
$self->has_max not $self->has_min
Truth table33%1/3
A and not(B)
A= $self->has_maxB= not $self->has_min
ABresult
0X0
100
111
104 0 ▶ return 1 if $versions_object->older_than( $self->max );
Branch: 1 branch
BranchTrueFalseTotal
if $versions_object->older_than($self->max) 0 0 0
105 0 return;
106 }
107 1 ▶ return unless $versions_object->newer_than( $self->min );
Branch: 1 branch
BranchTrueFalseTotal
unless $versions_object->newer_than($self->min) 0 1 1
108 1 ▶ return unless $versions_object->older_than( $self->max );
Branch: 1 branch
BranchTrueFalseTotal
unless $versions_object->older_than($self->max) 1 0 1
109 0 return 1;
110 }
111  
112 6 ▶no Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
113 6 1;
114  
115 __END__
« blib/lib/Git/Wrapper/Plus/Support/Arguments.pm ↑ Summary blib/lib/Git/Wrapper/Plus/Ref/Tag.pm »