c++14 - NLOC and Complexity numbers during Code Analysis
问题描述
I wrote a code for constructing an expression tree and traversing the tree in three different ways
a) Inorder traversal
b) Postorder Traversal
c) Level order Traversal
So, I wanted to know the complexity of my code and found this website which calculates it:
[ http://www.lizard.ws/ ]
These were the results:
Function Name NLOC Complexity Token # Parameter #
faw 10 6 51
push 12 2 61
pushp 12 2 61
pop 5 1 25
popp 5 1 25
inorder 9 2 38
postorder 9 2 38
printLevelOrder 7 2 40
printLevel 12 4 66
height 15 3 76
main 100 21 738
Question: What does NLOC and the numbers for complexity denote? Does having a high number mean, the code isn't well optimized?
解决方案
NLOC表示代码行数。例如这里针对push函数的值为12,NLOC告诉我们函数的大小。复杂度列表示每个函数代码的复杂度。
推荐阅读
- regex - 正则表达式组结果
- c# - 强制 google oauth 提示用户选择帐户
- c++ - Boost R-Tree中的最小边界矩形计算
- python - Python如何获取图像然后发布(通过请求库)
- java - 在 Java 中将列表列表转换为 HashTable
- weblogic11g - Weblogic 是否支持跨多个托管服务器的本地配置
- azure - 我可以提交一个天蓝色的日志查询来获取当前的日期时间吗?
- sql - SQL将日期“四舍五入”到一周中的给定日期
- ruby - 红宝石 1.8.7 RUBYOPT(运行时错误)
- woocommerce - 在 WooCommerce 产品页面中显示来自自定义 wp_editor 页面的内容