DMOSS/Plugin.pm

filter: Statementstmt 41.3% 12 / 29 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 42.8% 3 / 7 Podpod 60.0% 3 / 5 totaltotal 36.7% 18 / 49 CC 5 SCAR 26.7
CC
5
Cov
32%
grade
30.0
name
2.0
process
2.0
CRAP 14.5
« DMOSS/Plugin/FunctionIdsDoc.pm ↑ Summary DMOSS/Report.pm »
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
BranchTrueFalseTotal
if $num < "0.1" 0 0 0
28 0 ▶ return 'D' if $num < 0.4;
Branch: 1 branch
BranchTrueFalseTotal
if $num < "0.4" 0 0 0
29 0 ▶ return 'C' if $num < 0.6;
Branch: 1 branch
BranchTrueFalseTotal
if $num < "0.6" 0 0 0
30 0 ▶ return 'B' if $num < 0.8;
Branch: 1 branch
BranchTrueFalseTotal
if $num < "0.8" 0 0 0
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__
« DMOSS/Plugin/FunctionIdsDoc.pm ↑ Summary DMOSS/Report.pm »