annotate build-aux/pmccabe2html @ 12492:fb3e3c38ef7a

Reorder file list.
author Bruno Haible <bruno@clisp.org>
date Thu, 24 Dec 2009 18:12:39 +0100
parents 53f63bc326f3
children cf6ad3a90b8b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12252
53f63bc326f3 build-aux/pmccabe2html: Drop #! header. Doc fix.
Simon Josefsson <simon@josefsson.org>
parents: 12251
diff changeset
1 # pmccabe2html - AWK script to convert pmccabe output to html
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
2
12223
2f9579cbb962 pmccabe2html: Don't hard code awk path.
Simon Josefsson <simon@josefsson.org>
parents: 10768
diff changeset
3 # Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
4
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
5 # This program is free software: you can redistribute it and/or modify
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
6 # it under the terms of the GNU General Public License as published by
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
7 # the Free Software Foundation, either version 3 of the License, or
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
8 # (at your option) any later version.
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
9 #
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
10 # This program is distributed in the hope that it will be useful,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
13 # GNU General Public License for more details.
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
14 #
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
17
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
18 # Written by Jose E. Marchesi <jemarch@gnu.org>.
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
19 # Adapted for gnulib by Simon Josefsson <simon@josefsson.org>.
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
20 # Added support for C++ by Giuseppe Scrivano <gscrivano@gnu.org>.
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
21
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
22 # Typical Invocation is from a Makefile.am:
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
23 #
12252
53f63bc326f3 build-aux/pmccabe2html: Drop #! header. Doc fix.
Simon Josefsson <simon@josefsson.org>
parents: 12251
diff changeset
24 # cyclo-$(PACKAGE).html:
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
25 # $(PMCCABE) ${top_srcdir}/lib/*.[ch] \
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
26 # | sort -nr \
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
27 # | $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
28 # -v lang=html -v name="$(PACKAGE_NAME)" \
12252
53f63bc326f3 build-aux/pmccabe2html: Drop #! header. Doc fix.
Simon Josefsson <simon@josefsson.org>
parents: 12251
diff changeset
29 # -v vcurl="http://git.savannah.gnu.org/gitweb/?p=$(PACKAGE).git;a=blob;f=%FILENAME%;hb=HEAD" \
53f63bc326f3 build-aux/pmccabe2html: Drop #! header. Doc fix.
Simon Josefsson <simon@josefsson.org>
parents: 12251
diff changeset
30 # -v url="http://www.gnu.org/software/$(PACKAGE)/" \
12251
6dd2245a1963 build-aux/pmccabe2html: Disable execute bit. Improve example usage.
Simon Josefsson <simon@josefsson.org>
parents: 12223
diff changeset
31 # -v css=${top_srcdir}/build-aux/pmccabe.css \
12252
53f63bc326f3 build-aux/pmccabe2html: Drop #! header. Doc fix.
Simon Josefsson <simon@josefsson.org>
parents: 12251
diff changeset
32 # > $@-tmp
53f63bc326f3 build-aux/pmccabe2html: Drop #! header. Doc fix.
Simon Josefsson <simon@josefsson.org>
parents: 12251
diff changeset
33 # mv $@-tmp $@
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
34 #
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
35 # The variables available are:
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
36 # lang output language, either 'html' or 'wiki'
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
37 # name project name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
38 # url link to project's home page
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
39 # vcurl URL to version controlled source code browser,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
40 # a %FILENAME% in the string is replaced with the relative
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
41 # source filename
10637
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
42 # css CSS stylesheet filename, included verbatim in HTML output
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
43 # css_url link to CSS stylesheet, an URL
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
44
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
45 # Prologue & configuration
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
46 BEGIN {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
47 section_global_stats_p = 1
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
48 section_function_cyclo_p = 1
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
49
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
50 # "html" or "wiki"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
51 package_name = name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
52 output_lang = lang
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
53
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
54 # General Options
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
55 cyclo_simple_max = 10
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
56 cyclo_moderate_max = 20
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
57 cyclo_high_max = 50
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
58 cut_dir = "/../"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
59 source_file_link_tmpl = vcurl
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
60
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
61 # HTML options
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
62 if (url != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
63 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
64 html_prolog = "<a href=\"" url "\">Back to " package_name " Homepage</a><br/><br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
65 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
66 html_epilog = "<hr color=\"black\" size=\"2\"/> \
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
67 Copyright (c) 2007, 2008 Free Software Foundation Inc."
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
68 html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
69 \"http://www.w3.org/TR/html401/loose.dtd\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
70 html_comment = "<!-- Generated by gnulib's pmccabe2html at " systime() " -->"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
71 html_title = "Cyclomatic Complexity report for " package_name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
72
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
73 # Wiki options
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
74 wiki_prolog = "{{Note|This page has been automatically generated}}"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
75 wiki_epilog = ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
76
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
77 # Internal variables
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
78 nfuncs = 0;
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
79 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
80
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
81 # Functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
82
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
83 function build_stats()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
84 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
85 # Maximum modified cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
86 for (fcn in mcyclo)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
87 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
88 num_of_functions++
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
89 if (mcyclo[fcn] > max_mcyclo)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
90 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
91 max_mcyclo = mcyclo[fcn]
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
92 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
93
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
94 if (mcyclo[fcn] > cyclo_high_max)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
95 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
96 num_of_untestable_functions++
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
97 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
98 else if (mcyclo[fcn] > cyclo_moderate_max)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
99 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
100 num_of_high_functions++
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
101 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
102 else if (mcyclo[fcn] > cyclo_simple_max)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
103 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
104 num_of_moderate_functions++
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
105 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
106 else
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
107 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
108 num_of_simple_functions++
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
109 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
110 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
111 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
112
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
113 function html_fnc_table_complete (caption)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
114 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
115 html_fnc_table(caption, 1, 0, 1, 1, 1, 0, 1)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
116 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
117
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
118 function html_fnc_table_abbrev (caption)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
119 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
120 html_fnc_table(caption, 1, 0, 1, 0, 1, 0, 0)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
121 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
122
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
123
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
124 function html_fnc_table (caption,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
125 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
126 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
127 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
128 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
129 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
130 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
131 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
132 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
133 print "<table width=\"90%\" class=\"function_table\" cellpadding=\"0\" cellspacing=\"0\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
134 if (caption != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
135 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
136 print "<caption class=\"function_table_caption\">" caption "</caption>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
137 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
138 html_fnc_header(fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
139 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
140 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
141 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
142 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
143 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
144 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
145 for (nfnc = 1; nfnc < nfuncs; nfnc++)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
146 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
147 html_fnc(nfnc,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
148 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
149 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
150 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
151 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
152 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
153 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
154 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
155 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
156 print "</table>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
157 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
158
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
159 function html_header ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
160 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
161 print html_doctype
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
162 print "<html>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
163 print html_comment
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
164 print "<head>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
165 print "<title>" html_title "</title>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
166 print ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
167 print "<meta name=\"description\" content=\"" html_title "\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
168 print "<meta name=\"keywords\" content=\"" html_title "\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
169 print "<meta name=\"resource-type\" content=\"document\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
170 print "<meta name=\"distribution\" content=\"global\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
171 print "<meta name=\"Generator\" content=\"pmccabe2html\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
172 print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
173 print "<script language=\"javascript\" type=\"text/javascript\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
174 print "function show_hide(idCapa, idButton, fuerzaVisibilidad)\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
175 {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
176 var button = document.getElementById(idButton);\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
177 var capa = document.getElementById(idCapa);\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
178 if (capa)\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
179 {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
180 if (fuerzaVisibilidad && fuerzaVisibilidad!=\"\") {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
181 if (fuerzaVisibilidad==\"visible\") capa.style.display=\"\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
182 else capa.style.display=\"none\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
183 }\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
184 else\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
185 {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
186 if (capa.style.display == \"none\") {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
187 capa.style.display = \"\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
188 button.innerHTML = \"&uarr;\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
189 } else {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
190 capa.style.display = \"none\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
191 button.innerHTML = \"&darr;\"; \
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
192 }\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
193 }\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
194 }\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
195 }"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
196 print "</script>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
197
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
198
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
199 if (css_url != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
200 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
201 print "<link rel=\"stylesheet\" href=\"" css_url "\" type =\"text/css\" media=\"screen\"/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
202 }
10637
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
203 if (css != "")
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
204 {
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
205 print "<style type =\"text/css\" media=\"screen\">"
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
206 print "<!--"
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
207 while ((getline cssline < css) > 0)
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
208 {
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
209 print cssline
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
210 }
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
211 print "-->"
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
212 print "</style />"
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
213 close(css)
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
214 }
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
215 print "</head>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
216 print "<body lang=\"en\" bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" \
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
217 vlink=\"#800080\" alink=\"#FF0000\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
218 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
219
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
220 function html_footer ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
221 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
222 print "</body>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
223 print "</html>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
224 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
225
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
226 function html_fnc_header (fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
227 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
228 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
229 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
230 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
231 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
232 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
233 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
234 print "<tr class=\"function_table_header\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
235 if (fname_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
236 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
237 # Function name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
238 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
239 print ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
240 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
241
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
242 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
243 print "Function Name"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
244 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
245 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
246 if (mcyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
247 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
248 # Modified cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
249 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
250 print "Modified Cyclo"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
251 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
252 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
253 if (cyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
254 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
255 # Cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
256 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
257 print "Cyclomatic"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
258 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
259 print "Complexity"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
260 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
261 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
262 if (num_statements_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
263 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
264 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
265 print "Number of"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
266 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
267 print "Statements"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
268 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
269 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
270 if (num_lines_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
271 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
272 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
273 print "Number of"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
274 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
275 print "Lines"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
276 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
277 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
278 if (first_line_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
279 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
280 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
281 print "First Line"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
282 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
283 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
284 if (file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
285 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
286 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
287 print "Source File"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
288 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
289
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
290 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
291 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
292 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
293
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
294 function html_fnc (nfun,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
295 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
296 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
297 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
298 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
299 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
300 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
301 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
302 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
303 fname = fnames[nfun]
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
304
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
305 # Function name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
306 trclass = "function_entry_simple"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
307 if (mcyclo[nfun] > cyclo_high_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
308 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
309 trclass="function_entry_untestable"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
310 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
311 else if (mcyclo[nfun] > cyclo_moderate_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
312 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
313 trclass="function_entry_high"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
314 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
315 else if (mcyclo[nfun] > cyclo_simple_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
316 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
317 trclass="function_entry_moderate"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
318 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
319
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
320 print "<tr class=\"" trclass "\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
321 if (fname_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
322 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
323 print "<td class=\"function_entry_filename\">"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
324 if (file_p && mcyclo[nfun] > cyclo_simple_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
325 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
326 print "<a href=\"javascript:void(0);\" title=\"show/hide function source\" onClick=\"javascript:show_hide('" fname "_src', '" fname "_button')\">\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
327 <span id=\"" fname "_button\">&darr;</span></a>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
328 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
329 else
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
330 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
331 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
332 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
333 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
334
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
335 print "<td class=\"function_entry_name\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
336 print fname
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
337 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
338 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
339 if (mcyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
340 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
341 # Modified cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
342 print "<td class=\"function_entry_cyclo\">"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
343 print mcyclo[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
344 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
345 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
346 if (cyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
347 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
348 # Cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
349 print "<td class=\"function_entry_cyclo\">"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
350 print cyclo[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
351 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
352 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
353 if (num_statements_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
354 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
355 # Number of statements
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
356 print "<td class=\"function_entry_number\">"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
357 print num_statements[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
358 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
359 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
360 if (num_lines_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
361 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
362 # Number of lines
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
363 print "<td class=\"function_entry_number\">"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
364 print num_lines[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
365 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
366 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
367 if (first_line_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
368 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
369 # First line
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
370 print "<td class=\"function_entry_number\">"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
371 print first_line[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
372 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
373 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
374 if (file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
375 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
376 href = ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
377 if (source_file_link_tmpl != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
378 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
379 # Get href target
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
380 href = source_file_link_tmpl
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
381 sub(/%FILENAME%/, file[nfun], href)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
382 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
383
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
384 # Source file
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
385 print "<td class=\"function_entry_filename\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
386 if (href != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
387 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
388 print "<a href=\"" href "\">" file[nfun] "</a>"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
389 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
390 else
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
391 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
392 print file[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
393 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
394
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
395 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
396
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
397
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
398 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
399
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
400 if (mcyclo[nfun] > cyclo_simple_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
401 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
402 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
403
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
404 num_columns = 1;
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
405 if (fname_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
406 if (mcyclo_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
407 if (cyclo_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
408 if (num_statements_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
409 if (num_lines_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
410 if (first_line_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
411 if (file_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
412
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
413 print "<td colspan=\"" num_columns "\" height=\"0\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
414 print "<div id=\"" fname "_src\" class=\"function_src\" style=\"position: relative; display: none;\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
415 print "<pre class=\"function_src\">"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
416
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
417 while ((getline codeline < (fname nfun "_fn.txt")) > 0)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
418 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
419 sub(/\\</, "&lt;", codeline)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
420 sub(/\\>/, "&gt;", codeline)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
421 sub(/&/, "&amp;", codeline)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
422
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
423 print codeline
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
424 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
425 close(fname nfun "_fn.txt")
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
426 system("rm " fname nfun "_fn.txt")
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
427 print "</pre>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
428 print "</div>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
429 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
430 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
431 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
432
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
433 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
434 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
435
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
436 function html_global_stats ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
437 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
438 print "<div class=\"section_title\">Resume</div>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
439
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
440 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
441 print "<table class=\"resume_table\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
442 # Total number of functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
443 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
444 print "<td class=\"resume_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
445 print "Total number of functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
446 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
447 print "<td class=\"resume_number_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
448 print num_of_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
449 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
450 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
451 # Number of simple functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
452 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
453 print "<td class=\"resume_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
454 print "Number of low risk functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
455 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
456 print "<td class=\"resume_number_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
457 print num_of_simple_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
458 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
459 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
460 # Number of moderate functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
461 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
462 print "<td class=\"resume_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
463 print "Number of moderate risk functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
464 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
465 print "<td class=\"resume_number_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
466 print num_of_moderate_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
467 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
468 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
469 # Number of high functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
470 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
471 print "<td class=\"resume_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
472 print "Number of high risk functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
473 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
474 print "<td class=\"resume_number_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
475 print num_of_high_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
476 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
477 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
478 # Number of untestable functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
479 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
480 print "<td class=\"resume_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
481 print "Number of untestable functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
482 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
483 print "<td class=\"resume_number_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
484 print num_of_untestable_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
485 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
486 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
487 print "</table>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
488 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
489 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
490
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
491 function html_function_cyclo ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
492 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
493 print "<div class=\"section_title\">Details for all functions</div>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
494 print "<p>Used ranges:</p>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
495
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
496 print "<table class=\"ranges_table\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
497 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
498 print "<td class=\"ranges_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
499 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
500 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
501 print "<td class=\"ranges_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
502 print "Cyclomatic Complexity"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
503 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
504 print "<td class=\"ranges_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
505 print "Risk Evaluation"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
506 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
507 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
508 # Simple
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
509 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
510 print "<td class=\"ranges_entry_simple\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
511 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
512 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
513 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
514 print "0 - " cyclo_simple_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
515 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
516 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
517 print "Simple module, without much risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
518 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
519 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
520 # Moderate
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
521 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
522 print "<td class=\"ranges_entry_moderate\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
523 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
524 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
525 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
526 print cyclo_simple_max + 1 " - " cyclo_moderate_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
527 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
528 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
529 print "More complex module, moderate risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
530 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
531 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
532 # High
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
533 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
534 print "<td class=\"ranges_entry_high\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
535 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
536 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
537 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
538 print cyclo_moderate_max + 1 " - " cyclo_high_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
539 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
540 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
541 print "Complex module, high risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
542 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
543 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
544 # Untestable
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
545 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
546 print "<td class=\"ranges_entry_untestable\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
547 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
548 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
549 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
550 print "greater than " cyclo_high_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
551 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
552 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
553 print "Untestable module, very high risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
554 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
555 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
556 print "</table>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
557 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
558 html_fnc_table_complete("")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
559 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
560
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
561 function wiki_global_stats ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
562 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
563 print "{| class=\"cyclo_resume_table\""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
564 # Total number of functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
565 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
566 print "| class=\"cyclo_resume_header_entry\" | Total number of functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
567 print "| class=\"cyclo_resume_number_entry\" |" num_of_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
568 # Number of simple functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
569 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
570 print "| class=\"cyclo_resume_header_entry\" | Number of low risk functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
571 print "| class=\"cyclo_resume_number_entry\" |" num_of_simple_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
572 # Number of moderate functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
573 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
574 print "| class=\"cyclo_resume_header_entry\" | Number of moderate risk functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
575 print "| class=\"cyclo_resume_number_entry\" |" num_of_moderate_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
576 # Number of high functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
577 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
578 print "| class=\"cyclo_resume_header_entry\" | Number of high risk functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
579 print "| class=\"cyclo_resume_number_entry\" |" num_of_high_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
580 # Number of untestable functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
581 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
582 print "| class=\"cyclo_resume_header_entry\" | Number of untestable functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
583 print "| class=\"cyclo_resume_number_entry\" |" num_of_untestable_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
584 print "|}"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
585 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
586
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
587 function wiki_function_cyclo ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
588 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
589 print "==Details for all functions=="
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
590
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
591 print "Used ranges:"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
592
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
593 print "{| class =\"cyclo_ranges_table\""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
594 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
595 print "| class=\"cyclo_ranges_header_entry\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
596 print "| class=\"cyclo_ranges_header_entry\" | Cyclomatic Complexity"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
597 print "| class=\"cyclo_ranges_header_entry\" | Risk Evaluation"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
598 # Simple
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
599 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
600 print "| class=\"cyclo_ranges_entry_simple\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
601 print "| class=\"cyclo_ranges_entry\" | 0 - " cyclo_simple_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
602 print "| class=\"cyclo_ranges_entry\" | Simple module, without much risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
603 # Moderate
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
604 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
605 print "| class=\"cyclo_ranges_entry_moderate\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
606 print "| class=\"cyclo_ranges_entry\" |" cyclo_simple_max + 1 " - " cyclo_moderate_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
607 print "| class=\"cyclo_ranges_entry\" | More complex module, moderate risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
608 # High
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
609 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
610 print "| class=\"cyclo_ranges_entry_high\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
611 print "| class=\"cyclo_ranges_entry\" |" cyclo_moderate_max + 1 " - " cyclo_high_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
612 print "| class=\"cyclo_ranges_entry\" | Complex module, high risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
613 # Untestable
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
614 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
615 print "| class=\"cyclo_ranges_entry_untestable\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
616 print "| class=\"cyclo_ranges_entry\" | greater than " cyclo_high_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
617 print "| class=\"cyclo_ranges_entry\" | Untestable module, very high risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
618 print "|}"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
619
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
620 print ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
621 print ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
622 wiki_fnc_table_complete("")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
623 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
624
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
625 function wiki_fnc_table_complete (caption)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
626 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
627 wiki_fnc_table(caption, 1, 0, 1, 1, 1, 0, 1)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
628 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
629
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
630 function wiki_fnc_table_abbrev (caption)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
631 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
632 wiki_fnc_table(caption, 1, 0, 0, 0, 0, 0, 0)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
633 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
634
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
635 function wiki_fnc_table (caption,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
636 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
637 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
638 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
639 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
640 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
641 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
642 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
643 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
644 print "{| width=\"90%\" class=\"cyclo_function_table\" cellpadding=\"0\" cellspacing=\"0\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
645 if (caption != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
646 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
647 print "|+" caption
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
648 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
649 wiki_fnc_header(fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
650 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
651 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
652 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
653 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
654 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
655 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
656 for (nfnc = 1; nfnc < nfuncs; nfnc++)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
657 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
658 wiki_fnc(nfnc,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
659 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
660 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
661 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
662 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
663 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
664 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
665 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
666 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
667 print "|}"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
668 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
669
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
670 function wiki_fnc_header (fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
671 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
672 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
673 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
674 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
675 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
676 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
677 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
678 if (fname_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
679 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
680 # Function name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
681 print "! class=\"cyclo_function_table_header_entry\" | Function Name"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
682 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
683 if (mcyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
684 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
685 # Modified cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
686 print "! class=\"cyclo_function_table_header_entry\" | Modified Cyclo"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
687 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
688 if (cyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
689 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
690 # Cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
691 print "! class=\"cyclo_function_table_header_entry\" | Cyclomatic Complexity"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
692 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
693 if (num_statements_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
694 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
695 print "! class=\"cyclo_function_table_header_entry\" | Number of Statements"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
696 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
697 if (num_lines_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
698 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
699 print "! class=\"cyclo_function_table_header_entry\" | Number of Lines"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
700 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
701 if (first_line_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
702 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
703 print "! class=\"cyclo_function_table_header_entry\" | First Line"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
704 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
705 if (file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
706 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
707 print "! class=\"cyclo_function_table_header_entry\" | Source File"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
708 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
709 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
710
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
711 function wiki_fnc (nfnc,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
712 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
713 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
714 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
715 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
716 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
717 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
718 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
719 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
720 fname = fnames[nfnc]
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
721
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
722 # Function name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
723 trclass = "cyclo_function_entry_simple"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
724 if (mcyclo[nfnc] > cyclo_high_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
725 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
726 trclass="cyclo_function_entry_untestable"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
727 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
728 else if (mcyclo[nfnc] > cyclo_moderate_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
729 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
730 trclass="cyclo_function_entry_high"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
731 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
732 else if (mcyclo[nfnc] > cyclo_simple_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
733 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
734 trclass="cyclo_function_entry_moderate"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
735 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
736
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
737 print "|- class=\"" trclass "\""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
738 if (fname_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
739 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
740 print "| class=\"cyclo_function_entry_name\" |" fname
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
741 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
742 if (mcyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
743 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
744 # Modified cyclo
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
745 print "| class=\"cyclo_function_entry_cyclo\" |" mcyclo[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
746 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
747 if (cyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
748 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
749 # Cyclo
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
750 print "| class=\"cyclo_function_entry_cyclo\" |" cyclo[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
751 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
752 if (num_statements_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
753 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
754 # Number of statements
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
755 print "| class=\"cyclo_function_entry_number\" |" num_statements[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
756 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
757 if (num_lines_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
758 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
759 # Number of lines
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
760 print "| class=\"cyclo_function_entry_number\" |" num_lines[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
761 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
762 if (first_line_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
763 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
764 # First line
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
765 print "| class=\"cyclo_function_entry_number\" |" first_line[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
766 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
767 if (file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
768 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
769 href = ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
770 if (source_file_link_tmpl != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
771 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
772 # Get href target
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
773 href = source_file_link_tmpl
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
774 sub(/%FILENAME%/, file[nfnc], href)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
775 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
776
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
777 # Source file
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
778 print "| class=\"cyclo_function_entry_filename\" |" \
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
779 ((href != "") ? "[" href " " file[nfnc] "]" : "[" file[nfnc] "]")
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
780 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
781 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
782
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
783 # Scan data from a line
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
784 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
785 function_name = $7
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
786
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
787 nfuncs++;
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
788 fnames[nfuncs] = function_name
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
789 mcyclo[nfuncs] = $1
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
790 cyclo[nfuncs] = $2
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
791 num_statements[nfuncs] = $3
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
792 first_line[nfuncs] = $4
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
793 num_lines[nfuncs] = $5
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
794
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
795 # Build the filename from the file_spec ($6)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
796 begin_util_path = index($6, cut_dir)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
797 tmpfilename = substr($6, begin_util_path + length(cut_dir))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
798 sub(/\([0-9]+\):/, "", tmpfilename)
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
799 file[nfuncs] = tmpfilename
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
800
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
801 if (mcyclo[nfuncs] > cyclo_simple_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
802 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
803 # Extract function contents to a fn_txt file
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
804 filepath = $6
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
805
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
806 sub(/\([0-9]+\):/, "", filepath)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
807 num_line = 0
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
808
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
809 while ((getline codeline < filepath) > 0)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
810 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
811 num_line++;
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
812 if ((num_line >= first_line[nfuncs]) &&
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
813 (num_line < first_line[nfuncs] + num_lines[nfuncs]))
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
814 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
815 print codeline > (function_name nfuncs "_fn.txt")
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
816 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
817 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
818 close (function_name nfuncs "_fn.txt")
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
819 close(filepath)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
820 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
821
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
822 # Initial values for statistics variables
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
823 num_of_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
824 max_mcyclo = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
825 max_function_length = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
826 num_of_simple_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
827 num_of_moderate_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
828 num_of_high_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
829 num_of_untestable_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
830 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
831
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
832 # Epilogue
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
833 END {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
834 # Print header (only for html)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
835 if (output_lang == "html")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
836 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
837 html_header()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
838 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
839
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
840 # Print prolog
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
841 if ((output_lang == "html") &&
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
842 (html_prolog != ""))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
843 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
844 print html_prolog
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
845 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
846 if ((output_lang == "wiki") &&
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
847 (wiki_prolog != ""))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
848 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
849 print wiki_prolog
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
850 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
851
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
852 if (output_lang == "html")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
853 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
854 print "<div class=\"page_title\">" package_name " Cyclomatic Complexity Report</div>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
855 print "<p>Report generated at: <span class=\"report_timestamp\">" strftime() "</div></p>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
856 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
857 if (output_lang == "wiki")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
858 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
859 print "==" package_name " Cyclomatic Complexity Report=="
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
860 print "Report generated at: '''" strftime() "'''"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
861 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
862
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
863 if (section_global_stats_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
864 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
865 build_stats()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
866
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
867 if (output_lang == "html")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
868 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
869 html_global_stats()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
870 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
871 if (output_lang == "wiki")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
872 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
873 wiki_global_stats()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
874 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
875 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
876 if (section_function_cyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
877 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
878 if (output_lang == "html")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
879 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
880 html_function_cyclo()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
881 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
882 if (output_lang == "wiki")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
883 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
884 wiki_function_cyclo()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
885 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
886 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
887
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
888 # Print epilog
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
889 if ((output_lang == "html") &&
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
890 (html_epilog != ""))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
891 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
892 print html_epilog
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
893 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
894 if ((output_lang == "wiki") &&
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
895 (wiki_epilog != ""))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
896 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
897 print wiki_epilog
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
898 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
899
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
900 # Print footer (html only)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
901 if (output_lang == "html")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
902 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
903 html_footer()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
904 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
905 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
906
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
907 # End of pmccabe2html