The following Code Analysis Usage Warnings appear in the RestSharp project:
CA2202 Do not dispose objects multiple times Object 'this' can be disposed more than once in method 'Http.ExtractResponseData(HttpResponse, HttpWebResponse)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 459 RestSharp Http.cs 459
CA2227 Collection properties should be read only Change 'Http.ClientCertificates' to be read-only by removing the property setter. RestSharp Http.cs 136
CA2201 Do not raise reserved exception types 'HttpUtility.HtmlAttributeEncode(string, TextWriter)' creates an exception of type 'NullReferenceException', an exception type that is reserved by the runtime and should never be raised by managed code. If this exception instance might be thrown, use a different exception type. RestSharp HttpUtility.cs 87
CA2201 Do not raise reserved exception types 'HttpUtility.HtmlDecode(string, TextWriter)' creates an exception of type 'NullReferenceException', an exception type that is reserved by the runtime and should never be raised by managed code. If this exception instance might be thrown, use a different exception type. RestSharp HttpUtility.cs 575
CA2201 Do not raise reserved exception types 'HttpUtility.HtmlEncode(string, TextWriter)' creates an exception of type 'NullReferenceException', an exception type that is reserved by the runtime and should never be raised by managed code. If this exception instance might be thrown, use a different exception type. RestSharp HttpUtility.cs 617
CA2227 Collection properties should be read only Change 'IHttp.ClientCertificates' to be read-only by removing the property setter. RestSharp IHttp.cs 56
CA2227 Collection properties should be read only Change 'IRestClient.ClientCertificates' to be read-only by removing the property setter. RestSharp IRestClient.cs 75
CA2208 Instantiate argument exceptions correctly Call the 'ArgumentOutOfRangeException' constructor that contains a message and/or paramName parameter. RestSharp OAuth1Authenticator.cs 257
CA2208 Instantiate argument exceptions correctly Call the 'ArgumentOutOfRangeException' constructor that contains a message and/or paramName parameter. RestSharp OAuth1Authenticator.cs 279
CA1801 Review unused parameters Parameter 'signatureBase' of 'OAuthTools.GetSignature(OAuthSignatureMethod, string, string, string)' is never used. Remove the parameter or use it in the method body. RestSharp OAuthTools.cs 283
CA2227 Collection properties should be read only Change 'RestClient.ClientCertificates' to be read-only by removing the property setter. RestSharp RestClient.cs 57
CA2214 Do not call overridable methods in constructors 'RestClient.RestClient(Uri)' contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences:
RestClient..ctor(Uri)
RestClient.set_BaseUrl(Uri):Void RestSharp RestClient.cs 154
CA2214 Do not call overridable methods in constructors 'RestClient.RestClient(string)' contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences:
RestClient..ctor(String)
RestClient.set_BaseUrl(Uri):Void RestSharp RestClient.cs 163
CA2201 Do not raise reserved exception types 'RestClient.BuildUri(IRestRequest)' creates an exception of type 'NullReferenceException', an exception type that is reserved by the runtime and should never be raised by managed code. If this exception instance might be thrown, use a different exception type. RestSharp RestClient.cs 286
CA2227 Collection properties should be read only Change 'RestResponseBase.Cookies' to be read-only by removing the property setter. RestSharp RestResponse.cs 108
CA2227 Collection properties should be read only Change 'RestResponseBase.Headers' to be read-only by removing the property setter. RestSharp RestResponse.cs 113
CA2225 Operator overloads have named alternates Provide a method named 'ToXXX' or 'FromXXX' as an alternate for operator 'RestResponse.explicit operator RestResponse(RestResponse)'. RestSharp RestResponse.cs 150
CA1801 Review unused parameters Parameter 'x' of 'XmlDeserializer.HandleListDerivative(object, XElement, string, Type)' is never used. Remove the parameter or use it in the method body. RestSharp XmlDeserializer.cs 330
The following Code Analysis Usage Warnings appear in the RestSharp project:
CA2202 Do not dispose objects multiple times Object 'this' can be disposed more than once in method 'Http.ExtractResponseData(HttpResponse, HttpWebResponse)'. To avoid generating a System.ObjectDisposedException you should not call Dispose more than one time on an object.: Lines: 459 RestSharp Http.cs 459 CA2227 Collection properties should be read only Change 'Http.ClientCertificates' to be read-only by removing the property setter. RestSharp Http.cs 136 CA2201 Do not raise reserved exception types 'HttpUtility.HtmlAttributeEncode(string, TextWriter)' creates an exception of type 'NullReferenceException', an exception type that is reserved by the runtime and should never be raised by managed code. If this exception instance might be thrown, use a different exception type. RestSharp HttpUtility.cs 87 CA2201 Do not raise reserved exception types 'HttpUtility.HtmlDecode(string, TextWriter)' creates an exception of type 'NullReferenceException', an exception type that is reserved by the runtime and should never be raised by managed code. If this exception instance might be thrown, use a different exception type. RestSharp HttpUtility.cs 575 CA2201 Do not raise reserved exception types 'HttpUtility.HtmlEncode(string, TextWriter)' creates an exception of type 'NullReferenceException', an exception type that is reserved by the runtime and should never be raised by managed code. If this exception instance might be thrown, use a different exception type. RestSharp HttpUtility.cs 617 CA2227 Collection properties should be read only Change 'IHttp.ClientCertificates' to be read-only by removing the property setter. RestSharp IHttp.cs 56 CA2227 Collection properties should be read only Change 'IRestClient.ClientCertificates' to be read-only by removing the property setter. RestSharp IRestClient.cs 75 CA2208 Instantiate argument exceptions correctly Call the 'ArgumentOutOfRangeException' constructor that contains a message and/or paramName parameter. RestSharp OAuth1Authenticator.cs 257 CA2208 Instantiate argument exceptions correctly Call the 'ArgumentOutOfRangeException' constructor that contains a message and/or paramName parameter. RestSharp OAuth1Authenticator.cs 279 CA1801 Review unused parameters Parameter 'signatureBase' of 'OAuthTools.GetSignature(OAuthSignatureMethod, string, string, string)' is never used. Remove the parameter or use it in the method body. RestSharp OAuthTools.cs 283 CA2227 Collection properties should be read only Change 'RestClient.ClientCertificates' to be read-only by removing the property setter. RestSharp RestClient.cs 57 CA2214 Do not call overridable methods in constructors 'RestClient.RestClient(Uri)' contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences:
RestClient..ctor(Uri) RestClient.set_BaseUrl(Uri):Void RestSharp RestClient.cs 154 CA2214 Do not call overridable methods in constructors 'RestClient.RestClient(string)' contains a call chain that results in a call to a virtual method defined by the class. Review the following call stack for unintended consequences:
RestClient..ctor(String) RestClient.set_BaseUrl(Uri):Void RestSharp RestClient.cs 163 CA2201 Do not raise reserved exception types 'RestClient.BuildUri(IRestRequest)' creates an exception of type 'NullReferenceException', an exception type that is reserved by the runtime and should never be raised by managed code. If this exception instance might be thrown, use a different exception type. RestSharp RestClient.cs 286 CA2227 Collection properties should be read only Change 'RestResponseBase.Cookies' to be read-only by removing the property setter. RestSharp RestResponse.cs 108 CA2227 Collection properties should be read only Change 'RestResponseBase.Headers' to be read-only by removing the property setter. RestSharp RestResponse.cs 113 CA2225 Operator overloads have named alternates Provide a method named 'ToXXX' or 'FromXXX' as an alternate for operator 'RestResponse.explicit operator RestResponse(RestResponse)'. RestSharp RestResponse.cs 150
CA1801 Review unused parameters Parameter 'x' of 'XmlDeserializer.HandleListDerivative(object, XElement, string, Type)' is never used. Remove the parameter or use it in the method body. RestSharp XmlDeserializer.cs 330