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

SLVS-1693 Fix: issues set to empty after hotspots event #5886

Merged

Conversation

georgii-borovinskikh-sonarsource
Copy link
Contributor

@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource commented Dec 11, 2024

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small feedback

@@ -49,3 +44,15 @@ void ScheduleAnalysis(string filePath,
/// </summary>
void CancelForFile(string filePath);
}

public interface IFindingsPublisher

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this interface into its own class.

return analysisIssueVisualizations;
}

private bool ValidatePath(string path)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the method to something more speaking: for now, it is unexpected that the ValidatePath returns true in the case that it fails. Possible name: IsPathInvalid

Another approach would be to inverse the returns: in the fail case, it should return false.

@@ -46,20 +39,18 @@ public void HandleNewIssues_UpdatedSnapshotAndHotspotStoreHaveExpectedValues()
{
var hotspotStoreMock = new Mock<ILocalHotspotsStoreUpdater>();

var hotspot = CreateIssue("S112", startLine: 1, endLine: 1, isHotspot: true);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the test as well: HandleNewIssues_UpdatedSnapshotHasExpectedValues

@@ -87,6 +77,33 @@ public void HandleNewIssues_UpdatedSnapshotAndHotspotStoreHaveExpectedValues()
notificationHandler.UpdatedSnapshot.AnalyzedFilePath.Should().Be(expectedFilePath);
}

[TestMethod]
public void HandleNewHotspots_UpdatedSnapshotAndHotspotStoreHaveExpectedValues()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename to

Suggested change
public void HandleNewHotspots_UpdatedSnapshotAndHotspotStoreHaveExpectedValues()
public void HandleNewHotspots_HotspotStoreHasExpectedValues()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants