projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
install-reloc: Support multi-binary installation.
[gnulib.git]
/
build-aux
/
pmccabe2html
diff --git
a/build-aux/pmccabe2html
b/build-aux/pmccabe2html
index
28117af
..
ffd0788
100644
(file)
--- a/
build-aux/pmccabe2html
+++ b/
build-aux/pmccabe2html
@@
-1,6
+1,6
@@
# pmccabe2html - AWK script to convert pmccabe output to html -*- awk -*-
# pmccabe2html - AWK script to convert pmccabe output to html -*- awk -*-
-# Copyright (C) 2007
, 2008, 2009, 2010
Free Software Foundation, Inc.
+# Copyright (C) 2007
-2013
Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-21,8
+21,10
@@
# Typical Invocation is from a Makefile.am:
#
# Typical Invocation is from a Makefile.am:
#
-# cyclo-$(PACKAGE).html:
-# $(PMCCABE) ${top_srcdir}/src/*.[ch] \
+# CYCLO_SOURCES = ${top_srcdir}/src/*.[ch]
+#
+# cyclo-$(PACKAGE).html: $(CYCLO_SOURCES)
+# $(PMCCABE) $(CYCLO_SOURCES) \
# | sort -nr \
# | $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \
# -v lang=html -v name="$(PACKAGE_NAME)" \
# | sort -nr \
# | $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \
# -v lang=html -v name="$(PACKAGE_NAME)" \
@@
-45,6
+47,10
@@
# Prologue & configuration
BEGIN {
# Prologue & configuration
BEGIN {
+ # Portable lookup of present time.
+ "date +%s" | getline epoch_time
+ "date" | getline chronos_time
+
section_global_stats_p = 1
section_function_cyclo_p = 1
section_global_stats_p = 1
section_function_cyclo_p = 1
@@
-67,7
+73,7
@@
BEGIN {
Copyright (c) 2007, 2008 Free Software Foundation, Inc."
html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \
\"http://www.w3.org/TR/html401/loose.dtd\">"
Copyright (c) 2007, 2008 Free Software Foundation, Inc."
html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \
\"http://www.w3.org/TR/html401/loose.dtd\">"
- html_comment = "<!-- Generated by gnulib's pmccabe2html at "
systime()
" -->"
+ html_comment = "<!-- Generated by gnulib's pmccabe2html at "
epoch_time
" -->"
html_title = "Cyclomatic Complexity report for " package_name
# Wiki options
html_title = "Cyclomatic Complexity report for " package_name
# Wiki options
@@
-112,12
+118,12
@@
function build_stats()
function html_fnc_table_complete (caption)
{
function html_fnc_table_complete (caption)
{
- html_fnc_table(caption, 1,
0, 1
, 1, 1, 0, 1)
+ html_fnc_table(caption, 1,
1, 0
, 1, 1, 0, 1)
}
function html_fnc_table_abbrev (caption)
{
}
function html_fnc_table_abbrev (caption)
{
- html_fnc_table(caption, 1,
0, 1
, 0, 1, 0, 0)
+ html_fnc_table(caption, 1,
1, 0
, 0, 1, 0, 0)
}
}
@@
-142,7
+148,7
@@
function html_fnc_table (caption,
num_lines_p,
first_line_p,
file_p)
num_lines_p,
first_line_p,
file_p)
- for (nfnc = 1; nfnc < nfuncs; nfnc++)
+ for (nfnc = 1; nfnc <
=
nfuncs; nfnc++)
{
html_fnc(nfnc,
fname_p,
{
html_fnc(nfnc,
fname_p,
@@
-209,7
+215,7
@@
function html_header ()
print cssline
}
print "-->"
print cssline
}
print "-->"
- print "</style
/
>"
+ print "</style>"
close(css)
}
print "</head>"
close(css)
}
print "</head>"
@@
-416,14
+422,14
@@
function html_fnc (nfun,
while ((getline codeline < (fname nfun "_fn.txt")) > 0)
{
while ((getline codeline < (fname nfun "_fn.txt")) > 0)
{
- sub(/\\</, "<", codeline)
-
sub(/\\>/, "&g
t;", codeline)
-
sub(/&/, "&
;", codeline)
+ gsub(/&/, "\&", codeline) # Must come first.
+
gsub(/</, "\&l
t;", codeline)
+
gsub(/>/, "\>
;", codeline)
print codeline
}
close(fname nfun "_fn.txt")
print codeline
}
close(fname nfun "_fn.txt")
- system("rm "
fname
nfun "_fn.txt")
+ system("rm "
"'" fname "'"
nfun "_fn.txt")
print "</pre>"
print "</div>"
print "</td>"
print "</pre>"
print "</div>"
print "</td>"
@@
-435,52
+441,51
@@
function html_fnc (nfun,
function html_global_stats ()
{
function html_global_stats ()
{
- print "<div class=\"section_title\">
Resume
</div>"
+ print "<div class=\"section_title\">
Summary
</div>"
- print "<br/>"
- print "<table class=\"resume_table\">"
+ print "<table class=\"summary_table\">"
# Total number of functions
print "<tr>"
# Total number of functions
print "<tr>"
- print "<td class=\"
resume
_header_entry\">"
+ print "<td class=\"
summary
_header_entry\">"
print "Total number of functions"
print "</td>"
print "Total number of functions"
print "</td>"
- print "<td class=\"
resume
_number_entry\">"
+ print "<td class=\"
summary
_number_entry\">"
print num_of_functions
print "</td>"
print "</tr>"
# Number of simple functions
print "<tr>"
print num_of_functions
print "</td>"
print "</tr>"
# Number of simple functions
print "<tr>"
- print "<td class=\"
resume
_header_entry\">"
+ print "<td class=\"
summary
_header_entry\">"
print "Number of low risk functions"
print "</td>"
print "Number of low risk functions"
print "</td>"
- print "<td class=\"
resume
_number_entry\">"
+ print "<td class=\"
summary
_number_entry\">"
print num_of_simple_functions
print "</td>"
print "</tr>"
# Number of moderate functions
print "<tr>"
print num_of_simple_functions
print "</td>"
print "</tr>"
# Number of moderate functions
print "<tr>"
- print "<td class=\"
resume
_header_entry\">"
+ print "<td class=\"
summary
_header_entry\">"
print "Number of moderate risk functions"
print "</td>"
print "Number of moderate risk functions"
print "</td>"
- print "<td class=\"
resume
_number_entry\">"
+ print "<td class=\"
summary
_number_entry\">"
print num_of_moderate_functions
print "</td>"
print "</tr>"
# Number of high functions
print "<tr>"
print num_of_moderate_functions
print "</td>"
print "</tr>"
# Number of high functions
print "<tr>"
- print "<td class=\"
resume
_header_entry\">"
+ print "<td class=\"
summary
_header_entry\">"
print "Number of high risk functions"
print "</td>"
print "Number of high risk functions"
print "</td>"
- print "<td class=\"
resume
_number_entry\">"
+ print "<td class=\"
summary
_number_entry\">"
print num_of_high_functions
print "</td>"
print "</tr>"
# Number of untestable functions
print "<tr>"
print num_of_high_functions
print "</td>"
print "</tr>"
# Number of untestable functions
print "<tr>"
- print "<td class=\"
resume
_header_entry\">"
+ print "<td class=\"
summary
_header_entry\">"
print "Number of untestable functions"
print "</td>"
print "Number of untestable functions"
print "</td>"
- print "<td class=\"
resume
_number_entry\">"
+ print "<td class=\"
summary
_number_entry\">"
print num_of_untestable_functions
print "</td>"
print "</tr>"
print num_of_untestable_functions
print "</td>"
print "</tr>"
@@
-491,7
+496,6
@@
function html_global_stats ()
function html_function_cyclo ()
{
print "<div class=\"section_title\">Details for all functions</div>"
function html_function_cyclo ()
{
print "<div class=\"section_title\">Details for all functions</div>"
- print "<p>Used ranges:</p>"
print "<table class=\"ranges_table\">"
print "<tr>"
print "<table class=\"ranges_table\">"
print "<tr>"
@@
-560,27
+564,27
@@
function html_function_cyclo ()
function wiki_global_stats ()
{
function wiki_global_stats ()
{
- print "{| class=\"cyclo_
resume
_table\""
+ print "{| class=\"cyclo_
summary
_table\""
# Total number of functions
print "|-"
# Total number of functions
print "|-"
- print "| class=\"cyclo_
resume
_header_entry\" | Total number of functions"
- print "| class=\"cyclo_
resume
_number_entry\" |" num_of_functions
+ print "| class=\"cyclo_
summary
_header_entry\" | Total number of functions"
+ print "| class=\"cyclo_
summary
_number_entry\" |" num_of_functions
# Number of simple functions
print "|-"
# Number of simple functions
print "|-"
- print "| class=\"cyclo_
resume
_header_entry\" | Number of low risk functions"
- print "| class=\"cyclo_
resume
_number_entry\" |" num_of_simple_functions
+ print "| class=\"cyclo_
summary
_header_entry\" | Number of low risk functions"
+ print "| class=\"cyclo_
summary
_number_entry\" |" num_of_simple_functions
# Number of moderate functions
print "|-"
# Number of moderate functions
print "|-"
- print "| class=\"cyclo_
resume
_header_entry\" | Number of moderate risk functions"
- print "| class=\"cyclo_
resume
_number_entry\" |" num_of_moderate_functions
+ print "| class=\"cyclo_
summary
_header_entry\" | Number of moderate risk functions"
+ print "| class=\"cyclo_
summary
_number_entry\" |" num_of_moderate_functions
# Number of high functions
print "|-"
# Number of high functions
print "|-"
- print "| class=\"cyclo_
resume
_header_entry\" | Number of high risk functions"
- print "| class=\"cyclo_
resume
_number_entry\" |" num_of_high_functions
+ print "| class=\"cyclo_
summary
_header_entry\" | Number of high risk functions"
+ print "| class=\"cyclo_
summary
_number_entry\" |" num_of_high_functions
# Number of untestable functions
print "|-"
# Number of untestable functions
print "|-"
- print "| class=\"cyclo_
resume
_header_entry\" | Number of untestable functions"
- print "| class=\"cyclo_
resume
_number_entry\" |" num_of_untestable_functions
+ print "| class=\"cyclo_
summary
_header_entry\" | Number of untestable functions"
+ print "| class=\"cyclo_
summary
_number_entry\" |" num_of_untestable_functions
print "|}"
}
print "|}"
}
@@
-624,7
+628,7
@@
function wiki_function_cyclo ()
function wiki_fnc_table_complete (caption)
{
function wiki_fnc_table_complete (caption)
{
- wiki_fnc_table(caption, 1,
0, 1
, 1, 1, 0, 1)
+ wiki_fnc_table(caption, 1,
1, 0
, 1, 1, 0, 1)
}
function wiki_fnc_table_abbrev (caption)
}
function wiki_fnc_table_abbrev (caption)
@@
-653,7
+657,7
@@
function wiki_fnc_table (caption,
num_lines_p,
first_line_p,
file_p)
num_lines_p,
first_line_p,
file_p)
- for (nfnc = 1; nfnc < nfuncs; nfnc++)
+ for (nfnc = 1; nfnc <
=
nfuncs; nfnc++)
{
wiki_fnc(nfnc,
fname_p,
{
wiki_fnc(nfnc,
fname_p,
@@
-852,12
+856,12
@@
END {
if (output_lang == "html")
{
print "<div class=\"page_title\">" package_name " Cyclomatic Complexity Report</div>"
if (output_lang == "html")
{
print "<div class=\"page_title\">" package_name " Cyclomatic Complexity Report</div>"
- print "<p>Report generated at: <span class=\"report_timestamp\">"
strftime() "</div
></p>"
+ print "<p>Report generated at: <span class=\"report_timestamp\">"
chronos_time "</span
></p>"
}
if (output_lang == "wiki")
{
print "==" package_name " Cyclomatic Complexity Report=="
}
if (output_lang == "wiki")
{
print "==" package_name " Cyclomatic Complexity Report=="
- print "Report generated at: '''"
strftime()
"'''"
+ print "Report generated at: '''"
chronos_time
"'''"
}
if (section_global_stats_p)
}
if (section_global_stats_p)