lib/Ftree/TextGenerators/EnglishTextGenerator.pm

filter: Statementstmt 71.7% 28 / 39 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 64.2% 9 / 14 Podpod n/a totaltotal 69.0% 38 / 55 CC 2 SCAR 3.9
CC
2
Cov
71%
maintainer
2.0
summary
2.0
People_with_surname
2.0
CRAP 1.5
« lib/Ftree/TextGeneratorFactory.pm ↑ Summary lib/Ftree/Date/Tiny.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3
4 package EnglishTextGenerator;
5 1 ▶use version; our $VERSION = qv('2.3.41');
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
7 1 my ( $classname ) = @_;
8 1 my $self = {
9 Prayer_for_the_living => "Prayer_for_the_living",
10 Prayer_for_the_departed => "Prayer_for_the_departed",
11 members => "Family tree members",
12 Relatives => "Relatives",
13 Faces => "Faces",
14 Surnames =>"Surnames",
15 Homepages => "Homepages",
16 homepage => "homepage",
17 Birthdays => "Birthdays",
18 birthday => "birthday",
19 Error => "Error",
20 Sorry => "Sorry",
21 Passwd_need => "You must provide a password to see these pages.",
22 Wrong_passwd => "You have given the wrong password for these pages.",
23
24 father => "father",
25 mother => "mother",
26 nickname => "nickname",
27 place_of_birth => "place of birth",
28 place_of_death =>"place of death",
29 cemetery => "cemetery",
30 schools => "schools",
31 jobs => "jobs",
32 work_places => "work places",
33 places_of_living => "places of living",
34 general => "general",
35
36 siblings => "siblings",
37 siblings_on_father => "half siblings from father side",
38 siblings_on_mother => "half siblings from mother side",
39 children => "children",
40 husbands => "husbands",
41 wives => "wives",
42
43 date_of_birth => "date of birth",
44 date_of_death => "date of death",
45 Total => "Total",
46 people => "people",
47 Emails => "Emails",
48 email => "email",
49 Hall_of_faces => "Hall of faces",
50 Total_with_email => "Total number of people with email address: ",
51 Total_with_homepage => "Total number of people with home page: ",
52 Total_with_photo => "Total number of people with photo: ",
53 months_array => [ "January", "February", "March", "April", "May", "June",
54 "July", "August", "September", "October", "November", "December"],
55 Invalid_option => "Invalid type parameter",
56 Valid_options => "Valid options are <none>, snames, faces, emails, hpages, bdays.",
57 ZoomIn => "Zoom in",
58 ZoomOut => "Zoom out",
59 CheckAnotherMonth => "Check another month",
60 DonationSentence => "The family tree software is absolutely free. Nevertheless to keep it alive donations are needed.",
61 Go => "Go",
62 Unknown => "Unknown",
63 name => "name",
64 photo => "photo",
65 man => "man",
66 woman => "woman",
67 unknown => "unknown",
68
69 hungarian => "hungarian",
70 polish => "polish",
71 english => "english",
72 german => "german",
73 spanish => "spanish",
74 italian => "italian",
75 french => "french",
76 slovenian => "slovenian",
77 romanian => "romanian",
78 russian => "russian",
79 japanese => "japanese",
80 chinese => "chinese",
81 };
82 1 return bless $self, $classname;
83 }
84
85 0 ▶sub summary{
Subroutine summary: not called CC=1 SCAR=6.9
86 0 my ($self, $nr_people) = @_;
87 0 return "Total: $nr_people people \n";
88 }
89 1 ▶sub maintainer {
Subroutine maintainer: called CC=2 SCAR=7.1
90 1 my ($self, $admin_name, $admin_email, $admin_webpage) = @_;
91 1 my $text;
92 1 $text = "Family data maintained by";
93 1 ▶ if(defined $admin_webpage) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $admin_webpage) { } 1 0 1
94 1 $text .= "<a href=\"".$admin_webpage."\" target=\"_new\">".$admin_name."</a>";
95 }
96 else{
97 0 $text .= $admin_name;
98 }
99 1 $text .= "- please <a href=\"mailto:$admin_email\">email</a> any omissions or corrections.";
100 }
101 1 ▶sub software {
Subroutine software: called CC=1 SCAR=0.0
102 1 my ($self, $version) = @_;
103 1 return "Family tree software (ver. $version) by <a href=\"http://www.cs.bme.hu/~bodon/en/index.html\" target=\"_new\">Ferenc Bodon</a> and ".
104 "<a href=\"http://simonward.com/\" target=\"_new\">Simon Ward</a> and
105 <a href=\"http://mishin.narod.ru/\" target=\"_new\">Nikolay Mishin</a>
106 - <a href=\"http://freshmeat.net/projects/familytree_cgi/\">details</a>.\n";
107 }
108 0 ▶sub People_with_surname {
Subroutine People_with_surname: not called CC=1 SCAR=6.9
109 0 my ($self, $surname) = @_;
110 0 return "People with surname ".$surname;
111 }
112 0 ▶sub noDataAbout {
Subroutine noDataAbout: not called CC=1 SCAR=6.9
113 0 my ($self, $id) = @_;
114 0 return "ERROR: No entry found for $id";
115 }
116 1 ▶sub familyTreeFor {
Subroutine familyTreeFor: called CC=1 SCAR=0.0
117 1 my ($self, $name) = @_;
118 1 return "Family tree for $name";
119 }
120 1 ▶sub ZoomIn {
Subroutine ZoomIn: called CC=1 SCAR=0.0
121 1 my ($self, $level) = @_;
122 1 return "Zoom in: show no more than $level generations.";
123 }
124 1 ▶sub ZoomOut {
Subroutine ZoomOut: called CC=1 SCAR=0.0
125 1 my ($self, $level) = @_;
126 1 return "Zoom out: show up to $level generations above and below.";
127 }
128 0 ▶sub birthday_reminder {
Subroutine birthday_reminder: not called CC=1 SCAR=6.9
129 0 my ($self, $month_index) = @_;
130 0 return "Birthday reminders for ".$self->{months_array}[$month_index];
131 }
132
133 0 ▶sub total_living_with_birthday {
Subroutine total_living_with_birthday: not called CC=1 SCAR=6.9
134 0 my ($self, $month_index) = @_;
135 0 return "Total number of living people with birthday in ".$self->{months_array}[$month_index].": ";
136 }
137
138 1 1;
« lib/Ftree/TextGeneratorFactory.pm ↑ Summary lib/Ftree/Date/Tiny.pm »