什么code公制(S)说服你提供code是"蹩脚的"? [英] What code metric(s) convince you that provided code is "crappy"?

查看:166
本文介绍了什么code公制(S)说服你提供code是"蹩脚的"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$ C每个文件$ C线,每班,圈复杂度等方法。开发商抵制和解决方法大多数如果不是所有的人!有好就可以了乔尔文章(没时间,现在找到它)。

Code lines per file, methods per class, cyclomatic complexity and so on. Developers resist and workaround most if not all of them! There is a good Joel article on it (no time to find it now).

C $Ç指标()你推荐什么$用于为自动确定蹩脚code?

What code metric(s) you recommend for use to automatically identify "crappy code"?

什么能说服大多数(你不能我们所有的说服一些蹩脚的指标:O))的开发人员,这code是废话

What can convince most (you can't convince all of us to some crappy metric! :O) ) of developers that this code is "crap".

仅可自动测量计数度量!

Only metrics that can be automatically measured counts!

推荐答案

有关编码风格没有指标是这样的警告的一部分。

No metrics regarding coding-style are part of such a warning.

对于我来说,是关于的code ,它可以真正成为'上'所有的时间静态分析:

For me it is about static analysis of the code, which can truly be 'on' all the time:

  • cyclomatic complexity (detected by checkstyle)
  • dependency cycle detection (through findbugs for instance)
  • critical errors detected by, for instance findbugs.

我把覆盖测试中的第二步骤中,这样的测试可能需要一段时间。

I would put coverage test in a second step, as such tests can take time.


不要忘了,糟糕的code不受指标检测,而是通过的组合的和的进化的(如趋势):请参见什么是$ C的魅力$ C指标?问题。

Do not forget that "crappy" code are not detected by metrics, but by the combination and evolution (as in "trend) of metrics: see the What is the fascination with code metrics? question.

这意味着你不必只推荐code指标为自动识别蹩脚code,但你也有推荐的正确组合和趋势分析沿这些指标去。

That means you do not have just to recommend code metrics to "automatically identify "crappy code"", but you also have to recommend the right combination and trend analysis to go along those metrics.


在一个旁注,我分享你的<一个href=\"http://stackoverflow.uservoice.com/pages/general/suggestions/35815?tracking_$c$c=3c7fc7632b4236f09130fc94064937c2\">frustration ;),我不同意的观点tloach的(在另一个答案的评论点)问一个模糊的问题,得到一个模糊的回答。他说......你的问题应该有一个明确的答案

On a sidenote, I do share your frustration ;), and I do not share the point of view of tloach (in the comments of another answers) "Ask a vague question, get a vague answer" he says... your question deserve a specific answer.

这篇关于什么code公制(S)说服你提供code是&QUOT;蹩脚的&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆