blib/lib/Lingua/Pangram.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 2 / 2 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 94.4% 34 / 36 CC 4 SCAR 6.9
CC
4
Cov
100%
pangram
3.0
new
2.0
BEGIN
1.0
CRAP 2.0
↑ Summary
1 package Lingua::Pangram;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use locale; # for correct lowercasing of 8-bit chars
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 require Exporter;
8  
9 1 @ISA = qw(Exporter);
10 # Items to export into callers namespace by default. Note: do not export
11 # names by default without a very good reason. Use EXPORT_OK instead.
12 # Do not simply export all your public functions/methods/constants.
13 1 @EXPORT = qw( );
14 1 $VERSION = '0.02';
15  
16  
17 # Preloaded methods go here.
18  
19 # Autoload methods go after =cut, and are processed by the autosplit program.
20  
21 2 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod undocumented
22 2 my $class = shift;
23 2 ▶ my $alphabet = shift || [ 'a' .. 'z' ];
Condition100%2/2
shift() || [('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')]
l!l
11
MC/DC100%1/1
shift() || [('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')]
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
24 2 my $self = bless $alphabet, $class;
25 2 return $self;
26 }#new
27  
28  
29 4 ▶sub pangram {
Subroutine pangram: called CC=3 SCAR=11.0
Pod undocumented
30 4 my $self = shift;
31 4 my $string = lc shift;
32  
33 4 my $ret = 1;
34 4 foreach my $letter (@$self) {
35 108 ▶ $ret = 0 if index($string, $letter) == -1;
Branch: 1 branch
BranchTrueFalseTotal
if index($string, $letter) == -1 25 83 108
36 }
37  
38 4 return $ret;
39 }#pangram
40  
41 1 1;
42 __END__
↑ Summary