Forum OpenACS Development: Re: wiki code metrics for packages, add standards metrics?

Collapse
Posted by Gustaf Neumann on
Hi Ben,

the more general coding guidelines page is [1]. Several of the mentioned code metrics are implemented since many years on the OpenACS web site for all packages (see e.g. [2]). Of course, more metrics can be added. Much of the work invested into OpenACS over the last three years went into improving code quality, such as removing obsolete idioms, deprecated functions, dead code, unused .xql statements, security concerns, obsolete coding practices, etc. This affects and Tcl/HTML/SQL (e.g. in much of the PostgreSQL code was developed having pg7 or earlier in mind). I was in many place reluctant with code reformatting according to the guidelines, since such a change makes it quite hard for installations with locally modified code to merge the code. Furthermore, several of the quality measures above are hard to quantify.

I am not sure, how many people look a t the code metrics, but it can be certainly improved. There are as well several "code smell detectors" in automated testing (e.g. checking naming conventions, comments, etc.). I am not sure, how many people are actively using automated testing. Improving this is as well worthwhile.

Anyhow, it is certainly possible to add various code metrics to e.g. the package manager (e.g. before making e.g. an .apm file) or the the OpenACS site. Contributions are always welcome.

-g

[1] http://openacs.org/xowiki/coding-standards-index
[2] http://openacs.org/xowiki/acs-subsite

Collapse
Posted by Benjamin Brink on
Thank you, Gustaf. I can appreciate the need to weigh changes vs. integration with existing code. Having re-factored thousands of lines of my own code, I can see how significant changes easily fit into a major number upgrade. At some point I imagine next script will contain the majority of new code.

I use automated testing, but wasn't aware of the code compliance tests. I'll investigate, and see if there is anything I can contribute to fostering practical coding standards.
cheers,
Ben