File: complexity-tpl.texi

package info (click to toggle)
complexity 1.10%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,700 kB
  • sloc: sh: 5,111; ansic: 1,936; makefile: 97
file content (163 lines) | stat: -rw-r--r-- 4,275 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
[= AutoGen5 template  -*- Mode: texi -*-

texi

##  Documentation template
##
## Author:            Bruce Korb <bkorb@gnu.org>
##
##  This file is part of Complexity.
##  Complexity Copyright (c) 2011, 2014 by Bruce Korb - all rights reserved
##
##  Complexity is free software: you can redistribute it and/or modify it
##  under the terms of the GNU General Public License as published by the
##  Free Software Foundation, either version 3 of the License, or
##  (at your option) any later version.
##
##  Complexity is distributed in the hope that it will be useful, but
##  WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
##  See the GNU General Public License for more details.
##
##  You should have received a copy of the GNU General Public License along
##  with this program.  If not, see <http://www.gnu.org/licenses/>.

=]
\input texinfo
@ignore
\internalpagesizes{46\baselineskip}{6in}{-.25in}{-.25in}{\bindingoffset}{36pt}%
@end ignore
@c %**start of header
@setfilename complexity.info
@settitle [= package =] - [= prog-title =]
@setchapternewpage off
@syncodeindex pg cp
@c %**end of header
@copying
This manual is for Complexity version [=

(define texi-escape-encode (lambda (in-str)
   (string-substitute in-str
      '("@"   "{"   "}")
      '("@@"  "@{"  "@}")
)  ))

(make-tmp-dir)

(define ver-update
   (shellf "UPDATED=`date '+%%B %%Y'` ; VERSION='%s'
      echo ${VERSION}, updated ${UPDATED}" (get "version")) )

ver-update =].

Copyright @copyright{} [= copyright.date =] by Bruce Korb.

@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
@end quotation
@end copying

@ignore
[=(set-writable) (dne "")=]
@end ignore

@dircategory Software development
@direntry
* Complexity: ([=prog-name=]).         [= prog-title =].
@end direntry

@finalout
@titlepage
@title Complexity - [= prog-title =]
@subtitle For version [=(. ver-update)=]
@author Bruce Korb
@author @email{[= (texi-escape-encode "bkorb@gnu.org") =]}

@page
@vskip 0pt plus 1filll
Complexity copyright @copyright{} [= copyright.date =] Bruce Korb

@insertcopying
@end titlepage

@contents

@ifnottex

@node Top, Introduction, , (dir)
@top [= prog-title =]
@comment  node-name,  next,  previous,  up

This file documents Complexity version [= version =].  It is a tool designed
for analyzing the complexity of ``C'' program functions.  It is very similar
to the McCabe scoring, but addresses several issues not considered in that
scoring scheme.

This edition documents version [=(. ver-update)=]

@menu
* Introduction::            Introduction
* Complexity Computation::  Complexity Computation
* Example Output::          Example Output
* complexity Invocation::   Invoking complexity
* Copying This Manual::     Copying This Manual
* Concept Index::           General index
@end menu

@end ifnottex

@include intro.texi
@include compute.texi

@page
@node    Example Output
@chapter Example Output
@cindex  Example Output

This is a self-referential example. This output was obtained by
going into the complexity source directory and running the command:
@example
[=`
src=\`cd ${top_srcdir}/src && pwd\`
bld=\`cd ${top_builddir}/src && pwd\`
cmd='complexity --histogram --score --thresh=3'
echo "$cmd *.c"
`=]
@end example

The @code{--threshold} is set to three because all of the functions
score below the default threshold of 30.  It is not zero because
there are too many trivial (0, 1 or 2) functions for a short example.

@noindent
This results in:

@example
[=`
cd ${src}
test -f opts.c || ln -s ${bld}/opts.c
eval ${bld}/${cmd} *.c | sed 's/\\(.\\{66\\}\\).*/\\1/'
test -L opts.c && rm opts.c
`=]
@end example
@page
@include invoke-complexity.texi
@page
@node Copying This Manual
@appendix Copying This Manual

You may copy this manual under the terms of the FDL
(@url{http://gnu.org/licenses/fdl.texi,the GNU Free Documentation License}).

@cindex FDL, GNU Free Documentation License
@include fdl.texi

@page
@node Concept Index
@unnumbered Concept Index

@printindex cp
@bye