Is it possible to split the warning "Use 'var' keyword when initializer explicitly declares type" based on the types of initializers? There are several possibilities that in my opinion are very different Proposed variants (if possible to differentiate):
Use 'var' keyword when invoking a constructor
DataTable table = new DataTable();
Use 'var' keyword when initializer casts result
DataTable table = (DataTable)someExpression;
Use 'var' keyword with return type is known
int ids = DB.GetIds(); // Note: Method returns int
My personal opinion is that "var" is not appropriate in the last one. While it's technically acceptable, it's not clear from looking the code what type the variable is unless you already know what the method returns. However, ReSharper doesn't differentiate between these three places where 'var' is possible so I can not turn off the third one without also turning off the first two.