What about:
public static StreamWriter GetTemporaryFileForCustomer(string customerId)
{
string tempFileName = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName + "\\" + customerId + ".tmp";
if(File.Exists(tempFileName))
return File.AppendText(tempFileName,true);
else
return File.CreateText(tempFileName);
}
customerId is said to violate the rule, although the variable is needed to carry out the logic. What alternative could be provided to satisfy the rule?