<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[<h2 id="开源代码阅读文档工具" class="headerLink">
    <a href="#%e5%bc%80%e6%ba%90%e4%bb%a3%e7%a0%81%e9%98%85%e8%af%bb%e6%96%87%e6%a1%a3%e5%b7%a5%e5%85%b7" class="header-mark"></a>开源代码阅读文档工具</h2><ul>
<li><a href="https://github.com/doxygen/doxygen" target="_blank" rel="noopener noreferrer">doxygen</a></li>
<li><a href="https://github.com/CoatiSoftware/Sourcetrail" target="_blank" rel="noopener noreferrer">Sourcetrail</a></li>
</ul>]]></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[<h1 id="代码风格最佳实践" class="headerLink">
    <a href="#%e4%bb%a3%e7%a0%81%e9%a3%8e%e6%a0%bc%e6%9c%80%e4%bd%b3%e5%ae%9e%e8%b7%b5" class="header-mark"></a>代码风格最佳实践</h1><p>下面收录了一些 代码风格比较好，值得学习的开源项目</p>
<h2 id="c" class="headerLink">
    <a href="#c" class="header-mark"></a>C++</h2><ul>
<li><a href="https://github.com/google/leveldb" target="_blank" rel="noopener noreferrer">LevelDB </a> Google出品，作者是 Jeff Dean 大神。</li>
<li><a href="https://github.com/chenshuo/muduo" target="_blank" rel="noopener noreferrer">Muduo: is a multithreaded C++ network library based on the reactor pattern.</a></li>
<li><a href="https://github.com/abseil/abseil-cpp" target="_blank" rel="noopener noreferrer">Abseil - C++ Common Libraries</a> Google内部的C++轮子库，各种基础能力都包含，值得学习</li>
<li><a href="https://github.com/facebook/folly" target="_blank" rel="noopener noreferrer">Folly: Facebook Open-source Library</a> Facebook内部的轮子库，线程池、内存池、异步IO、executor等，应有尽有</li>
<li><a href="https://github.com/godotengine/godot" target="_blank" rel="noopener noreferrer">Godot – Multi-platform 2D and 3D game engine</a></li>
<li><a href="https://github.com/chromium/chromium" target="_blank" rel="noopener noreferrer">Chromium</a> google浏览器源码仓库，包括edge等很多浏览器和应用都会基于chromium二次开发</li>
</ul>]]></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><![CDATA[<h1 id="代码覆盖率" class="headerLink">
    <a href="#%e4%bb%a3%e7%a0%81%e8%a6%86%e7%9b%96%e7%8e%87" class="header-mark"></a>代码覆盖率</h1><p>代码覆盖率是软件测试中的一种度量，描述程序中源代码被测试的比例和程度，所得比例称为代码覆盖率 。</p>
<p>代码覆盖率指标通常包含下面几类：</p>
<ul>
<li>函数/方法覆盖率：函数/方法中有多少被调用到</li>
<li>分支覆盖率：有多少控制结构的分支（例如if语句）被执行</li>
<li>条件覆盖率：有多少布尔子表达式被测试为真值和假值</li>
<li>行覆盖率：有多少行的源代码被测试过</li>
</ul>
<p><strong>代码覆盖率的意义</strong></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[<h1 id="函数调用关系绘制" class="headerLink">
    <a href="#%e5%87%bd%e6%95%b0%e8%b0%83%e7%94%a8%e5%85%b3%e7%b3%bb%e7%bb%98%e5%88%b6" class="header-mark"></a>函数调用关系绘制</h1><h2 id="简介" class="headerLink">
    <a href="#%e7%ae%80%e4%bb%8b" class="header-mark"></a>简介</h2><p>cflow是一款静态分析C语言代码的工具，通过它可以生成函数调用关系。</p>
<p>该工具能够生成两种图：直接图和反向图。直接图以main函数(main)开始，递归地显示它调用的所有函数。相反，反向图是一组子图，以相反的顺序为每个函数的调用者绘制图表。由于它们的树状外观，图也可以称为树。</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[<h1 id="详解圈复杂度" class="headerLink">
    <a href="#%e8%af%a6%e8%a7%a3%e5%9c%88%e5%a4%8d%e6%9d%82%e5%ba%a6" class="header-mark"></a>详解圈复杂度</h1><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)是一种代码复杂度的衡量标准，在1976年由Thomas J. McCabe, Sr. 提出，目标是为了指导程序员写出更具可测性和可维护性的代码。</p>]]></description></item></channel></rss>