Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S1313 FN: VB.NET - No issue is raised if the IP address is assembled as an interpolated string #5996

Closed
csaba-sagi-sonarsource opened this issue Aug 12, 2022 · 0 comments · Fixed by #5997
Assignees
Labels
Area: VB.NET VB.NET rules related issues. Type: False Negative Rule is NOT triggered when it should be.
Milestone

Comments

@csaba-sagi-sonarsource
Copy link
Contributor

Description

The VB version of the rule does not report if the IP address is assembled as an interpolated string

Repro steps

        Public Sub StringInterpolation(ByVal unknownPart As String, ByVal knownPart As String)
            Dim part1 As String = "192"
            Dim part2 As String = "168"
            Dim part3 As String = "0"
            Dim part4 As String = "1"
            knownPart = "255"
            Dim ip1 As String = $"{part1}.{part2}.{part3}.{part4}"    ' Noncompliant
            Dim nonIp As String = $"{part1}:{part2}"
            Dim ip2 As String = $"{part1}.{part2}.{part3}.{knownPart}"  ' Noncompliant
            Dim ip3 As String = $"{part1}.{part2}.{part3}.{unknownPart}"
            Dim nestedConstInterpolation As String = $"{$"{part1}.{part2}"}.{part3}.{part4}" ' Noncompliant
            Dim nestedInterpolation As String = $"{$"{part1}.{knownPart}"}.{part3}.{part4}"    ' Noncompliant
        End Sub

```### Expected behavior

The rule should raise an issue.

### Actual behavior

No issues are raised

### Known workarounds

Please provide a description of any known workarounds.

### Related information

* C#/VB.NET Plugins version: 8.42.0.51121
@csaba-sagi-sonarsource csaba-sagi-sonarsource added Type: False Negative Rule is NOT triggered when it should be. Area: VB.NET VB.NET rules related issues. labels Aug 12, 2022
@csaba-sagi-sonarsource csaba-sagi-sonarsource added this to the 8.44 milestone Aug 12, 2022
@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title S1313 FN: The VB version of the rule does not report if the IP address is assembled as an interpolated string S1313 FN: VB.NET - No issue is raised if the IP address is assembled as an interpolated string Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: VB.NET VB.NET rules related issues. Type: False Negative Rule is NOT triggered when it should be.
Projects
None yet
2 participants