File Coverage

blib/lib/DMOSS/Plugin.pm
Criterion Covered Total %
statement 9 26 34.6
branch 0 8 0.0
condition n/a
subroutine 3 7 42.8
pod 3 5 60.0
total 15 46 32.6


line stmt bran cond sub pod time code
1             package DMOSS::Plugin;
2             # ABSTRACT: DMOSS base class for plugins
3             $DMOSS::Plugin::VERSION = '0.01_2';
4 3     3   28092 use strict;
  3         7  
  3         118  
5 3     3   18 use warnings;
  3         6  
  3         1055  
6              
7             my @types = ();
8              
9             sub new {
10 1     1 0 573 my ($class) = @_;
11 1         8 my $self = bless({}, $class);
12              
13 1         5 return $self;
14             }
15              
16             sub name {
17 0     0 1   my ($self) = @_;
18              
19 0           return(ref $self);
20             }
21              
22 0     0 1   sub process { print "default process" }
23              
24             sub grade {
25 0     0 1   my ($self, $num) = @_;
26            
27 0 0         return 'F' if $num < 0.1;
28 0 0         return 'D' if $num < 0.4;
29 0 0         return 'C' if $num < 0.6;
30 0 0         return 'B' if $num < 0.8;
31 0           return 'A';
32             }
33              
34             sub grade_html_box {
35 0     0 0   my ($self, $grade, $title, $more) = @_;
36 0           my $tag = lc $title;
37 0           $tag =~ s/\W+/_/g;
38              
39 0           my $html = "
\b";
40 0           $html .= "$grade$title\n";
41 0           $html .= "";
42 0           $html .= "\n";
43              
44 0           return $html;
45             }
46              
47             1;
48              
49             __END__