* Accomplished this week.
Following the Sebastien’s wish, I have implemented the Avoid Speculative
Generality Rule, the rule is now for the reviewing process. This rule is
a large rule, because I should check several things.
The rule will check for abstract classes without responsability,
unnecesary delegation and I have a small solution for the problem with
the duplicated violations. I’m going to explain the problem, for
example, in the speculative generality smell, I have some signs for
detect this smell, one of them is that exists methods with unused
parameters (generally reserved parameters), then some weeks ago, I wrote
a rule for detect the unused parameters, then I will run gendarme and I
can get 2 errors:
1. The error produced by Avoid Speculative Generality Rule.
2. The error produced by the Avoid Unused Parameters Rule.
Then, when a detect a fail, the message should be clear and you should
find the error quickly. If you get 2 messages, produced by the same
error you can get confused with the errors.
Then, in the CheckType signature I get a TypeDefinition and a Runner.
The runner contains a property for retrieve the rules applied, then I
checked if the AvoidUnusedParameters rule will be executed (or has been
executed), and if the rule is present I will skip the checking in the
Avoid Speculative Generality rule.
* Plans for the next week.
Sadly, the Summer of Code starts to end. I should upload the code, but I
have a little bit of time for writting the next rule, I have posted the
specification for the Avoid Code Duplicated In Sibling Classes. As I
wrote other rule for check the code duplicated, I only should refactor
and get the rule.
* Challenges or problems.
Nothing special, the problem of the violations has been (half) fixed.
* Interesting resource.
This week, I haven’t any interesting resource.
Finally I want thank Sebastien, for give me advices and recomendations.
Néstor.
Looks like a worthy ending rule ;-)
Please have a look at the thread about committing your code, the date
seems to be today.
Yep, I know, at 19:00 UTC.
The rule is (quasi) finished, only I have to write a few tests and all
will be ready :)
Thanks for the reminder.
Néstor.