c语言的重构、清理与代码分析图形化浏览工具: CScout
2017-09-01 10:16
971 查看
网址:
https://www.spinellis.gr/cscout/ https://www2.dmst.aueb.gr/dds/cscout/index.html https://github.com/dspinellis/cscout
还有一个工具叫Xrefactory,它可以分析c++程序。 cscout只能分析c程序。具体如下:
A tool adopting an approach similar to ours is Vittek's Xrefactory [59]. Its functionality is integrated with the Emacs editor [51]. Compared to CScout, Xrefactory supports C++, and thus also offers a number of additional refactorings: field and method moving, pushing down and pulling up fields and methods, and the encapsulation of fields. However, Xrefactory is unable to handle identifiers generated during the preprocessing stage; its author writes that deciding how to handle the renaming of an identifier that is constructed from parts of other identifiers is, in general, an unsolvable problem. The case refers to the renaming of the identifier sysctl_var_sdelay we showed in Section 2.1 into, say, foo. Vittek, correctly writes that there is no way to perform this renaming in a natural way. We sidestep this restriction by only allowing the renaming of an identifier's constituent parts. Thus, in this case, a CScout's user can rename individually the identifier's sysctl_var part and the sdelay part, with each renaming affecting the other corresponding parts in the program.
CScout is a source code analyzer and refactoring browser for collections of C programs. It can process workspaces of multiple projects (we define a project as a collection of C source files that are linked together) mapping the complexity introduced by the C preprocessor back into the original C source code files. CScout takes advantage of modern hardware advances (fast processors and large memory capacities) to analyze C source code beyond the level of detail and accuracy provided by current compilers, linkers, and other source code analyzers. The analysis CScout performs takes into account the identifier scopes introduced by the C preprocessor and the C language proper scopes and namespaces.
cscout是一个c语言代码的分析、重构和浏览工具。
CScout as a source code analyzer can:
annotate source code with hyperlinks to each identifier 在显示源代码的同时对每个标识符进行超链接标注
list files that would be affected by changing a specific identifier 显示修改某个标识符时会影响到的文件
determine whether a given identifier belongs to the application or to an external library based on the accessibility and location of the header files that declare or define it
基于在头文件中的访问、定义和申明信息,判断某标识符在应用内定义或属于外部库
locate unused identifiers taking into account inter-project dependencies 基于项目的依赖定位未使用的标识符
create static call graphs that include the use of function-like macros 创建类似函数的宏的静态调用图
perform queries for identifiers based on their namespace, scope, reachability, and regular expressions of their name and the filename(s) they are found in, 基于namespace,scope,能否被访问,名字的正则表达式及文件名等,对标识符进行分类索引
perform queries for files, based on their metrics, or properties of the identifiers they contain 对文件中的标识符,基于他们的原型或属性进行索引
perform queries for functions and function like-macros, based on their metrics, their type and scope, the names of callers and callees, and the files they are declared in 对文件中的函数或类似函数的宏标识符,基于他们的原型、类型或作用范围、调用者或被调用者,以及申明他们的文件进行索引
monitor and report superfluously included header files 对多层included头文件进行监视或创建报告
visually identify parts of files that were skipped during preprocessing 对文件中被预处理中略过的部分进行可视化浏览
provide accurate metrics on functions, identifiers, and files 提供函数、标识符和文件准确的原型
More importantly, CScout helps you in refactoring code by identifying dead objects to remove, and automatically performing accurate global rename identifier refactorings, and various function argument refactorings. CScout will automatically rename identifiers
taking into account the namespace of each identifier: a renaming of a structure tag, member, or a statement label will not affect variables with the same name
respecting the scope of the renamed identifier: a rename can affect multiple files, or variables within a single block, exactly matching the semantics the C compiler would enforce
across multiple projects when the same identifier is defined in common shared include files
occuring in macro bodies and parts of other identifiers, when these are created through the C preprocessor's token concatenation feature
Furthermore, CScout allows you to refactor the arguments of functions and macros, introducing new arguments, deleting existing ones, or changing their order.
https://www.spinellis.gr/cscout/ https://www2.dmst.aueb.gr/dds/cscout/index.html https://github.com/dspinellis/cscout
还有一个工具叫Xrefactory,它可以分析c++程序。 cscout只能分析c程序。具体如下:
A tool adopting an approach similar to ours is Vittek's Xrefactory [59]. Its functionality is integrated with the Emacs editor [51]. Compared to CScout, Xrefactory supports C++, and thus also offers a number of additional refactorings: field and method moving, pushing down and pulling up fields and methods, and the encapsulation of fields. However, Xrefactory is unable to handle identifiers generated during the preprocessing stage; its author writes that deciding how to handle the renaming of an identifier that is constructed from parts of other identifiers is, in general, an unsolvable problem. The case refers to the renaming of the identifier sysctl_var_sdelay we showed in Section 2.1 into, say, foo. Vittek, correctly writes that there is no way to perform this renaming in a natural way. We sidestep this restriction by only allowing the renaming of an identifier's constituent parts. Thus, in this case, a CScout's user can rename individually the identifier's sysctl_var part and the sdelay part, with each renaming affecting the other corresponding parts in the program.
CScout is a source code analyzer and refactoring browser for collections of C programs. It can process workspaces of multiple projects (we define a project as a collection of C source files that are linked together) mapping the complexity introduced by the C preprocessor back into the original C source code files. CScout takes advantage of modern hardware advances (fast processors and large memory capacities) to analyze C source code beyond the level of detail and accuracy provided by current compilers, linkers, and other source code analyzers. The analysis CScout performs takes into account the identifier scopes introduced by the C preprocessor and the C language proper scopes and namespaces.
cscout是一个c语言代码的分析、重构和浏览工具。
CScout as a source code analyzer can:
annotate source code with hyperlinks to each identifier 在显示源代码的同时对每个标识符进行超链接标注
list files that would be affected by changing a specific identifier 显示修改某个标识符时会影响到的文件
determine whether a given identifier belongs to the application or to an external library based on the accessibility and location of the header files that declare or define it
基于在头文件中的访问、定义和申明信息,判断某标识符在应用内定义或属于外部库
locate unused identifiers taking into account inter-project dependencies 基于项目的依赖定位未使用的标识符
create static call graphs that include the use of function-like macros 创建类似函数的宏的静态调用图
perform queries for identifiers based on their namespace, scope, reachability, and regular expressions of their name and the filename(s) they are found in, 基于namespace,scope,能否被访问,名字的正则表达式及文件名等,对标识符进行分类索引
perform queries for files, based on their metrics, or properties of the identifiers they contain 对文件中的标识符,基于他们的原型或属性进行索引
perform queries for functions and function like-macros, based on their metrics, their type and scope, the names of callers and callees, and the files they are declared in 对文件中的函数或类似函数的宏标识符,基于他们的原型、类型或作用范围、调用者或被调用者,以及申明他们的文件进行索引
monitor and report superfluously included header files 对多层included头文件进行监视或创建报告
visually identify parts of files that were skipped during preprocessing 对文件中被预处理中略过的部分进行可视化浏览
provide accurate metrics on functions, identifiers, and files 提供函数、标识符和文件准确的原型
More importantly, CScout helps you in refactoring code by identifying dead objects to remove, and automatically performing accurate global rename identifier refactorings, and various function argument refactorings. CScout will automatically rename identifiers
taking into account the namespace of each identifier: a renaming of a structure tag, member, or a statement label will not affect variables with the same name
respecting the scope of the renamed identifier: a rename can affect multiple files, or variables within a single block, exactly matching the semantics the C compiler would enforce
across multiple projects when the same identifier is defined in common shared include files
occuring in macro bodies and parts of other identifiers, when these are created through the C preprocessor's token concatenation feature
Furthermore, CScout allows you to refactor the arguments of functions and macros, introducing new arguments, deleting existing ones, or changing their order.
相关文章推荐
- 翻译《有关编程、重构及其他的终极问题?》——5.使用工具去分析你的代码
- 让开发自动化持续重构 --使用静态分析工具识别代码味道
- 强大到令人发指的代码浏览分析工具understand
- 增加图形化报表,直观分析你的代码 - 代码统计工具 - 最新版3.3.91.79
- C语言学习趣事_BT_C_Code_混乱编程代码分析_1
- 代码阅读分析工具Understand 2.0试用
- 静态代码分析工具 Infer
- HTK工具HVite代码分析1
- 软件测试___findbugs静态代码分析工具认识
- 网络协议图形化分析工具EtherApe
- 代码分析工具总结(2014年9月)
- C++代码静态分析工具-Prefast
- 代码静态分析工具——splint的学习与使用(转)
- Python,django:用line_profiler工具分析代码的性能(一)
- StatSVN插件使用方法总结-项目代码分析工具 工作量图表生成工具
- PHP代码维护,重构变困难的4种原因分析
- 想做一个整合开源安全代码扫描工具的代码安全分析平台
- Java代码缺陷自动分析工具介绍
- 4个开源的Java代码静态分析工具
- 常用 Java 静态代码分析工具的分析与比较