blib/lib/Acme/MakeMoneyAtHome.pm

filter: Statementstmt 87.5% 28 / 32 Branchbran 50.0% 6 / 12 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 72.2% 39 / 54 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.002002';
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 );
53  
54 1 our @Activity = (
55 "photoshopping dicks",
56 "browsing 4chan",
57 "posting memes",
58 "mining scamcoins",
59 "browsing CPAN",
60 "avoiding honest work",
61 "being a fucktard on Tumblr",
62 "smoking weed",
63 "scamming people",
64 "writing to Nigerian princes",
65 "collecting reddit karma",
66 "mocking celebrities",
67 "playing Farm Birds on MyFace+",
68 "IRCing",
69 "answering fetish surveys",
70 );
71  
72  
73 sub make_money_at_home {
74 1 ▶ my $activity = $Activity[rand @Activity];
Subroutine make_money_at_home: called CC=8 SCAR=24.0
Pod undocumented
75  
76 1 my @people;
77 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 < 3; push @people, $new_subj unless grep {$_ eq $new_subj;} @people } } 2 1 3
78 3 my $new_subj = $Subject[rand @Subject];
79 3 ▶ $new_subj = $new_subj->[0] if ref $new_subj and @people < 3;
Branch: 1 branch
BranchTrueFalseTotal
if ref $new_subj and @people < 3 0 3 3
Condition33%1/3
ref $new_subj and @people < 3
!ll&&!rl&&r
300
MC/DC0%0/2
ref $new_subj and @people < 3
ref $new_subj @people < 3
Truth table33%1/3
A and B
A= ref $new_subjB= @people < 3
ABresult
0X0
100
111
80 3 ▶ push @people, $new_subj unless grep {; $_ eq $new_subj } @people
Branch: 1 branch
BranchTrueFalseTotal
unless grep {$_ eq $new_subj;} @people 3 0 3
81 } until @people == 3;
82  
83 1 my $unemploy = (int rand 36) + 4;
84 1 my $hourly = (int rand 60) + 40;
85 1 my $monthly = (int rand 10_000) + 10_000;
86  
87 1 my @gender;
88 1 ▶ if (ref $people[2] eq 'ARRAY') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $people[2] eq 'ARRAY') { } 0 1 1
89 0 my ($actual, $mf) = @{ $people[2] };
90 0 $people[2] = $actual;
91 0 ▶ @gender = $mf eq 'M' ? ( 'He', 'his' ) : ( 'She', 'her' );
Branch: 1 branch
BranchTrueFalseTotal
$mf eq 'M' ? : 0 0 0
92 } else {
93 1 ▶ @gender = int rand 2 ? ( 'He', 'his' ) : ( 'She', 'her' );
Branch: 1 branch
BranchTrueFalseTotal
int rand 2 ? : 1 0 1
94 }
95  
96 1 "My $people[0]'s $people[1]'s $people[2] makes \$$hourly an hour on the "
97 ."computer. $gender[0] has been without work for $unemploy months but last "
98 ."month $gender[1] pay was \$$monthly from just $activity "
99 ."a few hours per day."
100 }
101  
102 1 1;
103  
104  
105 =pod
106  
107 =head1 NAME
108  
109 Acme::MakeMoneyAtHome - I made 17047 dollars just posting Acme dists to CPAN
110  
111 =head1 SYNOPSIS
112  
113 use Acme::MakeMoneyAtHome;
114 print make_money_at_home();
115  
116 =head1 DESCRIPTION
117  
118 Exports the function B<make_money_at_home>, which can tell you how
119 much money your father's gym spotter's autistic goldfish made last month just
120 browsing 4chan a few hours per day.
121  
122 =head1 CONTRIBUTORS
123  
124 Perl-ified and maintained by Jon Portnoy <avenj@cobaltirc.org>
125  
126 This Perl implementation is based on JavaScript written by B<Gilded>, whose
127 real name I'll put here if he ever trusts me enough to tell me.
128  
129 =head1 LICENSE
130  
131 Licensed under the same terms as Perl.
132  
133 =cut
↑ Summary