FXCOP
Thanks
Update: Updated to include the OpCode.Jmp instruction.
Sounds like you could be using my AvoidComplicatedMethods rule and you have not included the RuleHelper class.
Anyway here is its implementation:
public static bool IsMethodCall(Instruction instruction) switch (instruction.OpCode) return false; |
I'm sure you've omitted the latter intentionally, just pointing this out for others who might grab this helper code for another purpose. 8)
Michael
Michael,
Didn't know about the Jmp instruction (my IL is still a bit lacking - still waiting for my copy of Inside Microsoft .NET IL Assembler), however as you stated I did omit the NewObj intentionally. Will update the rule to check for the Jmp instruction.
Do you know of any language that uses the Jmp instruction?
My AvoidComplicatedMethods rule really needs to be rewritten to take into account the cyclomatic complexity of a method rather than simply counting the number of method calls within it. There are a number of tools out there to measure this, so I might investigate this further.
David
We'd also like to develop some analysis that accounts for other interesting test-related metrics, such as Halstead statistics. Another interesting idea for you to consider taking on in the future.
Nearly forgot to mention: I am not aware of a compiler that actually emits the jmp opcode, but I haven't investigated very deeply. I'll send a mail to a couple of IL experts here to see if they have any information on this.
Michael