NameGen.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 7 / 7 Podpod 100% 3 / 3 totaltotal 80.4% 33 / 41 SCAR 11.1
CC
3
Cov
85%
gen
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
↑ Summary NameGen/CPAN/Authors.pm »
1 package Acme::NameGen;
2  
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION = '0.010000';
8  
9 1 ▶use vars qw($VERSION @EXPORT_OK);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 require Exporter;
11 1 *import = \&Exporter::import;
12 1 @EXPORT_OK = qw(gen gen_lc gen_uc);
13  
14 1 my @adjectives = (
15 'admiring', 'adoring', 'affectionate', 'agitated',
16 'amazing', 'angry', 'awesome', 'blissful',
17 'boring', 'brave', 'clever', 'cocky',
18 'compassionate', 'competent', 'condescending', 'confident',
19 'cranky', 'dazzling', 'determined', 'distracted',
20 'dreamy', 'eager', 'ecstatic', 'elastic',
21 'elated', 'elegant', 'eloquent', 'epic',
22 'fervent', 'festive', 'flamboyant', 'focused',
23 'friendly', 'frosty', 'gallant', 'gifted',
24 'goofy', 'gracious', 'happy', 'hardcore',
25 'heuristic', 'hopeful', 'hungry', 'infallible',
26 'inspiring', 'jolly', 'jovial', 'keen',
27 'kind', 'laughing', 'loving', 'lucid',
28 'mystifying', 'modest', 'musing', 'naughty',
29 'nervous', 'nifty', 'nostalgic', 'objective',
30 'optimistic', 'peaceful', 'pedantic', 'pensive',
31 'practical', 'priceless', 'quirky', 'quizzical',
32 'relaxed', 'reverent', 'romantic', 'sad',
33 'serene', 'sharp', 'silly', 'sleepy',
34 'stoic', 'stupefied', 'suspicious', 'tender',
35 'thirsty', 'trusting', 'unruffled', 'upbeat',
36 'vibrant', 'vigilant', 'vigorous', 'wizardly',
37 'wonderful', 'xenodochial', 'youthful', 'zealous',
38 'zen'
39 );
40  
41 sub gen {
42 6 ▶ my ( $adjective_element, $subjects, $subjects_element ) = @_;
Subroutine gen: called CC=3 SCAR=14.2
Pod documented
43 6 ▶ $adjectives[ $adjective_element || rand scalar @adjectives ] . '_'
Condition33%2/6
$adjective_element || rand scalar @adjectives
l!l&&r!l&&!r
600
$subjects_element || rand scalar @$subjects
l!l&&r!l&&!r
600
MC/DC0%0/2
$adjective_element || rand scalar @adjectives
$adjective_element rand scalar @adjectives
MC/DC0%0/2
$subjects_element || rand scalar @$subjects
$subjects_element rand scalar @$subjects
Truth table33%1/3
A || B
A= $adjective_elementB= rand scalar @adjectives
ABresult
1X1
011
000
Truth table33%1/3
A || B
A= $subjects_elementB= rand scalar @$subjects
ABresult
1X1
011
000
44 . $subjects->[ $subjects_element || rand scalar @$subjects ];
45 }
46  
47 2 ▶sub gen_lc { lc gen(@_) }
Subroutine gen_lc: called CC=1 SCAR=0.0
Pod documented
48  
49 2 ▶sub gen_uc { uc gen(@_) }
Subroutine gen_uc: called CC=1 SCAR=0.0
Pod documented
50  
51 1 1;
52  
53 __END__
↑ Summary NameGen/CPAN/Authors.pm »