API/Abbreviation.pm

filter: Statementstmt 56.2% 18 / 32 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 54.5% 24 / 44 CC 3 SCAR 15.4
CC
3
Cov
50%
abbreviate
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.7
« API/Status.pm ↑ Summary
1 package Magrathea::API::Abbreviation;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use 5.10.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use parent qw{ Exporter };
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Text::Autoformat;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 our @EXPORT_OK = qw{ abbreviate };
12  
13 sub abbreviate($)
14 0 ▶{
Subroutine abbreviate: not called CC=3 SCAR=24.8
Pod undocumented
15 0 my $check = shift;
16 0 local $_;
17 0 my $wanted = autoformat $check, {
18 case => 'highlight'
19 };
20 0 $wanted =~ s/\s*$//;
21 0 study $wanted;
22 0 ▶ while (<DATA>) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline DATA)) 0 0 0
23 0 chomp;
24 0 s/#.*//;
25 0 ▶ next if /^$/;
Branch: 1 branch
BranchTrueFalseTotal
if /^$/ 0 0 0
26 0 my ($key, $val) = split /\t/;
27 0 $wanted =~ s/\b$key\b/$val./g;
28 }
29 0 $wanted =~ s/\band\b/&/g;
30 0 $wanted =~ s/\.\.$/./;
31 0 return $wanted;
32 }
33  
34  
35  
36  
37 __DATA__
« API/Status.pm ↑ Summary