搜档网
当前位置:搜档网 › Source Insight 中查看函数的复杂度

Source Insight 中查看函数的复杂度

Source Insight 中查看函数的复杂度
Source Insight 中查看函数的复杂度

目的

在Source Insight中添加快捷键来查询函数的复杂度

前提

安装了Source Insight

安装了Source Monitor工具

操作及说明

1.在SourceInsight的“options”-->“custom commands..”中添加如下命令:

"D:\Program Files\SourceMonitor\SourceMonitor.exe" /DC %s

1)""内代表Source Monitor的安装路径

2) /DC :需要根据不同的语言取不同的值

/DC (or /D-C) for C

/DC++ (or /D-C++) for C++

/DCs or /DC# (or /D-Cs or /D-C#) for C#

/DJava (or /D-Java) for Java

/DDelphi (or /D-Delphi) for Object Pascal

/DVB (or /D-VB) for Visual Basic 6

/DVBNET (or /D-VBNET) for https://www.sodocs.net/doc/249996836.html,

/DHTML for HTML

3) 参数:

%s表示 name of a temp file where the current selection is saved while the custom co %f表示度量当前文件,而不是当前函数的圈复杂度,可在Run命令参数中把 %s 改为 %f

**执行Add和RUN保存Command

2、为命令分配快捷键和菜单

可以通过“Keys...”键给该命令指定快捷键,例如“F11”,然后点 Close。

可以通过“Menu...”键给该命令指定菜单项,例如插在“Work”菜单项下。

3、查看圈复杂度 通过双击 Symbol Window 里的函数名以便选中整个函数体,然后按F11键

le the custom command runs. 数中把 %s 改为 %f

后按F11键

相关主题