| 1 | package Date::Holidays::PF; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Time::Local; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Date::Easter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use Exporter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | our @EXPORT = qw(is_pf_holiday get_easter get_ascension get_pentecost get_vendredisaint get_lundipaques); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 1 | our $VERSION = '0.03'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 33 | ▶ | sub get_easter { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_easter: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 33 | my ($year) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 33 | return Date::Easter::easter($year); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | sub get_ascension { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_ascension: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | my ($year) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | return _compute_date_from_easter($year, 39); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | sub get_pentecost { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_pentecost: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | my ($year) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | return _compute_date_from_easter($year, 50); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | sub get_vendredisaint { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_vendredisaint: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | my ($year) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | return _compute_date_from_easter($year, -2); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | sub get_lundipaques { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_lundipaques: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | my ($year) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | return _compute_date_from_easter($year, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 26 | ▶ | sub _compute_date_from_easter { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_compute_date_from_easter: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 26 | my ($year, $delta) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 26 | my ($easter_month, $easter_day) = get_easter($year); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 26 | my $easter_date = Time::Local::timelocal(0, 0, 1, $easter_day, $easter_month - 1, $year - 1900); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 26 | my ($date_month, $date_day) = (localtime($easter_date + $delta * 86400))[4, 3]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 26 | $date_month++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 26 | return ($date_month, $date_day); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 14 | ▶ | sub is_pf_holiday { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_pf_holiday: called CC=31 SCAR=37.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 14 | my ($year, $month, $day) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 14 | ▶ | if ($day == 1 and $month == 1) { return "Nouvel an"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 10 branches
Condition100%3/3
$day == 1 and $month == 1
MC/DC100%2/2
$day == 1 and $month == 1
$day == 1
$month == 1
Truth table100%3/3
A and B
A= $day == 1B= $month == 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | ▶ | elsif ($day == 5 and $month == 3) { return "Arrivé de l'évangile"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$day == 5 and $month == 3
MC/DC0%0/2
$day == 5 and $month == 3
$day == 5
$month == 3
Truth table33%1/3
A and B
A= $day == 5B= $month == 3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 1 | ▶ | elsif ($day == 1 and $month == 5) { return "Fête du travail"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$day == 1 and $month == 5
MC/DC100%2/2
$day == 1 and $month == 5
$day == 1
$month == 5
Truth table100%3/3
A and B
A= $day == 1B= $month == 5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 1 | ▶ | elsif ($day == 8 and $month == 5) { return "Armistice 39-45"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$day == 8 and $month == 5
MC/DC50%1/2
$day == 8 and $month == 5
$day == 8
$month == 5
Truth table66%2/3
A and B
A= $day == 8B= $month == 5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | elsif ($day == 29 and $month == 6) { return "Fête de l'autonomie"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$day == 29 and $month == 6
MC/DC0%0/2
$day == 29 and $month == 6
$day == 29
$month == 6
Truth table33%1/3
A and B
A= $day == 29B= $month == 6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 1 | ▶ | elsif ($day == 14 and $month == 7) { return "Fête nationale"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$day == 14 and $month == 7
MC/DC50%1/2
$day == 14 and $month == 7
$day == 14
$month == 7
Truth table66%2/3
A and B
A= $day == 14B= $month == 7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 1 | ▶ | elsif ($day == 15 and $month == 8) { return "Assomption"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$day == 15 and $month == 8
MC/DC50%1/2
$day == 15 and $month == 8
$day == 15
$month == 8
Truth table66%2/3
A and B
A= $day == 15B= $month == 8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 1 | ▶ | elsif ($day == 1 and $month == 11) { return "Toussaint"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$day == 1 and $month == 11
MC/DC50%1/2
$day == 1 and $month == 11
$day == 1
$month == 11
Truth table66%2/3
A and B
A= $day == 1B= $month == 11
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 1 | ▶ | elsif ($day == 11 and $month == 11) { return "Armistice 14-18"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$day == 11 and $month == 11
MC/DC100%2/2
$day == 11 and $month == 11
$day == 11
$month == 11
Truth table100%3/3
A and B
A= $day == 11B= $month == 11
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | ▶ | elsif ($day == 25 and $month == 12) { return "Noël"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$day == 25 and $month == 12
MC/DC50%1/2
$day == 25 and $month == 12
$day == 25
$month == 12
Truth table66%2/3
A and B
A= $day == 25B= $month == 12
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 6 | my ($easter_month, $easter_day) = get_easter($year); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 6 | my ($vendredisaint_month, $vendredisaint_day) = _compute_date_from_easter($year, -2); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 6 | my ($lundipaques_month, $lundipaques_day) = _compute_date_from_easter($year, 1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 6 | my ($ascension_month, $ascension_day) = _compute_date_from_easter($year, 39); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 6 | my ($pentecost_month, $pentecost_day) = _compute_date_from_easter($year, 50); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | if ($day == $easter_day and $month == $easter_month) { return "Pâques"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
Condition66%2/3
$day == $easter_day and $month == $easter_month
MC/DC0%0/2
$day == $easter_day and $month == $easter_month
$day == $easter_day
$month == $easter_month
Truth table66%2/3
A and B
A= $day == $easter_dayB= $month == $easter_month
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 1 | ▶ | elsif ($day == $lundipaques_day and $month == $lundipaques_month) { return "Lundi de pâques"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$day == $lundipaques_day and $month == $lundipaques_month
MC/DC50%1/2
$day == $lundipaques_day and $month == $lundipaques_month
$day == $lundipaques_day
$month == $lundipaques_month
Truth table66%2/3
A and B
A= $day == $lundipaques_dayB= $month == $lundipaques_month
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | elsif ($day == $vendredisaint_day and $month == $vendredisaint_month) { return "Vendredi saint"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$day == $vendredisaint_day and $month == $vendredisaint_month
MC/DC0%0/2
$day == $vendredisaint_day and $month == $vendredisaint_month
$day == $vendredisaint_day
$month == $vendredisaint_month
Truth table33%1/3
A and B
A= $day == $vendredisaint_dayB= $month == $vendredisaint_month
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 1 | ▶ | elsif ($day == $ascension_day and $month == $ascension_month) { return "Ascension"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$day == $ascension_day and $month == $ascension_month
MC/DC50%1/2
$day == $ascension_day and $month == $ascension_month
$day == $ascension_day
$month == $ascension_month
Truth table66%2/3
A and B
A= $day == $ascension_dayB= $month == $ascension_month
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 1 | ▶ | elsif ($day == $pentecost_day and $month == $pentecost_month) { return "Lundi de Pentecôte"; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$day == $pentecost_day and $month == $pentecost_month
MC/DC50%1/2
$day == $pentecost_day and $month == $pentecost_month
$day == $pentecost_day
$month == $pentecost_month
Truth table66%2/3
A and B
A= $day == $pentecost_dayB= $month == $pentecost_month
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||