⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 metre.1

📁 这是一个C程序分析工具
💻 1
字号:
.TH METRE 1 "3 April 1995".SH NAMEmetre \- software-metrics tool for Standard (ANSI/ISO) C.SH SYNOPSIS.B metre[.B \-a] [.B \-c] [.B \-C] [.BI \-D name =.cc +... ]+cc ..if n .ti +5[.BI \-D name = def.cc +... ] [+cc ..B \-H] [.BI \-m metric.cc +... ]+cc ..if n .ti +5.if t .ti +.5i[.BI \-o output-file] [.B \-s] [.BI \-S subst-file.cc +... ]+cc ..if n .ti +5[.BI \-T stroud-number] [.B \-w] [.I input-file.cc +... ]+cc ..LP.B metre.BI \-f resp-file.TP.B metre \-h.SH DESCRIPTION.LP.B metrereports the following metrics, where applicable, at the function, module(file), and project level. For each metric, it reports the minimum,maximum, average, and total, where applicable..LP.RS.RS.ti -5McCabe's cyclomatic complexity.RB ( cyc )..LP.ti -5Myers' extended complexity.RB ( exc )..LP.ti -5Halstead's program length.RB ( pln ),program vocabulary.RB ( pvc ),program volume.RB ( pvl ),program level.RB ( plv ),programming effort.RB ( pef ),intelligence content.RB ( inc ),programming time (in hours).RB ( ptm ),and language level.RB ( llv )..LP.ti -5Number of source.RB ( scl ),code.RB ( cdl ),comment.RB ( cml ),and blank lines.RB ( bll )..LP.ti -5Number of executable.RB ( exs ),declaration.RB ( dcs ),and preprocessor.RB ( pps )statements..LP.ti -5Backfired function points.RB ( fnp )..LP.ti -5Maximum control depth.RB ( mcd )..LP.ti -5Identifier count.RB ( idc )and length.RB ( idl )..LP.ti -5Number of functions.RB ( fnc )and modules.RB ( mdc )..LP.RE.RESee the.B \-moption for a description of how the metric abbreviations are used..LP.B metregenerates a warning if it encounters a.B gotoor.B continuestatement or multiple.B returnstatements in a function. It also generates a warning if it encountersindention accomplished by both spaces.I andtabs..LPInput, which must be valid.I Standard Ccode, is taken from the list of.IR input-file sthat are named on the command line. If no.IR input-file sare specified, input is taken from standard input. Output is written tostandard output or, if the.B \-ooption is used, to the.IR output-file ..SH OPTIONSOptions may appear in any order and may be interspersed with.IR input-file s.There are no spaces between an option and its argument. Options cannot becombined into a single argument..TP.B \-aAdjust backfired function points based on cyclomatic complexity..TP.B \-cGenerate data in horizontal, comma-separated-value format.RI ( CSV )in the same order as the normal, vertical output. This allows the data tobe more easily used by another program or imported into a database orspreadsheet. You will probably also want to suppress warnings with the.B \-woption so that warnings will not be interspersed with the CSV data..IPThe options that effect whether certain metrics are reported also workfor the CSV output. For example, the Halstead metrics are only reportedif the.B \-Hoption is specified or a Halstead metric is selected, for example,.BR \-mpln .If a value is not printed, its comma seperator is not printed either.In other words, there is never an empty field, e.g., ".B ,,"..TP.B \-CCauses the input stream to be interspersed with the output stream..TP.BI \-D name =Remove all occurences of.I namefrom the input stream. Can be repeated any number of times..TP.BI \-D name = defReplace all occurences of.I namein the input stream with.IR def .Can be repeated any number of times. The.B \-Doption may be enough to convert any compiler-specific extensions you areusing to something that.B metreunderstands as Standard C syntax. For example, since Borland uses.B cdeclin its.B stdio.hfile, I have to use the following command to get.B metreto accept it:.RS.IP.B metre \-Dcdecl= metrules.i.RE.IPThis defines cdecl as a null string, effectively removing alloccurrences from the input stream. There may also be a situation where alexeme used in a declaration could be converted to another, as in thefollowing:.RS.IP.B metre \-Dselector=int foo.i.RE.IPThe lexeme,.BR selector ,is a type specifier recognized by Intel's iRMX C compiler..IPDepending on which command-line interpreter, or shell, you are using,quoting a definition option may allow you to specify expansion textthat contains imbedded spaces, such as.B"\-Dulong=unsigned long".cc +.+cc ..TP.BI \-f resp-fileRead all command-line options from a.IR "response file" .For example,.BR \-fmetre.cmd ,causes.B metreto ignore any other arguments on the command line and use whateverarguments are in the file,.BR metre.cmd . The arguments in this file can be specified on one or more lines. Any inputor output redirection must be specified on the command line,however. A response file is especially useful when.B metreis executed repeatedly with a large number of command-line arguments,such as file names or.B \-Doptions..TP.B \-hDisplay help..TP.B \-HCalculate the Halstead metrics..B metredoes not normally calculate them because of the extra processing required..TP.BI \-m metricPrint the.I metricidentified by this abbreviation, for example,.BR \-mfnp .The abbreviations from which one can choose appear in parenthesesfollowing the metrics listed in the.B DESCRIPTIONsection. If none are specified, all are printed (after taking the.B \-Hoption into consideration). If one or more are specified, onlythose that are specified are printed. This option can be specified morethan once. For example,.BR "\-mcyc \-mexc" ,would print only the cyclomatic and extended complexity metrics..TP.BI \-o output-fileRedirect output to a file, e.g.,.BR \-oout.txt .This is provided for environments such as VMS that do not havecommand-line redirection..TP.B \-sOnly display the summaries (module summary, and if more than one module,module summaries and project summary). In other words, this suppressesthe function-specific information..TP.BI \-S subst-fileSubstitute.I input-filename. Since.B metrereports the name of the.I input-fileand this may not be the name of theoriginal source file (for example, you ran the preprocessor on it butthe preprocessor did not generate line directives which would containthe name of the original file), the.B \-Soption can be used to specify the name of the original file, e.g.,.BR \-Smyfile.c .This option can be repeated so that each instance specifies a.I subst-filename for each.IR input-file ,respectively. If you entered this line:.RS.IP.B metre \-Sa.c \-Sb.c a.i b.i.RE.IPthe.B metreoutput would use the name,.BR a.c ,for the first file.RB ( a.i )and.B b.cfor the second file.RB ( b.i )..TP.BI \-T stroud-numberThis is the highest number of "moments" per second that humans can perceive.It ranges from 5 to 20 moments per second, maybe a little less. Halstead uses18 in his book,.IR "Elements of Software Science" ,so.B metreuses a default.I stroud-numberof 18 for its calculation of.I Programming.IR Time .You can specify another value. For example,.B \-T10specifies a.I stroud-numberof 10..TP.B \-wSuppress warning diagnostics..SH NOTES.LPThis is the man page for the.B metresoftware-metrics tool that is part of the Metre source-code distribution..LP.B metrerefers to lines by number in an.I input-fileunless it encounters a line directive, for example,.IP.B#line 5 "startup.c".LPor.IP.B# 503 "main.c" 2.LPIt replaces the current line number and file name with whatever is specifiedin the line directive. Some preprocessors can place line directives in theoutput file that relate back to the original source file. If yours can, youprobably want to instruct it to do so..LP.B metreignores preprocessor directives (from.B #to end-of-line) other than linedirectives, so if your preprocessor passes any through, such as.BR #pragmas ,everything should be okay. This could also be useful if youonly rely on the preprocessor for simple substitution. If so, you mightbe able to get away with running your C source file directly into.B metrewithout being preprocessed..LPWhile this is a UNIX man page,.B metreis portable across operating systems. This explains references that may seemout of place or redundant for the UNIX environment, such as the.B \-ooption..SH "SEE ALSO"The man page or other documentation for your Standard C compiler orpreprocessor..LPThe documentation file,.BR metre.doc ,which accompanies the Metre source-code distribution..SH BUGSWhile.B metrerecognizes C comments, for example,.BR "/* a comment */" ,it does not recognizeC++ comments\-those that begin with.BR // ..LPThe.B \-Coption only works if.B metrewas built with an MKS or AT&T lexer and not a flex or pclex lexer. Thelexer distributed with.B metreis an MKS lexer. If built with a flex or pclex lexer, this option is ignored..LP.B metredoes not perform preprocessing, so you should typically run your sourcethrough a preprocessor first and then run the output of the preprocessorinto.BR metre ..LPAll typedefs are treated as if they have file scope..LPStructure members cannot have the same name as a visible typedef.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -