Skip to content
Closed
Changes from all 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
9 changes: 8 additions & 1 deletion UnityLauncherPro/UpgradeWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
public static string upgradeVersion = null;

public UpgradeWindow(string currentVersion, string projectPath, string commandLineArguments = null)

Check failure on line 16 in UnityLauncherPro/UpgradeWindow.xaml.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this constructor to reduce its Cognitive Complexity from 18 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=unitycoder_UnityLauncherPro&issues=AZ0rRahiH2jBfq5nbcnl&open=AZ0rRahiH2jBfq5nbcnl&pullRequest=222
{
InitializeComponent();
txtCurrentVersion.Text = currentVersion;
Expand All @@ -21,7 +21,14 @@

if (gridAvailableVersions.ItemsSource == null)
{
gridAvailableVersions.ItemsSource = MainWindow.unityInstallationsSource;
if (MainWindow.unityInstallationsSource != null)
{
gridAvailableVersions.ItemsSource = MainWindow.unityInstallationsSource;
}
else
{
gridAvailableVersions.ItemsSource = new System.Collections.Generic.List<UnityInstallation>();
}
}

gridAvailableVersions.SelectedItem = null;
Expand All @@ -47,7 +54,7 @@
if (nearestVersion != null)
{
// select nearest version
for (int i = 0; i < MainWindow.unityInstallationsSource.Count; i++)

Check warning on line 57 in UnityLauncherPro/UpgradeWindow.xaml.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'MainWindow.unityInstallationsSource' is null on at least one execution path.

See more on https://sonarcloud.io/project/issues?id=unitycoder_UnityLauncherPro&issues=AZ0rRahiH2jBfq5nbcnk&open=AZ0rRahiH2jBfq5nbcnk&pullRequest=222
{
if (MainWindow.unityInstallationsSource[i].Version == nearestVersion)
{
Expand Down