DSM/HTML.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 28 / 28 CC 2 SCAR 2.9
CC
2
Cov
100%
_init
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« DSM.pm ↑ Summary
1 package Graph::Writer::DSM::HTML;
2 1 $Graph::Writer::DSM::HTML::VERSION = '0.008';
3 1 ▶use Modern::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use base qw( Graph::Writer );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Mojo::Template;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 local $/ = undef;
8 1 our $TEMPLATE = <DATA>;
9  
10 =head1 NAME
11  
12 Graph::Writer::DSM::HTML - draw graph as a DSM matrix in HTML format
13  
14 =head1 VERSION
15  
16 version 0.008
17  
18 =head1 DESCRIPTION
19  
20 See L<Graph::Writer::DSM>.
21  
22 =head1 SYNOPSIS
23  
24 See L<Graph::Writer::DSM>.
25  
26 =head1 METHODS
27  
28 =head1 new()
29  
30 Like L<Graph::Writer::DSM>, this module provide some extra parameters
31 to new() method.
32  
33 Supported parameters are:
34  
35 =over 4
36  
37 =item title
38  
39 The title of HTML page. Default: 'Design Structure Matrix'.
40  
41 =back
42  
43 =cut
44  
45 5 ▶sub _init {
Subroutine _init: called CC=2 SCAR=6.9
46 5 my ($self, %param) = @_;
47 5 $self->SUPER::_init();
48 5 ▶ $self->{title} = $param{title} // 'Design Structure Matrix';
Condition100%2/2
$param{"title"} // "Design Structure Matrix"
l!l
14
MC/DC100%1/1
$param{"title"} // "Design Structure Matrix"
$param{"title"}
Truth table100%2/2
A
A= $param{"title"}
Aresult
11
00
49 }
50  
51 =head1 write_graph()
52  
53 See L<Graph::Writer::DSM>.
54  
55 =cut
56  
57 4 ▶sub _write_graph {
Subroutine _write_graph: called CC=1 SCAR=0.0
58 4 my ($self, $graph, $FILE) = @_;
59 4 my $template = Mojo::Template->new;
60 4 my $output = $template->render($TEMPLATE, $graph, $self->{title});
61 4 print $FILE $output;
62 }
63  
64 1 1;
65  
66 =head1 SEE ALSO
67  
68 L<Graph>, L<Graph::Writer>, L<Chart::Gnuplot>.
69  
70 =head1 CREDITS
71  
72 Antonio Terceiro <terceiro AT softwarelivre.org>
73  
74 =head1 COPYRIGHT
75  
76 Copyright (c) 2013, Joenio Costa
77  
78 =cut
79  
80 __DATA__
« DSM.pm ↑ Summary