annotate build-aux/pmccabe2html @ 40186:8964917f9574

autoupdate
author Karl Berry <karl@freefriends.org>
date Mon, 18 Feb 2019 08:02:49 -0800
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13709
2110f21f9366 Set cut_dir properly, and add mode line for Emacs.
Reuben Thomas <rrt@sc3d.org>
parents: 13708
diff changeset
1 # pmccabe2html - AWK script to convert pmccabe output to html -*- awk -*-
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
2
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
3 # Copyright (C) 2007-2019 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
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
16 # along with this program. If not, see <https://www.gnu.org/licenses/>.
10599
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 #
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
24 # CYCLO_SOURCES = ${top_srcdir}/src/*.[ch]
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
25 #
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
26 # cyclo-$(PACKAGE).html: $(CYCLO_SOURCES)
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
27 # $(PMCCABE) $(CYCLO_SOURCES) \
13708
bc1595bf1483 Make Makefile.am example code more cut-and-paste friendly.
Reuben Thomas <rrt@sc3d.org>
parents: 12559
diff changeset
28 # | sort -nr \
bc1595bf1483 Make Makefile.am example code more cut-and-paste friendly.
Reuben Thomas <rrt@sc3d.org>
parents: 12559
diff changeset
29 # | $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \
bc1595bf1483 Make Makefile.am example code more cut-and-paste friendly.
Reuben Thomas <rrt@sc3d.org>
parents: 12559
diff changeset
30 # -v lang=html -v name="$(PACKAGE_NAME)" \
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
31 # -v vcurl="https://git.savannah.gnu.org/gitweb/?p=$(PACKAGE).git;a=blob;f=%FILENAME%;hb=HEAD" \
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
32 # -v url="https://www.gnu.org/software/$(PACKAGE)/" \
13708
bc1595bf1483 Make Makefile.am example code more cut-and-paste friendly.
Reuben Thomas <rrt@sc3d.org>
parents: 12559
diff changeset
33 # -v css=${top_srcdir}/build-aux/pmccabe.css \
bc1595bf1483 Make Makefile.am example code more cut-and-paste friendly.
Reuben Thomas <rrt@sc3d.org>
parents: 12559
diff changeset
34 # -v cut_dir=${top_srcdir}/ \
bc1595bf1483 Make Makefile.am example code more cut-and-paste friendly.
Reuben Thomas <rrt@sc3d.org>
parents: 12559
diff changeset
35 # > $@-tmp
bc1595bf1483 Make Makefile.am example code more cut-and-paste friendly.
Reuben Thomas <rrt@sc3d.org>
parents: 12559
diff changeset
36 # mv $@-tmp $@
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
37 #
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
38 # The variables available are:
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
39 # lang output language, either 'html' or 'wiki'
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
40 # name project name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
41 # url link to project's home page
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
42 # vcurl URL to version controlled source code browser,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
43 # a %FILENAME% in the string is replaced with the relative
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
44 # source filename
10637
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
45 # 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
46 # css_url link to CSS stylesheet, an URL
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
47
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
48 # Prologue & configuration
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
49 BEGIN {
17483
e323d8388f80 pmccabe2html: fix portability issues
Mats Erik Andersson <gnu@gisladisker.se>
parents: 17249
diff changeset
50 # Portable lookup of present time.
e323d8388f80 pmccabe2html: fix portability issues
Mats Erik Andersson <gnu@gisladisker.se>
parents: 17249
diff changeset
51 "date +%s" | getline epoch_time
e323d8388f80 pmccabe2html: fix portability issues
Mats Erik Andersson <gnu@gisladisker.se>
parents: 17249
diff changeset
52 "date" | getline chronos_time
e323d8388f80 pmccabe2html: fix portability issues
Mats Erik Andersson <gnu@gisladisker.se>
parents: 17249
diff changeset
53
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
54 section_global_stats_p = 1
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
55 section_function_cyclo_p = 1
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
56
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
57 # "html" or "wiki"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
58 package_name = name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
59 output_lang = lang
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 # General Options
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
62 cyclo_simple_max = 10
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
63 cyclo_moderate_max = 20
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
64 cyclo_high_max = 50
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
65 source_file_link_tmpl = vcurl
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
66
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
67 # HTML options
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
68 if (url != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
69 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
70 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
71 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
72 html_epilog = "<hr color=\"black\" size=\"2\"/> \
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
73 Copyright (c) 2007, 2008 Free Software Foundation, Inc."
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
74 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
75 \"http://www.w3.org/TR/html401/loose.dtd\">"
17483
e323d8388f80 pmccabe2html: fix portability issues
Mats Erik Andersson <gnu@gisladisker.se>
parents: 17249
diff changeset
76 html_comment = "<!-- Generated by gnulib's pmccabe2html at " epoch_time " -->"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
77 html_title = "Cyclomatic Complexity report for " package_name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
78
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
79 # Wiki options
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
80 wiki_prolog = "{{Note|This page has been automatically generated}}"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
81 wiki_epilog = ""
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 # Internal variables
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
84 nfuncs = 0;
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
85 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
86
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
87 # Functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
88
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
89 function build_stats()
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 # Maximum modified cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
92 for (fcn in mcyclo)
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 num_of_functions++
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
95 if (mcyclo[fcn] > max_mcyclo)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
96 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
97 max_mcyclo = mcyclo[fcn]
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
98 }
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 if (mcyclo[fcn] > cyclo_high_max)
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 num_of_untestable_functions++
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 else if (mcyclo[fcn] > cyclo_moderate_max)
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 num_of_high_functions++
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 else if (mcyclo[fcn] > cyclo_simple_max)
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 num_of_moderate_functions++
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 else
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
113 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
114 num_of_simple_functions++
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
115 }
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
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
119 function html_fnc_table_complete (caption)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
120 {
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
121 html_fnc_table(caption, 1, 1, 0, 1, 1, 0, 1)
10599
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_abbrev (caption)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
125 {
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
126 html_fnc_table(caption, 1, 1, 0, 0, 1, 0, 0)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
127 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
128
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
129
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
130 function html_fnc_table (caption,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
131 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
132 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
133 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
134 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
135 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
136 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
137 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
138 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
139 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
140 if (caption != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
141 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
142 print "<caption class=\"function_table_caption\">" caption "</caption>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
143 }
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
144 html_fnc_header(fname_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
145 mcyclo_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
146 cyclo_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
147 num_statements_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
148 num_lines_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
149 first_line_p,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
150 file_p)
13846
571aae732449 pmccabe2html: bug fixes: don't skip last input line; quote filename in shell command
Torsten Scheck <Torsten.Scheck@Leica-Microsystems.com>
parents: 13845
diff changeset
151 for (nfnc = 1; nfnc <= nfuncs; nfnc++)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
152 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
153 html_fnc(nfnc,
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
154 fname_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
155 mcyclo_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
156 cyclo_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
157 num_statements_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
158 num_lines_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
159 first_line_p,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
160 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
161 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
162 print "</table>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
163 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
164
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
165 function html_header ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
166 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
167 print html_doctype
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
168 print "<html>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
169 print html_comment
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
170 print "<head>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
171 print "<title>" html_title "</title>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
172 print ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
173 print "<meta name=\"description\" content=\"" html_title "\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
174 print "<meta name=\"keywords\" content=\"" html_title "\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
175 print "<meta name=\"resource-type\" content=\"document\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
176 print "<meta name=\"distribution\" content=\"global\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
177 print "<meta name=\"Generator\" content=\"pmccabe2html\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
178 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
179 print "<script language=\"javascript\" type=\"text/javascript\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
180 print "function show_hide(idCapa, idButton, fuerzaVisibilidad)\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
181 {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
182 var button = document.getElementById(idButton);\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
183 var capa = document.getElementById(idCapa);\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
184 if (capa)\
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 (fuerzaVisibilidad && fuerzaVisibilidad!=\"\") {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
187 if (fuerzaVisibilidad==\"visible\") capa.style.display=\"\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
188 else capa.style.display=\"none\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
189 }\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
190 else\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
191 {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
192 if (capa.style.display == \"none\") {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
193 capa.style.display = \"\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
194 button.innerHTML = \"&uarr;\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
195 } else {\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
196 capa.style.display = \"none\";\
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
197 button.innerHTML = \"&darr;\"; \
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 }\
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 }"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
202 print "</script>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
203
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
204
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
205 if (css_url != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
206 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
207 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
208 }
10637
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
209 if (css != "")
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 "<style type =\"text/css\" media=\"screen\">"
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
212 print "<!--"
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
213 while ((getline cssline < css) > 0)
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
214 {
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
215 print cssline
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
216 }
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
217 print "-->"
17483
e323d8388f80 pmccabe2html: fix portability issues
Mats Erik Andersson <gnu@gisladisker.se>
parents: 17249
diff changeset
218 print "</style>"
10637
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
219 close(css)
63a8c3a186b9 pmccabe2html: Add css and css_url parameters.
Simon Josefsson <simon@josefsson.org>
parents: 10599
diff changeset
220 }
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
221 print "</head>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
222 print "<body lang=\"en\" bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" \
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
223 vlink=\"#800080\" alink=\"#FF0000\">"
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_footer ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
227 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
228 print "</body>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
229 print "</html>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
230 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
231
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
232 function html_fnc_header (fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
233 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
234 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
235 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
236 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
237 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
238 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
239 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
240 print "<tr class=\"function_table_header\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
241 if (fname_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
242 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
243 # Function name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
244 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
245 print ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
246 print "</td>"
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 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
249 print "Function Name"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
250 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
251 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
252 if (mcyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
253 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
254 # Modified cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
255 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
256 print "Modified Cyclo"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
257 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
258 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
259 if (cyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
260 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
261 # Cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
262 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
263 print "Cyclomatic"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
264 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
265 print "Complexity"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
266 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
267 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
268 if (num_statements_p)
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 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
271 print "Number of"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
272 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
273 print "Statements"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
274 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
275 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
276 if (num_lines_p)
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 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
279 print "Number of"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
280 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
281 print "Lines"
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 (first_line_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 "First Line"
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 if (file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
291 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
292 print "<td class=\"function_table_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
293 print "Source File"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
294 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
295
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
296 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
297 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
298 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
299
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
300 function html_fnc (nfun,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
301 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
302 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
303 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
304 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
305 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
306 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
307 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
308 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
309 fname = fnames[nfun]
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
310
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
311 # Function name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
312 trclass = "function_entry_simple"
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
313 if (mcyclo[nfun] > cyclo_high_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
314 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
315 trclass="function_entry_untestable"
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
316 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
317 else if (mcyclo[nfun] > cyclo_moderate_max)
10599
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 trclass="function_entry_high"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
320 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
321 else if (mcyclo[nfun] > cyclo_simple_max)
10599
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 trclass="function_entry_moderate"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
324 }
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 "<tr class=\"" trclass "\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
327 if (fname_p)
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 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
330 if (file_p && mcyclo[nfun] > cyclo_simple_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
331 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
332 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
333 <span id=\"" fname "_button\">&darr;</span></a>"
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 else
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
336 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
337 print "&nbsp;"
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 print "</td>"
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 print "<td class=\"function_entry_name\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
342 print fname
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
343 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
344 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
345 if (mcyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
346 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
347 # Modified cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
348 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
349 print mcyclo[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
350 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
351 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
352 if (cyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
353 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
354 # Cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
355 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
356 print cyclo[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
357 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
358 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
359 if (num_statements_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
360 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
361 # Number of statements
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
362 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
363 print num_statements[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
364 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
365 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
366 if (num_lines_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
367 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
368 # Number of lines
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
369 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
370 print num_lines[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
371 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
372 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
373 if (first_line_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
374 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
375 # First line
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
376 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
377 print first_line[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
378 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
379 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
380 if (file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
381 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
382 href = ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
383 if (source_file_link_tmpl != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
384 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
385 # Get href target
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
386 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
387 sub(/%FILENAME%/, file[nfun], href)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
388 }
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 # Source file
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
391 print "<td class=\"function_entry_filename\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
392 if (href != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
393 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
394 print "<a href=\"" href "\">" file[nfun] "</a>"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
395 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
396 else
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
397 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
398 print file[nfun]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
399 }
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
400
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
401 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
402
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 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
405
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
406 if (mcyclo[nfun] > cyclo_simple_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
407 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
408 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
409
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
410 num_columns = 1;
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
411 if (fname_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
412 if (mcyclo_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
413 if (cyclo_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
414 if (num_statements_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
415 if (num_lines_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
416 if (first_line_p) { num_columns++ }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
417 if (file_p) { num_columns++ }
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
418
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
419 print "<td colspan=\"" num_columns "\" height=\"0\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
420 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
421 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
422
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
423 while ((getline codeline < (fname nfun "_fn.txt")) > 0)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
424 {
18073
77cfc81a8ea5 pmccabe2html: fix gawk regex escaping
Assaf Gordon <assafgordon@gmail.com>
parents: 17848
diff changeset
425 gsub(/&/, "\\&amp;", codeline) # Must come first.
77cfc81a8ea5 pmccabe2html: fix gawk regex escaping
Assaf Gordon <assafgordon@gmail.com>
parents: 17848
diff changeset
426 gsub(/</, "\\&lt;", codeline)
77cfc81a8ea5 pmccabe2html: fix gawk regex escaping
Assaf Gordon <assafgordon@gmail.com>
parents: 17848
diff changeset
427 gsub(/>/, "\\&gt;", codeline)
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
428
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
429 print codeline
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
430 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
431 close(fname nfun "_fn.txt")
13846
571aae732449 pmccabe2html: bug fixes: don't skip last input line; quote filename in shell command
Torsten Scheck <Torsten.Scheck@Leica-Microsystems.com>
parents: 13845
diff changeset
432 system("rm " "'" fname "'" nfun "_fn.txt")
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
433 print "</pre>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
434 print "</div>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
435 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
436 print "</tr>"
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
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 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
441
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
442 function html_global_stats ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
443 {
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
444 print "<div class=\"section_title\">Summary</div>"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
445
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
446 print "<table class=\"summary_table\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
447 # Total number of functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
448 print "<tr>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
449 print "<td class=\"summary_header_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
450 print "Total number of functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
451 print "</td>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
452 print "<td class=\"summary_number_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
453 print num_of_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
454 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
455 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
456 # Number of simple functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
457 print "<tr>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
458 print "<td class=\"summary_header_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
459 print "Number of low risk functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
460 print "</td>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
461 print "<td class=\"summary_number_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
462 print num_of_simple_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
463 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
464 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
465 # Number of moderate functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
466 print "<tr>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
467 print "<td class=\"summary_header_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
468 print "Number of moderate risk functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
469 print "</td>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
470 print "<td class=\"summary_number_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
471 print num_of_moderate_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
472 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
473 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
474 # Number of high functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
475 print "<tr>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
476 print "<td class=\"summary_header_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
477 print "Number of high risk functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
478 print "</td>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
479 print "<td class=\"summary_number_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
480 print num_of_high_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
481 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
482 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
483 # Number of untestable functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
484 print "<tr>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
485 print "<td class=\"summary_header_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
486 print "Number of untestable functions"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
487 print "</td>"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
488 print "<td class=\"summary_number_entry\">"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
489 print num_of_untestable_functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
490 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
491 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
492 print "</table>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
493 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
494 }
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 function html_function_cyclo ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
497 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
498 print "<div class=\"section_title\">Details for all functions</div>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
499
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
500 print "<table class=\"ranges_table\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
501 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
502 print "<td class=\"ranges_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
503 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
504 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
505 print "<td class=\"ranges_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
506 print "Cyclomatic Complexity"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
507 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
508 print "<td class=\"ranges_header_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
509 print "Risk Evaluation"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
510 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
511 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
512 # Simple
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
513 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
514 print "<td class=\"ranges_entry_simple\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
515 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
516 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
517 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
518 print "0 - " cyclo_simple_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
519 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
520 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
521 print "Simple module, without much risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
522 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
523 print "</tr>"
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
524 # Moderate
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
525 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
526 print "<td class=\"ranges_entry_moderate\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
527 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
528 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
529 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
530 print cyclo_simple_max + 1 " - " cyclo_moderate_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
531 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
532 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
533 print "More complex module, moderate risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
534 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
535 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
536 # High
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
537 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
538 print "<td class=\"ranges_entry_high\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
539 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
540 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
541 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
542 print cyclo_moderate_max + 1 " - " cyclo_high_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
543 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
544 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
545 print "Complex module, high risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
546 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
547 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
548 # Untestable
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
549 print "<tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
550 print "<td class=\"ranges_entry_untestable\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
551 print "&nbsp;"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
552 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
553 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
554 print "greater than " cyclo_high_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
555 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
556 print "<td class=\"ranges_entry\">"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
557 print "Untestable module, very high risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
558 print "</td>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
559 print "</tr>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
560 print "</table>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
561 print "<br/>"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
562 html_fnc_table_complete("")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
563 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
564
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
565 function wiki_global_stats ()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
566 {
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
567 print "{| class=\"cyclo_summary_table\""
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
568 # Total number of functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
569 print "|-"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
570 print "| class=\"cyclo_summary_header_entry\" | Total number of functions"
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
571 print "| class=\"cyclo_summary_number_entry\" |" num_of_functions
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
572 # Number of simple functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
573 print "|-"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
574 print "| class=\"cyclo_summary_header_entry\" | Number of low risk functions"
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
575 print "| class=\"cyclo_summary_number_entry\" |" num_of_simple_functions
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
576 # Number of moderate functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
577 print "|-"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
578 print "| class=\"cyclo_summary_header_entry\" | Number of moderate risk functions"
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
579 print "| class=\"cyclo_summary_number_entry\" |" num_of_moderate_functions
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
580 # Number of high functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
581 print "|-"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
582 print "| class=\"cyclo_summary_header_entry\" | Number of high risk functions"
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
583 print "| class=\"cyclo_summary_number_entry\" |" num_of_high_functions
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
584 # Number of untestable functions
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
585 print "|-"
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
586 print "| class=\"cyclo_summary_header_entry\" | Number of untestable functions"
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
587 print "| class=\"cyclo_summary_number_entry\" |" num_of_untestable_functions
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
588 print "|}"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
589 }
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 function wiki_function_cyclo ()
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 "==Details for all functions=="
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
594
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
595 print "Used ranges:"
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
596
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
597 print "{| class =\"cyclo_ranges_table\""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
598 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
599 print "| class=\"cyclo_ranges_header_entry\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
600 print "| class=\"cyclo_ranges_header_entry\" | Cyclomatic Complexity"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
601 print "| class=\"cyclo_ranges_header_entry\" | Risk Evaluation"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
602 # Simple
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
603 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
604 print "| class=\"cyclo_ranges_entry_simple\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
605 print "| class=\"cyclo_ranges_entry\" | 0 - " cyclo_simple_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
606 print "| class=\"cyclo_ranges_entry\" | Simple module, without much risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
607 # Moderate
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
608 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
609 print "| class=\"cyclo_ranges_entry_moderate\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
610 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
611 print "| class=\"cyclo_ranges_entry\" | More complex module, moderate risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
612 # High
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
613 print "|-"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
614 print "| class=\"cyclo_ranges_entry_high\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
615 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
616 print "| class=\"cyclo_ranges_entry\" | Complex module, high risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
617 # Untestable
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 print "| class=\"cyclo_ranges_entry_untestable\" | "
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
620 print "| class=\"cyclo_ranges_entry\" | greater than " cyclo_high_max
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
621 print "| class=\"cyclo_ranges_entry\" | Untestable module, very high risk"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
622 print "|}"
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 print ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
625 print ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
626 wiki_fnc_table_complete("")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
627 }
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 function wiki_fnc_table_complete (caption)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
630 {
13845
b3ccbcf1940e More pmccabe fixes.
Reuben Thomas <rrt@sc3d.org>
parents: 13711
diff changeset
631 wiki_fnc_table(caption, 1, 1, 0, 1, 1, 0, 1)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
632 }
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 function wiki_fnc_table_abbrev (caption)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
635 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
636 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
637 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
638
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
639 function wiki_fnc_table (caption,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
640 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
641 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
642 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
643 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
644 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
645 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
646 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
647 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
648 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
649 if (caption != "")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
650 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
651 print "|+" caption
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
652 }
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
653 wiki_fnc_header(fname_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
654 mcyclo_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
655 cyclo_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
656 num_statements_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
657 num_lines_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
658 first_line_p,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
659 file_p)
13846
571aae732449 pmccabe2html: bug fixes: don't skip last input line; quote filename in shell command
Torsten Scheck <Torsten.Scheck@Leica-Microsystems.com>
parents: 13845
diff changeset
660 for (nfnc = 1; nfnc <= nfuncs; nfnc++)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
661 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
662 wiki_fnc(nfnc,
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
663 fname_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
664 mcyclo_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
665 cyclo_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
666 num_statements_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
667 num_lines_p,
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
668 first_line_p,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
669 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
670 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
671 print "|}"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
672 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
673
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
674 function wiki_fnc_header (fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
675 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
676 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
677 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
678 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
679 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
680 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
681 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
682 if (fname_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
683 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
684 # Function name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
685 print "! class=\"cyclo_function_table_header_entry\" | Function Name"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
686 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
687 if (mcyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
688 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
689 # Modified cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
690 print "! class=\"cyclo_function_table_header_entry\" | Modified Cyclo"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
691 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
692 if (cyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
693 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
694 # Cyclo
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
695 print "! class=\"cyclo_function_table_header_entry\" | Cyclomatic Complexity"
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_statements_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 Statements"
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 (num_lines_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\" | Number of Lines"
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 (first_line_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\" | First Line"
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 if (file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
710 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
711 print "! class=\"cyclo_function_table_header_entry\" | Source File"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
712 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
713 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
714
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
715 function wiki_fnc (nfnc,
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
716 fname_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
717 mcyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
718 cyclo_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
719 num_statements_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
720 num_lines_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
721 first_line_p,
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
722 file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
723 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
724 fname = fnames[nfnc]
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
725
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
726 # Function name
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
727 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
728 if (mcyclo[nfnc] > cyclo_high_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_untestable"
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
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_moderate_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_high"
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
735 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
736 else if (mcyclo[nfnc] > cyclo_simple_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
737 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
738 trclass="cyclo_function_entry_moderate"
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
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
741 print "|- class=\"" trclass "\""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
742 if (fname_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 print "| class=\"cyclo_function_entry_name\" |" fname
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
745 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
746 if (mcyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
747 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
748 # Modified cyclo
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
749 print "| class=\"cyclo_function_entry_cyclo\" |" mcyclo[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
750 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
751 if (cyclo_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
752 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
753 # Cyclo
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
754 print "| class=\"cyclo_function_entry_cyclo\" |" cyclo[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
755 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
756 if (num_statements_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
757 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
758 # Number of statements
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
759 print "| class=\"cyclo_function_entry_number\" |" num_statements[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
760 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
761 if (num_lines_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
762 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
763 # Number of lines
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
764 print "| class=\"cyclo_function_entry_number\" |" num_lines[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
765 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
766 if (first_line_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
767 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
768 # First line
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
769 print "| class=\"cyclo_function_entry_number\" |" first_line[nfnc]
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
770 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
771 if (file_p)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
772 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
773 href = ""
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
774 if (source_file_link_tmpl != "")
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 # Get href target
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
777 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
778 sub(/%FILENAME%/, file[nfnc], href)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
779 }
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
780
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
781 # Source file
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
782 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
783 ((href != "") ? "[" href " " file[nfnc] "]" : "[" file[nfnc] "]")
10599
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 }
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 # Scan data from a line
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
788 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
789 function_name = $7
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
790
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
791 nfuncs++;
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
792 fnames[nfuncs] = function_name
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
793 mcyclo[nfuncs] = $1
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
794 cyclo[nfuncs] = $2
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
795 num_statements[nfuncs] = $3
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
796 first_line[nfuncs] = $4
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
797 num_lines[nfuncs] = $5
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
798
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
799 # Build the filename from the file_spec ($6)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
800 begin_util_path = index($6, cut_dir)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
801 tmpfilename = substr($6, begin_util_path + length(cut_dir))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
802 sub(/\([0-9]+\):/, "", tmpfilename)
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
803 file[nfuncs] = tmpfilename
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
804
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
805 if (mcyclo[nfuncs] > cyclo_simple_max)
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
806 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
807 # Extract function contents to a fn_txt file
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
808 filepath = $6
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
809
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
810 sub(/\([0-9]+\):/, "", filepath)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
811 num_line = 0
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
812
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
813 while ((getline codeline < filepath) > 0)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
814 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
815 num_line++;
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
816 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
817 (num_line < first_line[nfuncs] + num_lines[nfuncs]))
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
818 {
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
819 print codeline > (function_name nfuncs "_fn.txt")
10599
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 }
10768
52fb10657c22 build-aux/pmccabe2html: Added support for C++ source files.
Simon Josefsson <simon@josefsson.org>
parents: 10637
diff changeset
822 close (function_name nfuncs "_fn.txt")
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
823 close(filepath)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
824 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
825
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
826 # Initial values for statistics variables
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
827 num_of_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
828 max_mcyclo = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
829 max_function_length = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
830 num_of_simple_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
831 num_of_moderate_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
832 num_of_high_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
833 num_of_untestable_functions = 0
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
834 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
835
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
836 # Epilogue
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
837 END {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
838 # Print header (only for html)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
839 if (output_lang == "html")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
840 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
841 html_header()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
842 }
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 prolog
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
845 if ((output_lang == "html") &&
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
846 (html_prolog != ""))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
847 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
848 print html_prolog
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
849 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
850 if ((output_lang == "wiki") &&
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
851 (wiki_prolog != ""))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
852 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
853 print wiki_prolog
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
854 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
855
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
856 if (output_lang == "html")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
857 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
858 print "<div class=\"page_title\">" package_name " Cyclomatic Complexity Report</div>"
17483
e323d8388f80 pmccabe2html: fix portability issues
Mats Erik Andersson <gnu@gisladisker.se>
parents: 17249
diff changeset
859 print "<p>Report generated at: <span class=\"report_timestamp\">" chronos_time "</span></p>"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
860 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
861 if (output_lang == "wiki")
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 print "==" package_name " Cyclomatic Complexity Report=="
17483
e323d8388f80 pmccabe2html: fix portability issues
Mats Erik Andersson <gnu@gisladisker.se>
parents: 17249
diff changeset
864 print "Report generated at: '''" chronos_time "'''"
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
865 }
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 (section_global_stats_p)
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 build_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 == "html")
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 html_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 if (output_lang == "wiki")
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
876 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
877 wiki_global_stats()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
878 }
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 if (section_function_cyclo_p)
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 == "html")
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 html_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 if (output_lang == "wiki")
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 wiki_function_cyclo()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
889 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
890 }
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
891
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
892 # Print epilog
12513
cf6ad3a90b8b pmccabe2html: emit consistent FSF copyright; remove trailing blanks
Jim Meyering <meyering@redhat.com>
parents: 12252
diff changeset
893 if ((output_lang == "html") &&
10599
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
894 (html_epilog != ""))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
895 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
896 print html_epilog
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
897 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
898 if ((output_lang == "wiki") &&
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
899 (wiki_epilog != ""))
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
900 {
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
901 print wiki_epilog
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
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
904 # Print footer (html only)
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
905 if (output_lang == "html")
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 html_footer()
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
908 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
909 }
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
910
866f10e1ae5d Add pmccabe2html module, from gnupdf.
Simon Josefsson <simon@josefsson.org>
parents:
diff changeset
911 # End of pmccabe2html