Pretty/Database/ANSI/Space.pm

filter: Statementstmt 68.0% 17 / 25 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 63.1% 24 / 38 CC 3 SCAR 15.6
CC
3
Cov
59%
action
12.0
match
2.0
BEGIN
1.0
CRAP 4.8
« Pretty/Database/ANSI/Punctuation.pm ↑ Summary Pretty/Print.pm »
1 #!/usr/bin/perl
2 package SQL::QueryBuilder::Pretty::Database::ANSI::Space;
3 1 ▶use base qw(SQL::QueryBuilder::Pretty::Rule);
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '0.01';
9  
10 1 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 0 ▶sub match {
Subroutine match: not called CC=1 SCAR=6.9
Pod documented
14 0 return qr/
15 (?:\r?\n|[\t\s])+
16 /x;
17 }
18  
19 0 ▶sub action {
Subroutine action: not called CC=3 SCAR=24.8
Pod documented
20 0 my $self = shift;
21 0 my $print = shift;
22 0 my $token = shift;
23  
24 # Ignore new lines and convert tabs to 1 space
25 0 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if ($token =~ /^[\t\s]+$/) 0 0 0
26 $token =~ /^[\t\s]+$/
27 ) {
28 0 ▶ $print->var(' ') unless $print->skip_next_space;
Branch: 1 branch
BranchTrueFalseTotal
unless $print->skip_next_space 0 0 0
29 0 $print->skip_next_space(0);
30 }
31  
32 0 return 1;
33 }
34  
35 1 1;
36 __END__
« Pretty/Database/ANSI/Punctuation.pm ↑ Summary Pretty/Print.pm »