Gendarme Tasks. Weekly Status Report #7

July 13, 2007

This is the status report for July 9 - July 13.

Accomplished this week.

This week, I have quasi finished the rule for detect long methods. Well, the rule simply count the IL instructions and compare with a MaxInstructions value. The big challenge for this rule has been choose the MaxInstruction value, this is because if you choose a little value you will get a lot of rule violations, and else if you choose a big value you won't get any violation. The two situations are useless.

As Chris Gameweld suggested me, I have to take care of the autogenerated methods too. The first approach try to find autogenerated methods simply if the IL code doesn't contain cond branches instructions. But this pattern isn't always true, by example Stetic generate a if statement. Then, I have collected some well known autogenerated method names, and checking them (and their types) I can know if a method is autogenerated.

I only have to check the types, and I will get the rule ready for the reviewing.

I also have proposed a new rule for a new smell. The rule is Detect Long Parameter List. The rule should check if a method contains a lot of parameters, and the big challenge will be (also) choose the value for the parameter numbers.

Plans for the next week.

Well, I have to finish the rules and go forward with more smells. I haven't decided yet what will be the next smell.

Challenges or problems.

None, for measure the methods I have chosen a little bit more of a screen. I have get the magic number rounding up to 170 IL instructions.

I have to get the upper limit for the long parameter list. But this time, I will measure and compare the results with some software metrics, because IMHO I can get better conclusions.

Interesting resources.

I have the same resources that the last week.

I want to thank to Lukasz Knop and to Chris Gameweld that suggest me measures, and some corner cases.