c语言的重构、清理与代码分析图形化浏览工具: CScout
网址:
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.
c语言的重构、清理与代码分析图形化浏览工具: CScout的更多相关文章
- 10个经典的C语言面试基础算法及代码
		
10个经典的C语言面试基础算法及代码作者:码农网 – 小峰 原文地址:http://www.codeceo.com/article/10-c-interview-algorithm.html 算法是一 ...
 - 如何重构"箭头型"代码
		
本文主要起因是,一次在微博上和朋友关于嵌套好几层的if-else语句的代码重构的讨论(微博原文),在微博上大家有各式各样的问题和想法.按道理来说这些都是编程的基本功,似乎不太值得写一篇文章,不过我觉得 ...
 - 使用策略模式重构switch case 代码
		
目录 1.背景 2.案例 3.switch…case…方式实现 4.switch…case…带来的问题 5.使用策略模式重构switch…case…代码 6.总结 1.背景 之前在看<重构 ...
 - js基石之---易读、易复用、易重构的 JavaScript 代码规范
		
易读.易复用.易重构的 JavaScript 代码规范 1.变量命名规范有意义 Bad: const yyyymmdstr = moment().format("YYYY/MM/DD&quo ...
 - 有了代码变更分解提交工具SmartCommit,再也不担心复合提交了
		
摘要:文将介绍一个代码提交辅助工具SmartCommit,其主要功能是通过杂糅变更分解算法自动生成分组提交方案,接受开发者的反馈和交互式调整,渐进式地引导和辅助开发者做出符合最佳实践的原子提交. 本文 ...
 - java代码分析及分析工具
		
一个项目从搭建开始,开发的初期往往思路比较清晰,代码也比较清晰.随着时间的推移,业务越来越复杂.代码也就面临着耦合,冗余,甚至杂乱,到最后谁都不敢碰. 作为一个互联网电子商务网站的业务支撑系统,业务复 ...
 - 【Lua】实现代码执行覆盖率统计工具
		
一.如何评估测试过程的测试情况? 很多时候完成功能测试后就会发布上线,甚至交叉和回归都没有足够的时间去执行,然后通过线上的补丁对遗漏的问题进行修复.如果可以在发布前了解本次测试过程所覆盖代码执行的比例 ...
 - 【原】Mac下统计任意文件夹中代码行数的工具——cloc
		
这里介绍一个Mac系统统计代码行数的工具cloc. 1.首先,安装homebrew,已安装的请跳过. 打开终端工具Terminal,输入下列命令.过程中会让你按RETURN键以及输入mac桌面密码,按 ...
 - 分析和解析PHP代码的7大工具
		
PHP已成为时下最热门的编程语言之一,然而却有许多PHP程序员苦恼找不到合适的工具来帮助自己分析和解析PHP代码.今天小编就为大家介绍几个非常不错的工具,来帮助程序员们提高自己的工作效率,一起来看看吧 ...
 
随机推荐
- 自学Aruba7.4-Aruba安全认证-MAC认证(web页面配置)
			
点击返回:自学Aruba之路 自学Aruba7.4-Aruba安全认证-MAC认证(web页面配置) 由于前三节已经讲述了3种如何web页面配置安全认证,MAC认证就不过多讲解重复的步骤. 步骤1 ...
 - 教程] 《开源框架-Afinal》之FinalHttp 01一步一脚
			
1.FinalHttp是什么 :FinalHttp 对 HttpClient再次封装,最简洁的就是增加了许多回调的方法,对Get 和 Post 请求进行了简化.另外一点就是FinalHttp加入线程池 ...
 - 洛谷P4383 林克卡特树
			
题意:树上最长不相交k条链. #include <cstdio> #include <algorithm> #include <cstring> typedef l ...
 - [luogu1327][生活大爆炸石头剪子布]
			
题目地址 https://www.luogu.org/problemnew/show/P1328 题目描述 石头剪刀布是常见的猜拳游戏:石头胜剪刀,剪刀胜布,布胜石头.如果两个人出拳一样,则不分胜负. ...
 - [luogu1351][联合权值]
			
题目地址 https://www.luogu.org/problemnew/show/P1351 题目描述 无向连通图G 有n 个点,n - 1 条边.点从1 到n 依次编号,编号为 i 的点的权值为 ...
 - python(六)——基本数据类型介绍
			
1.数字整形 python3不管数字有多大都是int型,没有long类型 1>字符串转换为数字 s1 = " print(type(s1),s1) b = int(s1)#不加base ...
 - findbugs的使用
			
我们通常都会在APP上线之后,发现各种错误,尤其是空指针异常,这些错误对于用户体验来说是非常不好的,但其实大部分的问题,我们都能够提前发现. 在编写代码的过程中,可能不会时时刻刻记得检查空的引用,还有 ...
 - 串口、COM口、TTL、RS-232、RS-485区别详解
			
1.串口.COM口是指的物理接口形式(硬件).而TTL.RS-232.RS-485是指的电平标准(电信号). 2.接设备的时候,一般只接GND RX TX.不会接Vcc或者+3.3v的电源线,避 ...
 - 谨记:new Date()在IOS中的坑
			
第一次遇到,记录一下 要创建一个指定时间的new Date对象时,通常的做法是: new Date("2018-04-27 11:11");然后就可以根据这个获取年月日等信息 这种 ...
 - JS中的数据类型和变量内存
			
1. JS中存在5种简单数据类型和1种复杂数据类型: 5种简单数据类型:Undefined, Null, Boolean, Number, String. 1种复杂数据类型:Object. 上面的5种 ...