blib/lib/ShipIt/Step/CommitMessageWrap.pm

filter: Statementstmt 52.2% 23 / 44 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 63.6% 7 / 11 Podpod 100% 2 / 2 totaltotal 53.3% 32 / 60 CC 2 SCAR 6.4
CC
2
Cov
50%
init
6.0
__ANON__
1.3
run
1.3
CRAP 1.9
↑ Summary
1 package ShipIt::Step::CommitMessageWrap;
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 base 'ShipIt::Step';
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 our $VERSION = '0.04';
6  
7 0 ▶sub init {
Subroutine init: not called CC=2 SCAR=17.9
Pod documented
8 0 my ($self, $conf) = @_;
9  
10 0 ▶ $self->{format} = $conf->value('commit_message.format') || '%msg';
Condition0%0/2
$conf->value('commit_message.format') || '%msg'
l!l
00
MC/DC0%0/1
$conf->value('commit_message.format') || '%msg'
$conf->value('commit_message.format')
Truth table0%0/2
A
A= $conf->value('commit_message.format')
Aresult
11
00
11 0 $self->{format} =~ s/%/%%/g;
12 0 $self->{format} =~ s/%%msg/%s/g;
13 }
14  
15 0 ▶sub run {
Subroutine run: not called CC=1 SCAR=2.5
Pod documented
16 0 my ($self, $state) = @_;
17  
18 0 my $pkg = ref($state->vc);
19  
20 0 my $commit = $pkg->can('commit');
21 0 my $tag_version = $pkg->can('tag_version');
22 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
23 0 ▶ *{"$pkg\::commit"} = sub {
Subroutine __ANON__: not called CC=1 SCAR=2.2
24 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 0 my $c = shift;
26 0 my $msg = shift;
27 0 $msg = sprintf $self->{format}, $msg;
28 0 $commit->($c, $msg, @_);
29 0 };
30 0 ▶ *{"$pkg\::tag_version"} = sub {
Subroutine __ANON__: not called CC=1 SCAR=2.6
31 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 0 my $c = shift;
33 0 my $ver = shift;
34 0 my $msg = shift;
35 0 $msg = sprintf $self->{format}, $msg;
36 0 $tag_version->($c, $ver, $msg, @_);
37 0 };
38 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
39 }
40  
41 1 1;
42 __END__
↑ Summary