blib/lib/Acme/MakeMoneyAtHome.pm

filter: Statementstmt 87.8% 29 / 33 Branchbran 50.0% 7 / 14 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 71.9% 41 / 57 CC 8 SCAR 21.2
CC
8
Cov
74%
make_money_at_home
11.1
BEGIN
1.0
BEGIN
1.0
CRAP 8.3
↑ Summary
1 package Acme::MakeMoneyAtHome;
2 1 $Acme::MakeMoneyAtHome::VERSION = '1.004001';
3 1 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 our @EXPORT = 'make_money_at_home';
7  
8 1 our @Subject = (
9 "roommate",
10 "cousin",
11 [ "mother", 'F' ],
12 [ "father", 'M' ],
13 [ "sensei", 'M' ],
14 "associate",
15 "senator",
16 "friend",
17 [ "aunt", 'F' ],
18 "employer",
19 "car dealer",
20 [ "housemaid", 'F' ],
21 "limousine driver",
22 "study partner",
23 [ "half-sister", 'F' ],
24 [ "step-uncle", 'M' ],
25 "Perl mentor",
26 "third cousin",
27 [ "mother-in-law", 'F' ],
28 [ "father-in-law", 'M' ],
29 "tennis partner",
30 "gym spotter",
31 "statistician",
32 "hairdresser",
33 "dungeon master",
34 "priest",
35 "BFF",
36 [ "sugar daddy", 'M' ],
37 "secret lover",
38 [ "great grandmother", 'F' ],
39 "retarded parakeet",
40 "chemistry assistant",
41 "meth cook",
42 "crippled dog",
43 "deaf cat",
44 "PHP advisor",
45 "personal trainer",
46 "neighbor",
47 "lacrosse teammate",
48 "distant Russian relative",
49 "personal cheerleader",
50 "autistic goldfish",
51 "dishwasher",
52 "valet",
53 "caddy",
54 "system administrator",
55 );
56  
57 1 our @Activity = (
58 "photoshopping dicks",
59 "browsing 4chan",
60 "posting memes",
61 "mining scamcoins",
62 "browsing CPAN",
63 "avoiding honest work",
64 "being a fucktard on Tumblr",
65 "smoking weed",
66 "scamming people",
67 "writing to Nigerian princes",
68 "collecting reddit karma",
69 "mocking celebrities",
70 "playing Farm Birds on MyFace+",
71 "IRCing",
72 "answering fetish surveys",
73 "finding version.pm bugs",
74 "blowing cocaine",
75 "swiping Tinder",
76 "posting to stackoverflow",
77 "watching pornography",
78 "measuring midgets",
79 );
80  
81  
82 1 ▶sub make_money_at_home {
Subroutine make_money_at_home: called CC=8 SCAR=24.0
Pod undocumented
83 1 my $activity = $Activity[rand @Activity];
84  
85 1 my @people;
86 1 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
@people == 3 or do { do { my $new_subj = $Acme::MakeMoneyAtHome::Subject[rand @Acme::MakeMoneyAtHome::Subject]; $new_subj = $new_subj->[0] if ref $new_subj and @people < 2; push @people, $new_subj unless grep {$_ eq $new_subj;} @people } } 1 2 3
87 3 my $new_subj = $Subject[rand @Subject];
88 3 ▶ $new_subj = $new_subj->[0] if ref $new_subj and @people < 2;
Branch: 1 branch
BranchTrueFalseTotal
if ref $new_subj and @people < 2 0 3 3
Condition33%1/3
ref $new_subj and @people < 2
!ll&&!rl&&r
300
MC/DC0%0/2
ref $new_subj and @people < 2
ref $new_subj @people < 2
Truth table33%1/3
A and B
A= ref $new_subjB= @people < 2
ABresult
0X0
100
111
89 3 ▶ push @people, $new_subj unless grep {; $_ eq $new_subj } @people;
Branch: 1 branch
BranchTrueFalseTotal
unless grep {$_ eq $new_subj;} @people 3 0 3
90 } until @people == 3;
91  
92 1 my $unemploy = (int rand 36) + 4;
93 1 my $hourly = (int rand 60) + 40;
94 1 my $monthly = (60 * $hourly) + sprintf '%.2f', rand(200);
95  
96 1 my @gender;
97 1 ▶ if (ref $people[2] eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $people[2] eq 'ARRAY') { } 0 1 1
98 0 my ($actual, $mf) = @{ $people[2] };
99 0 $people[2] = $actual;
100 0 ▶ @gender = $mf eq 'M' ? ( 'He', 'his' ) : ( 'She', 'her' );
Branch: 1 branch
BranchTrueFalseTotal
$mf eq 'M' ? : 0 0 0
101 } else {
102 1 ▶ @gender = int rand 2 ? ( 'He', 'his' ) : ( 'She', 'her' );
Branch: 1 branch
BranchTrueFalseTotal
int rand 2 ? : 1 0 1
103 }
104  
105 1 "My $people[0]'s $people[1]'s $people[2] makes \$$hourly an hour on the "
106 ."computer. $gender[0] has been without work for $unemploy months but last "
107 ."month $gender[1] pay was \$$monthly from just $activity "
108 ."a few hours per day."
109 }
110  
111 1 ▶print make_money_at_home."\n" unless caller; 1;
Branch: 1 branch
BranchTrueFalseTotal
unless caller 0 1 1
112  
113  
114 =pod
115  
116 =head1 NAME
117  
118 Acme::MakeMoneyAtHome - I made 17047 dollars just posting Acme dists to CPAN
119  
120 =head1 SYNOPSIS
121  
122 use Acme::MakeMoneyAtHome;
123 print make_money_at_home();
124  
125 =head1 DESCRIPTION
126  
127 Exports the function B<make_money_at_home>, which can tell you how
128 much money your father's gym spotter's autistic goldfish made last month just
129 browsing 4chan a few hours per day.
130  
131 =head1 CONTRIBUTORS
132  
133 Perl-ified and maintained by Jon Portnoy <avenj@cobaltirc.org>
134  
135 This Perl implementation is based on JavaScript written by B<Gilded>, whose
136 real name I'll put here if he ever trusts me enough to tell me.
137  
138 =head1 LICENSE
139  
140 Licensed under the same terms as Perl.
141  
142 =cut
↑ Summary