On 23/11/2011 18:30, stephane ducasse wrote:

        
At my job we have several programming rules hat we check on pieces of code before integrating.
Some of these checks could be automated,
like what?
I will mention a couple, but they are just OUR programming rules, not intended to be universal... Most people would disagree with any of them.

We consider alarming if variable names (instance or local) have more than 2 words.
Selectors with many keywords (more than 2) are also suspects.

We don't allow complex arguments for messages. No parenthesis.
example:
test := aVariable between: (self calculateMin: arg) and: (self calculateMax: arg).

should be:
min := self calculateMin: arg.
max := self calculateMax: arg.
test := aVariable between: min and: max.

Code duplication and hard-coded constants must be avoided.

and so on...

I am not sure if it is interesting to know which particular rules we would like to check, but to think that there should be a place where I could define rules to check.

Best regards
--
signature

carlos e. ferro | senior developercaesar systems | see clearly. decide smarter.

ceferro@caesarsystems.com | t: +1.281.598.8790 | t: +54.11.4389.0126 | blog.caesarsystems.com | www.caesarsystems.com 

This message and any attached documents contain information from Caesar Systems LLC that may be confidential/trade secret and/or privileged. If you are not the intended recipient, you may not read, copy, distribute or use this information. If you have received this transmission in error, please notify the sender immediately by telephone or by reply e-mail and then delete this message.