• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

KSP-CKAN / CKAN / 15834236157

23 Jun 2025 07:42PM UTC coverage: 42.232% (+0.1%) from 42.099%
15834236157

push

github

HebaruSan
Merge #4398 Exception handling revamp, parallel multi-host inflation

3880 of 9479 branches covered (40.93%)

Branch coverage included in aggregate %.

48 of 137 new or added lines in 30 files covered. (35.04%)

12 existing lines in 6 files now uncovered.

8334 of 19442 relevant lines covered (42.87%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/GUI/Main/MainRecommendations.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Windows.Forms;
4
using System.Threading.Tasks;
5
using System.Linq;
6

7
using Autofac;
8

9
using CKAN.Configuration;
10
using CKAN.IO;
11
using CKAN.Versioning;
12
using CKAN.GUI.Attributes;
13

14
// Don't warn if we use our own obsolete properties
15
#pragma warning disable 0618
16

17
namespace CKAN.GUI
18
{
19
    public partial class Main
20
    {
21
        private void ChooseRecommendedMods_OnSelectedItemsChanged(ListView.SelectedListViewItemCollection items)
22
        {
×
23
            ShowSelectionModInfo(items);
×
24
        }
×
25

26
        private void ChooseRecommendedMods_OnConflictFound(string message)
27
        {
×
28
            StatusLabel.ToolTipText = StatusLabel.Text = message;
×
29
        }
×
30

31
        private void AuditRecommendationsToolStripMenuItem_Click(object? sender, EventArgs? e)
32
        {
×
33
            if (CurrentInstance != null)
×
34
            {
×
35
                // Run in a background task so GUI thread can react to user
NEW
36
                Task.Run(() => AuditRecommendations(
×
37
                    RegistryManager.Instance(CurrentInstance, repoData).registry,
38
                    CurrentInstance.VersionCriteria()));
39
            }
×
40
        }
×
41

42
        [ForbidGUICalls]
43
        private void AuditRecommendations(Registry registry, GameVersionCriteria versionCriteria)
44
        {
×
45
            if (CurrentInstance != null && Manager.Cache != null)
×
46
            {
×
47
                var installer = new ModuleInstaller(CurrentInstance, Manager.Cache,
×
48
                                                    ServiceLocator.Container.Resolve<IConfiguration>(),
49
                                                    currentUser);
50
                if (ModuleInstaller.FindRecommendations(
×
51
                        CurrentInstance,
52
                        registry.InstalledModules.Select(im => im.Module).ToHashSet(),
×
53
                        Array.Empty<CkanModule>(),
54
                        Array.Empty<CkanModule>(),
55
                        registry,
56
                        out Dictionary<CkanModule, Tuple<bool, List<string>>> recommendations,
57
                        out Dictionary<CkanModule, List<string>> suggestions,
58
                        out Dictionary<CkanModule, HashSet<string>> supporters)
59
                    && configuration != null)
60
                {
×
61
                    tabController.ShowTab(ChooseRecommendedModsTabPage.Name, 3);
×
62
                    ChooseRecommendedMods.LoadRecommendations(
×
63
                        registry, Array.Empty<CkanModule>(), Array.Empty<CkanModule>(),
64
                        versionCriteria, Manager.Cache,
65
                        CurrentInstance.game,
66
                        ModuleLabelList.ModuleLabels
67
                                       .LabelsFor(CurrentInstance.Name)
68
                                       .ToList(),
69
                        ServiceLocator.Container.Resolve<IConfiguration>(),
70
                        configuration,
71
                        recommendations, suggestions, supporters);
72
                    var result = ChooseRecommendedMods.Wait();
×
73
                    tabController.HideTab(ChooseRecommendedModsTabPage.Name);
×
74
                    if (result != null && result.Count != 0)
×
75
                    {
×
76
                        Wait.StartWaiting(InstallMods, PostInstallMods, true,
×
77
                            new InstallArgument(
78
                                result.Select(mod => new ModChange(mod, GUIModChangeType.Install,
×
79
                                                                   ServiceLocator.Container.Resolve<IConfiguration>()))
80
                                      .ToList(),
81
                                RelationshipResolverOptions.DependsOnlyOpts(CurrentInstance.StabilityToleranceConfig)));
82
                    }
×
83
                }
×
84
                else
85
                {
×
86
                    currentUser.RaiseError(Properties.Resources.MainRecommendationsNoneFound);
×
87
                }
×
88
            }
×
89
        }
×
90
    }
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc