blib/lib/File/Find/Rule/ConflictMarker.pm

filter: Statementstmt 100% 28 / 28 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 94.4% 34 / 36 SCAR 6.9
CC
2
Cov
97%
__ANON__
2.0
conflict_marker
1.0
BEGIN
1.0
CRAP 2.0
« Build ↑ Summary _build/lib/MyModuleBuilder.pm »
1 package File::Find::Rule::ConflictMarker;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use parent qw/File::Find::Rule/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.01';
7  
8 2 my $CONFLICT_MARKER_BASE = '<' x 7;
9 2 my $CONFLICT_MARKER_DEVIDER = '=' x 7;
10 2 my $CONFLICT_MARKER_TARGET = '>' x 7;
11 2 my $CONFLICT_MARKER_SOURCE = '|' x 7;
12  
13 2 my $CONFLICT_MARKER_COND = join '|', map { "\Q$_\E" } (
14 $CONFLICT_MARKER_BASE,
15 $CONFLICT_MARKER_DEVIDER,
16 $CONFLICT_MARKER_TARGET,
17 $CONFLICT_MARKER_SOURCE,
18 );
19  
20 2 our $CONFLICT_MARKER_REGEX = qr/($CONFLICT_MARKER_COND)/;
21  
22 sub File::Find::Rule::conflict_marker {
23 1 ▶ my ($file_find_rule) = @_;
Subroutine conflict_marker: called CC=1 SCAR=0.0
Pod undocumented
24  
25 1 my $self = $file_find_rule->_force_object;
26  
27 return $self->file->exec(sub{
28 7 ▶ my ($file) = @_;
Subroutine __ANON__: called CC=2 SCAR=7.0
29  
30 7 ▶ open my $fh, '<', $file or die "Could not open $file, $!";
Branch: 1 branch
BranchTrueFalseTotal
open my $fh, "<", $file or die "Could not open $file, $!" 0 7 7
31 7 my $content = do { local $/; <$fh>; };
32 7 close $fh;
33  
34 7 return $content =~ m!$CONFLICT_MARKER_REGEX!;
35 1 });
36 }
37  
38 2 1;
39  
40 __END__
« Build ↑ Summary _build/lib/MyModuleBuilder.pm »