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-1616 TaintIssuesControl & TaintIssuesControlViewModel: remove AnalysisInformation display #5829

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -694,48 +694,6 @@ public void SetSelectedIssue_ValueIsTheSame_SelectionServiceNotCalled()
selectionService.VerifyNoOtherCalls();
}

[TestMethod]
public void AnalysisInformation_NoAnalysisInformation_Null()
{
var store = new Mock<ITaintStore>();
SetupAnalysisInformation(store, null);

var testSubject = CreateTestSubject(store: store);

testSubject.AnalysisInformation.Should().BeNull();
}

[TestMethod]
public void AnalysisInformation_HasAnalysisInformation_PropertySet()
{
var store = new Mock<ITaintStore>();
var analysisInformation = new AnalysisInformation("some branch", default);
SetupAnalysisInformation(store, analysisInformation);

var testSubject = CreateTestSubject(store: store);

testSubject.AnalysisInformation.Should().BeSameAs(analysisInformation);
}

[TestMethod]
public void AnalysisInformation_IssuesChanged_RaisesPropertyChanged()
{
var store = new Mock<ITaintStore>();
var testSubject = CreateTestSubject(store: store);

var eventHandler = new Mock<PropertyChangedEventHandler>();
testSubject.PropertyChanged += eventHandler.Object;

var analysisInformation = new AnalysisInformation("some branch", default);

SetupAnalysisInformation(store, analysisInformation);
RaiseStoreIssuesChangedEvent(store);

VerifyPropertyChangedWasRaised(eventHandler, nameof(testSubject.AnalysisInformation));

testSubject.AnalysisInformation.Should().BeSameAs(analysisInformation);
}

[TestMethod]
[DataRow(null, ServerType.SonarCloud, nameof(ServerType.SonarCloud), true)]
[DataRow(null, null, "", false)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,7 @@
<RowDefinition Name="List" Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Style="{StaticResource DisclaimerBorderStyle}">
<TextBlock Style="{StaticResource DisclaimerTextBlockStyle}">
<TextBlock.Text>
<MultiBinding StringFormat="{}Server issues found in current file (branch '{0}', last analyzed on {1})">
<Binding Path="AnalysisInformation.BranchName" />
<Binding Path="AnalysisInformation.AnalysisTimestamp" Converter="{StaticResource DateTimeConverter}" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TextBlock Style="{StaticResource DisclaimerTextBlockStyle}" Text="Server Security Vulnerabilities found in the current file" />
</Border>
<Grid x:Name="TaintList" Grid.Row="1">
<Grid.ColumnDefinitions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ internal interface ITaintIssuesControlViewModel : INotifyPropertyChanged, IDispo
string WindowCaption { get; }

string ServerType { get; }

AnalysisInformation AnalysisInformation { get; }
}

/// <summary>
Expand Down Expand Up @@ -132,8 +130,6 @@ public ITaintIssueViewModel SelectedIssue
}
}

public AnalysisInformation AnalysisInformation { get; private set; }

public string ServerType => serverType.ToString();

public TaintIssuesControlViewModel(ITaintStore store,
Expand Down Expand Up @@ -164,7 +160,7 @@ INavigateToRuleDescriptionCommand navigateToRuleDescriptionCommand
ISonarQubeService sonarQubeService,
INavigateToRuleDescriptionCommand navigateToRuleDescriptionCommand,
IThreadHandling threadHandling)
{
{
this.threadHandling = threadHandling;
unfilteredIssues = new ObservableCollection<ITaintIssueViewModel>();
AllowMultiThreadedAccessToIssuesCollection();
Expand Down Expand Up @@ -301,8 +297,6 @@ private void UpdateIssues()
taintIssueViewModel.TaintIssueViz.PropertyChanged += OnTaintIssuePropertyChanged;
}

AnalysisInformation = store.GetAnalysisInformation();

NotifyPropertyChanged(nameof(HasServerIssues));
NotifyPropertyChanged(nameof(AnalysisInformation));
}
Expand Down