<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Code - 标签 - 研发日志 · R&amp;D Log</title><link>https://rd163.visword.com/tags/code/</link><description>Code - 标签 - 研发日志 · R&amp;D Log</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>whutluohui@gmail.com (小智晖)</managingEditor><webMaster>whutluohui@gmail.com (小智晖)</webMaster><copyright>本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。</copyright><lastBuildDate>Sun, 20 Apr 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://rd163.visword.com/tags/code/" rel="self" type="application/rss+xml"/><item><title>代码阅读工具</title><link>https://rd163.visword.com/posts/source-code-explore/</link><pubDate>Sun, 20 Apr 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/source-code-explore/</guid><description><![CDATA[<p>阅读陌生代码库是工程师日常工作的重要组成部分。面对动辄数十万行的源码,仅靠编辑器内置的跳转和搜索往往难以快速建立全局认知。围绕「理解代码」这一需求,开源社区沉淀出两类工具:一类以 <strong>Doxygen</strong> 为代表,侧重从源码与注释中<strong>抽取并生成文档</strong>;另一类以 <strong>Sourcetrail</strong> 为代表,侧重提供<strong>交互式的源码浏览器</strong>,帮助人在图形界面中追踪符号与调用关系。本文对这两款工具做一次梳理。</p>]]></description></item><item><title>代码风格最佳实践</title><link>https://rd163.visword.com/posts/best-practice-for-code-style/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/best-practice-for-code-style/</guid><description><![CDATA[<p>代码风格（code style）不是格式化工具跑出来的最终样式，而是一套贯穿命名、接口、注释、文件组织与错误处理的工程习惯。好的代码风格让代码&quot;为读者而写&quot;(optimize for the reader),在团队成员流动、代码规模膨胀时仍可维护。最有效的学习方式之一，是去读那些被工业界长期验证、口碑极佳的开源项目源码——本文先罗列一批值得精读的项目，再从它们身上归纳几条可复用的实践。</p>]]></description></item><item><title>代码覆盖率</title><link>https://rd163.visword.com/posts/code-coverage/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/code-coverage/</guid><description>&lt;p>代码覆盖率（Code Coverage）是软件测试中的一种度量方式，用于描述程序中源代码被测试执行到的比例和程度，所得比例即为代码覆盖率。&lt;/p>
&lt;p>代码覆盖率指标通常包含下面几类：&lt;/p></description></item><item><title>函数调用关系绘制</title><link>https://rd163.visword.com/posts/function-call-drawing/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/function-call-drawing/</guid><description><![CDATA[<h2 id="简介" class="headerLink">
    <a href="#%e7%ae%80%e4%bb%8b" class="header-mark"></a>简介</h2><p><a href="https://www.gnu.org/software/cflow/" target="_blank" rel="noopener noreferrer">cflow</a> 是 GNU 项目维护的一款 C 语言静态分析（static analysis）工具，能够扫描源码并生成函数之间的调用关系图（call graph）。它不需要运行程序，仅依赖源代码本身，因此非常适合用于梳理陌生代码库、排查遗留项目或为代码写文档。</p>]]></description></item><item><title>详解圈复杂度</title><link>https://rd163.visword.com/posts/code-cyclomatic-complexity/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/code-cyclomatic-complexity/</guid><description><![CDATA[<h2 id="什么是圈复杂度" class="headerLink">
    <a href="#%e4%bb%80%e4%b9%88%e6%98%af%e5%9c%88%e5%a4%8d%e6%9d%82%e5%ba%a6" class="header-mark"></a>什么是圈复杂度?</h2><p>圈复杂度（Cyclomatic Complexity）是一种代码复杂度的衡量标准，由 Thomas J. McCabe, Sr. 于 1976 年在论文 <em>A Complexity Measure</em>(IEEE Transactions on Software Engineering, SE-2(4): 308-320)中提出，目的是指导程序员写出更具可测性和可维护性的代码。</p>]]></description></item></channel></rss>