mgulubov / RestSharpHighQualityCodeTeamProject

Refactoring RestSharp Application - SoftUni High-Quality Code Teamwork Project
Apache License 2.0
0 stars 0 forks source link

Code Analysis: Globalization Warnings #4

Open mgulubov opened 9 years ago

mgulubov commented 9 years ago

The following Globalization Warnings appear, when Code Analysis is ran on the RestSharp project:

CA1305 Specify IFormatProvider Because the behavior of 'DateTimeOffset.Parse(string)' could vary based on the current user's locale settings, replace this call in 'XmlDeserializer.Map(object, XElement)' with a call to 'DateTimeOffset.Parse(string, IFormatProvider)'. If the result of 'DateTimeOffset.Parse(string, IFormatProvider)' will be based on input from the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will based on input stored and accessed by software, such as when it is loaded from disk or from a database, specify 'CultureInfo.InvariantCulture'. RestSharp XmlDeserializer.cs 225 CA1305 Specify IFormatProvider Because the behavior of 'StringWriter.StringWriter()' could vary based on the current user's locale settings, replace this call in 'DotNetXmlSerializer.EncodingStringWriter.EncodingStringWriter(Encoding)' with a call to 'StringWriter.StringWriter(IFormatProvider)'. If the result of 'StringWriter.StringWriter(IFormatProvider)' will be based on input from the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will based on input stored and accessed by software, such as when it is loaded from disk or from a database, specify 'CultureInfo.InvariantCulture'. RestSharp DotNetXmlSerializer.cs 82 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object)' could vary based on the current user's locale settings, replace this call in 'HttpEncoder.EncodeHeaderString(string)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp HtmlEncoder.cs 158 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object)' could vary based on the current user's locale settings, replace this call in 'Http.GetMultipartFormContentType()' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp Http.cs 261 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, params object[])' could vary based on the current user's locale settings, replace this call in 'Http.GetMultipartFileHeader(HttpFile)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp Http.cs 266 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, params object[])' could vary based on the current user's locale settings, replace this call in 'Http.GetMultipartFormData(HttpParameter)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp Http.cs 276 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object, object)' could vary based on the current user's locale settings, replace this call in 'Http.GetMultipartFooter()' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp Http.cs 281 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToInt32(string)' could vary based on the current user's locale settings, replace this call in 'Http.AddRange(HttpWebRequest, string)' with a call to 'Convert.ToInt32(string, IFormatProvider)'. If the result of 'Convert.ToInt32(string, IFormatProvider)' will be based on input from the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will based on input stored and accessed by software, such as when it is loaded from disk or from a database, specify 'CultureInfo.InvariantCulture'. RestSharp Http.cs 485 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToInt32(string)' could vary based on the current user's locale settings, replace this call in 'Http.AddRange(HttpWebRequest, string)' with a call to 'Convert.ToInt32(string, IFormatProvider)'. If the result of 'Convert.ToInt32(string, IFormatProvider)' will be based on input from the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will based on input stored and accessed by software, such as when it is loaded from disk or from a database, specify 'CultureInfo.InvariantCulture'. RestSharp Http.cs 486 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToInt64(string)' could vary based on the current user's locale settings, replace this call in 'Http.AddSyncHeaderActions()' with a call to 'Convert.ToInt64(string, IFormatProvider)'. If the result of 'Convert.ToInt64(string, IFormatProvider)' will be based on input from the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will based on input stored and accessed by software, such as when it is loaded from disk or from a database, specify 'CultureInfo.InvariantCulture'. RestSharp Http.Sync.cs 152 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToDateTime(string)' could vary based on the current user's locale settings, replace this call in 'Http.AddSyncHeaderActions()' with a call to 'Convert.ToDateTime(string, IFormatProvider)'. If the result of 'Convert.ToDateTime(string, IFormatProvider)' will be based on input from the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will based on input stored and accessed by software, such as when it is loaded from disk or from a database, specify 'CultureInfo.InvariantCulture'. RestSharp Http.Sync.cs 154 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object, object)' could vary based on the current user's locale settings, replace this call in 'HttpBasicAuthenticator.HttpBasicAuthenticator(string, string)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp HttpBasicAuthenticator.cs 29 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object)' could vary based on the current user's locale settings, replace this call in 'HttpBasicAuthenticator.HttpBasicAuthenticator(string, string)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp HttpBasicAuthenticator.cs 30 CA1307 Specify StringComparison Because the behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings, replace this call in 'OAuth1Authenticator.AddOAuthData(IRestClient, IRestRequest, OAuthWorkflow)' with a call to 'string.StartsWith(string, StringComparison)'. If the result of 'string.StartsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp OAuth1Authenticator.cs 223 CA1307 Specify StringComparison Because the behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings, replace this call in 'OAuth1Authenticator.AddOAuthData(IRestClient, IRestRequest, OAuthWorkflow)' with a call to 'string.StartsWith(string, StringComparison)'. If the result of 'string.StartsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp OAuth1Authenticator.cs 229 CA1307 Specify StringComparison Because the behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings, replace this call in 'OAuth1Authenticator.AddOAuthData(IRestClient, IRestRequest, OAuthWorkflow)' with a call to 'string.StartsWith(string, StringComparison)'. If the result of 'string.StartsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp OAuth1Authenticator.cs 271 CA1307 Specify StringComparison Because the behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings, replace this call in 'OAuth1Authenticator.AddOAuthData(IRestClient, IRestRequest, OAuthWorkflow)' with a call to 'string.StartsWith(string, StringComparison)'. If the result of 'string.StartsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp OAuth1Authenticator.cs 271 CA1307 Specify StringComparison Because the behavior of 'string.CompareTo(string)' could vary based on the current user's locale settings, replace this call in 'OAuth1Authenticator.GetAuthorizationHeader(WebPairCollection)' with a call to 'string.Compare(string, string, StringComparison)'. If the result of 'string.Compare(string, string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp OAuth1Authenticator.cs 292 CA1307 Specify StringComparison Because the behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings, replace this call in 'OAuth1Authenticator.GetAuthorizationHeader(WebPairCollection)' with a call to 'string.StartsWith(string, StringComparison)'. If the result of 'string.StartsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp OAuth1Authenticator.cs 296 CA1307 Specify StringComparison Because the behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings, replace this call in 'OAuth1Authenticator.GetAuthorizationHeader(WebPairCollection)' with a call to 'string.StartsWith(string, StringComparison)'. If the result of 'string.StartsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp OAuth1Authenticator.cs 296 CA1304 Specify CultureInfo Because the behavior of 'string.ToUpper()' could vary based on the current user's locale settings, replace this call in 'OAuthExtensions.ToRequestValue(this OAuthSignatureMethod)' with a call to 'string.ToUpper(CultureInfo)'. If the result of 'string.ToUpper(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp OAuthExtensions.cs 11 CA1307 Specify StringComparison Because the behavior of 'string.IndexOf(string)' could vary based on the current user's locale settings, replace this call in 'OAuthExtensions.ToRequestValue(this OAuthSignatureMethod)' with a call to 'string.IndexOf(string, StringComparison)'. If the result of 'string.IndexOf(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp OAuthExtensions.cs 12 CA1305 Specify IFormatProvider Because the behavior of 'long.ToString()' could vary based on the current user's locale settings, replace this call in 'OAuthTools.GetTimestamp(DateTime)' with a call to 'long.ToString(IFormatProvider)'. If the result of 'long.ToString(IFormatProvider)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp OAuthTools.cs 84 CA1304 Specify CultureInfo Because the behavior of 'string.ToUpper()' could vary based on the current user's locale settings, replace this call in 'OAuthTools.ConcatenateRequestElements(string, string, WebParameterCollection)' with a call to 'string.ToUpper(CultureInfo)'. If the result of 'string.ToUpper(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp OAuthTools.cs 233 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object, object)' could vary based on the current user's locale settings, replace this call in 'Parameter.ToString()' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp Parameter.cs 45 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ChangeType(object, Type)' could vary based on the current user's locale settings, replace this call in 'ReflectionExtensions.ChangeType(this object, Type)' with a call to 'Convert.ChangeType(object, Type, IFormatProvider)'. If the result of 'Convert.ChangeType(object, Type, IFormatProvider)' will be based on input from the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will based on input stored and accessed by software, such as when it is loaded from disk or from a database, specify 'CultureInfo.InvariantCulture'. RestSharp ReflectionExtensions.cs 77 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object)' could vary based on the current user's locale settings, replace this call in 'RestClient.BuildUri(IRestRequest)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp RestClient.cs 296 CA1307 Specify StringComparison Because the behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings, replace this call in 'RestClient.BuildUri(IRestRequest)' with a call to 'string.StartsWith(string, StringComparison)'. If the result of 'string.StartsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp RestClient.cs 309 CA1307 Specify StringComparison Because the behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings, replace this call in 'RestClient.BuildUri(IRestRequest)' with a call to 'string.EndsWith(string, StringComparison)'. If the result of 'string.EndsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp RestClient.cs 316 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object, object)' could vary based on the current user's locale settings, replace this call in 'RestClient.BuildUri(IRestRequest)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp RestClient.cs 319 CA1308 Normalize strings to uppercase In method 'RestClient.ConfigureHttp(IRestRequest, IHttp)', replace the call to 'string.ToLowerInvariant()' with String.ToUpperInvariant(). RestSharp RestClient.cs 390 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToString(object)' could vary based on the current user's locale settings, replace this call in 'RestClient.ConfigureHttp(IRestRequest, IHttp)' with a call to 'Convert.ToString(object, IFormatProvider)'. If the result of 'Convert.ToString(object, IFormatProvider)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp RestClient.cs 440 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToString(object)' could vary based on the current user's locale settings, replace this call in 'RestClient.ConfigureHttp(IRestRequest, IHttp)' with a call to 'Convert.ToString(object, IFormatProvider)'. If the result of 'Convert.ToString(object, IFormatProvider)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp RestClient.cs 453 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToString(object)' could vary based on the current user's locale settings, replace this call in 'RestClient.ConfigureHttp(IRestRequest, IHttp)' with a call to 'Convert.ToString(object, IFormatProvider)'. If the result of 'Convert.ToString(object, IFormatProvider)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp RestClient.cs 467 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToString(object)' could vary based on the current user's locale settings, replace this call in 'RestClient.ConfigureHttp(IRestRequest, IHttp)' with a call to 'Convert.ToString(object, IFormatProvider)'. If the result of 'Convert.ToString(object, IFormatProvider)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp RestClient.cs 507 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToString(object)' could vary based on the current user's locale settings, replace this call in 'RestClient.ConfigureHttp(IRestRequest, IHttp)' with a call to 'Convert.ToString(object, IFormatProvider)'. If the result of 'Convert.ToString(object, IFormatProvider)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp RestClient.cs 511 CA1304 Specify CultureInfo Because the behavior of 'string.ToLower()' could vary based on the current user's locale settings, replace this call in 'SerializeAsAttribute.TransformName(string)' with a call to 'string.ToLower(CultureInfo)'. If the result of 'string.ToLower(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp SerializeAsAttribute.cs 81 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, params object[])' could vary based on the current user's locale settings, replace this call in 'StringExtensions.FormatWith(this string, params object[])' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp StringExtensions.cs 30 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object)' could vary based on the current user's locale settings, replace this call in 'StringExtensions.PercentEncode(this string)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp StringExtensions.cs 75 CA1307 Specify StringComparison Because the behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings, replace this call in 'StringExtensions.ParseQueryString(this string)' with a call to 'string.StartsWith(string, StringComparison)'. If the result of 'string.StartsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp StringExtensions.cs 83 CA1305 Specify IFormatProvider Because the behavior of 'long.Parse(string)' could vary based on the current user's locale settings, replace this call in 'StringExtensions.ParseJsonDate(this string, CultureInfo)' with a call to 'long.Parse(string, IFormatProvider)'. If the result of 'long.Parse(string, IFormatProvider)' will be based on input from the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will based on input stored and accessed by software, such as when it is loaded from disk or from a database, specify 'CultureInfo.InvariantCulture'. RestSharp StringExtensions.cs 130 CA1307 Specify StringComparison Because the behavior of 'string.StartsWith(string)' could vary based on the current user's locale settings, replace this call in 'StringExtensions.RemoveSurroundingQuotes(this string)' with a call to 'string.StartsWith(string, StringComparison)'. If the result of 'string.StartsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp StringExtensions.cs 162 CA1307 Specify StringComparison Because the behavior of 'string.EndsWith(string)' could vary based on the current user's locale settings, replace this call in 'StringExtensions.RemoveSurroundingQuotes(this string)' with a call to 'string.EndsWith(string, StringComparison)'. If the result of 'string.EndsWith(string, StringComparison)' will be displayed to the user, such as when sorting a list of items for display in a list box, specify 'StringComparison.CurrentCulture' or 'StringComparison.CurrentCultureIgnoreCase' as the 'StringComparison' parameter. If comparing case-insensitive identifiers, such as file paths, environment variables, or registry keys and values, specify 'StringComparison.OrdinalIgnoreCase'. Otherwise, if comparing case-sensitive identifiers, specify 'StringComparison.Ordinal'. RestSharp StringExtensions.cs 162 CA1305 Specify IFormatProvider Because the behavior of 'Convert.ToInt64(string)' could vary based on the current user's locale settings, replace this call in 'StringExtensions.ExtractDate(string, string, CultureInfo)' with a call to 'Convert.ToInt64(string, IFormatProvider)'. If the result of 'Convert.ToInt64(string, IFormatProvider)' will be based on input from the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will based on input stored and accessed by software, such as when it is loaded from disk or from a database, specify 'CultureInfo.InvariantCulture'. RestSharp StringExtensions.cs 226 CA1304 Specify CultureInfo Because the behavior of 'string.ToLower()' could vary based on the current user's locale settings, replace this call in 'StringExtensions.MakeInitialLowerCase(this string)' with a call to 'string.ToLower(CultureInfo)'. If the result of 'string.ToLower(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp StringExtensions.cs 331 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object)' could vary based on the current user's locale settings, replace this call in 'StringExtensions.AddUnderscorePrefix(this string)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp StringExtensions.cs 383 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object, object, object)' could vary based on the current user's locale settings, replace this call in 'Validate.IsBetween(int, int, int)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp Validate.cs 36 CA1305 Specify IFormatProvider Because the behavior of 'string.Format(string, object)' could vary based on the current user's locale settings, replace this call in 'Validate.IsValidLength(string, int)' with a call to 'string.Format(IFormatProvider, string, params object[])'. If the result of 'string.Format(IFormatProvider, string, params object[])' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'IFormatProvider' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp Validate.cs 52 CA1304 Specify CultureInfo Because the behavior of 'string.ToLower()' could vary based on the current user's locale settings, replace this call in 'XmlDeserializer.Map(object, XElement)' with a call to 'string.ToLower(CultureInfo)'. If the result of 'string.ToLower(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp XmlDeserializer.cs 166 CA1304 Specify CultureInfo Because the behavior of 'string.ToLower()' could vary based on the current user's locale settings, replace this call in 'XmlDeserializer.HandleListDerivative(object, XElement, string, Type)' with a call to 'string.ToLower(CultureInfo)'. If the result of 'string.ToLower(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp XmlDeserializer.cs 348 CA1304 Specify CultureInfo Because the behavior of 'string.ToLower()' could vary based on the current user's locale settings, replace this call in 'XmlDeserializer.HandleListDerivative(object, XElement, string, Type)' with a call to 'string.ToLower(CultureInfo)'. If the result of 'string.ToLower(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp XmlDeserializer.cs 365 CA1304 Specify CultureInfo Because the behavior of 'string.ToLower()' could vary based on the current user's locale settings, replace this call in 'XmlDeserializer.GetElementByName(XElement, XName)' with a call to 'string.ToLower(CultureInfo)'. If the result of 'string.ToLower(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp XmlDeserializer.cs 433 CA1304 Specify CultureInfo Because the behavior of 'string.ToLower()' could vary based on the current user's locale settings, replace this call in 'XmlDeserializer.GetElementByName(XElement, XName)' with a call to 'string.ToLower(CultureInfo)'. If the result of 'string.ToLower(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp XmlDeserializer.cs 462 CA1304 Specify CultureInfo Because the behavior of 'string.ToLower()' could vary based on the current user's locale settings, replace this call in 'XmlDeserializer.GetAttributeByName(XElement, XName)' with a call to 'string.ToLower(CultureInfo)'. If the result of 'string.ToLower(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp XmlDeserializer.cs 467 CA1304 Specify CultureInfo Because the behavior of 'string.ToLower()' could vary based on the current user's locale settings, replace this call in 'XmlSerializer.GetSerializedValue(object)' with a call to 'string.ToLower(CultureInfo)'. If the result of 'string.ToLower(CultureInfo)' will be displayed to the user, specify 'CultureInfo.CurrentCulture' as the 'CultureInfo' parameter. Otherwise, if the result will be stored and accessed by software, such as when it is persisted to disk or to a database, specify 'CultureInfo.InvariantCulture'. RestSharp XmlSerializer.cs 205