| 1 | package DMOSS::Plugin; | ||||||||||
| 2 | # ABSTRACT: DMOSS base class for plugins | ||||||||||
| 3 | 3 | $DMOSS::Plugin::VERSION = '0.01_2'; | |||||||||
| 4 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 3 | my @types = (); | |||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 10 | 1 | my ($class) = @_; | |||||||||
| 11 | 1 | my $self = bless({}, $class); | |||||||||
| 12 | |||||||||||
| 13 | 1 | return $self; | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | sub name { | ||||||||
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 17 | 0 | my ($self) = @_; | |||||||||
| 18 | |||||||||||
| 19 | 0 | return(ref $self); | |||||||||
| 20 | } | ||||||||||
| 21 | |||||||||||
| 22 | 0 | ▶ | sub process { print "default process" } | ||||||||
|
Subroutine
process: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub grade { | ||||||||
|
Subroutine
grade: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||
| 25 | 0 | my ($self, $num) = @_; | |||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | return 'F' if $num < 0.1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | ▶ | return 'D' if $num < 0.4; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | 0 | ▶ | return 'C' if $num < 0.6; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | ▶ | return 'B' if $num < 0.8; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | return 'A'; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 0 | ▶ | sub grade_html_box { | ||||||||
|
Subroutine
grade_html_box: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 35 | 0 | my ($self, $grade, $title, $more) = @_; | |||||||||
| 36 | 0 | my $tag = lc $title; | |||||||||
| 37 | 0 | $tag =~ s/\W+/_/g; | |||||||||
| 38 | |||||||||||
| 39 | 0 | my $html = "<div class='grade_box grade_".lc($grade)."'>\b"; | |||||||||
| 40 | 0 | $html .= "<span class='grade'>$grade</span><span class='title'><a href='javascript: show(\"$tag\");'>$title</a></span>\n"; | |||||||||
| 41 | 0 | $html .= "<div style='display: none;' id='$tag' class='grade_box_more'><span class='more'>$more</span></div>"; | |||||||||
| 42 | 0 | $html .= "</div>\n"; | |||||||||
| 43 | |||||||||||
| 44 | 0 | return $html; | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 3 | 1; | |||||||||
| 48 | |||||||||||
| 49 | __END__ | ||||||||||