| 1 | package Pgtools::Fingerprint; | ||||||||||
| 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 parent qw(Class::Accessor); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | __PACKAGE__->mk_accessors(qw(file query)); | |||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use File::Spec; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 0 | ▶ | sub exec { | ||||||||
|
Subroutine
exec: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 10 | 0 | my ($self, $query, $filename) = @_; | |||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | if($query ne "") { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 0 | $query = &symbolize_query($self, $query); | |||||||||
| 14 | 0 | &print_queries($self, $query); | |||||||||
| 15 | 0 | return; | |||||||||
| 16 | } | ||||||||||
| 17 | 0 | $filename = File::Spec->rel2abs($filename); | |||||||||
| 18 | |||||||||||
| 19 | 0 | ▶ | open(my $in, '<', $filename) or die "$!"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 0 | ▶ | while(<$in>) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 0 | chomp $_; | |||||||||
| 22 | 0 | $_ = &symbolize_query($self, $_); | |||||||||
| 23 | 0 | &print_queries($self, $_); | |||||||||
| 24 | } | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 8 | ▶ | sub symbolize_query { | ||||||||
|
Subroutine
symbolize_query: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 28 | 8 | my ($self, $q) = @_; | |||||||||
| 29 | 8 | $q =~ s/([\s<>=])([-\+])?[.0123456789]+/$1?/g; | |||||||||
| 30 | 8 | $q =~ s/(true|false)/?/ig; | |||||||||
| 31 | |||||||||||
| 32 | 8 | return $q; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | sub print_queries { | ||||||||
|
Subroutine
print_queries: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 36 | 0 | my ($self, $query) = @_; | |||||||||
| 37 | 0 | print $query."\n"; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 1 | 1; | |||||||||
| 41 | |||||||||||