I am new to the community, first I apologize if I created this thread incorrectly.
I have noticed that SonarQube and SonarLint analysing code in VisualBasic.NET language (SonarAnalyzer.VisualBasic) does not detect possible problems:
Using blocks to apply the Dispose
Apply the Close() of StreamMemory and HttpWebResponse.
I have the following code in VB.NET:
Private Sub Test() .... request = DirectCast(WebRequest.Create(url), HttpWebRequest) ... Dim requestWriter As StreamWriter = New StreamWriter(request.GetRequestStream()) requestWriter.Write(jsonData) 'requestWriter.Close() response = DirectCast(request.GetResponse(), HttpWebResponse) 'response.Close() End Sub
In VB.NET it was not suggesting to close and in C# projects it was suggesting to add it in Using block or close.
I have found a rule that does detect it in C# CA2213: Disposable fields should be disposed, but I haven’t found any similar rule for Visual Basic.Net.
I have been checking the open tasks, but I can’t find anything related. Issues · SonarSource/sonar-dotnet · GitHub
Are these new rules and do they have to be requested, do these rules have to be created, do these rules already exist?
SonarQube Version 8.4.2 (build 36762)