Hello Jesse,

Looks fine but can you move (or add*) the following bits of code in the
appropriate rocks: [VariableDefinition|
FieldReference].IsCompilerGenerated. 

The main problem is that it really is compiler generated and that the
results will vary based on the runtime, mono or MS* if using SRE, and/or
the compilers being used. This logic should be inside rocks so we can
quickly adapt them (rocks instead of rules) when bugs reports are
filled.

>          
> +               // The compiler will sometimes create locals to store 
> intermediate results, but we
> +               // don't want to count these because they have no visible 
> effect on the user's code.
> +               private bool IsUserLocal (string name)
> +               {
> +                       // Happens with code like `"foo " + foo`.
> +                       if (name.StartsWith ("V_"))
> +                               return false;
> +                       
> +                       return true;
> +               }
> +               
> +               private bool IsUserField (string name)
> +               {
> +                       // Linq expressions can write to fields like 
> "<>f__am$cacheD".
> +                       if (name.Contains ("$"))
> +                               return false;
> +                               
> +                       return true;
> +               }
> + 

Thanks,
Sebastien

* I wanted to check myself but my attention is required elsewhere at
the moment :(


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Gendarme" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gendarme?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to