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

MeindertN / RoboClerk / 17984225999

24 Sep 2025 05:13PM UTC coverage: 82.629% (-1.7%) from 84.321%
17984225999

push

github

MeindertN
fixed some issues with the GIT support being very slow and the docker build file not handeling the new native libraries. Adding musl based linux binaries for treesitter to the repo.

1922 of 2427 branches covered (79.19%)

Branch coverage included in aggregate %.

1 of 143 new or added lines in 2 files covered. (0.7%)

3 existing lines in 1 file now uncovered.

5879 of 7014 relevant lines covered (83.82%)

158.66 hits per line

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

66.3
/RoboClerk/PluginSupport/SourceCodeAnalysisPluginBase.cs
1
using RoboClerk.Configuration;
2
using System;
3
using System.Collections.Generic;
4
using System.IO;
5
using System.IO.Abstractions;
6
using System.Linq;
7
using Tomlyn.Model;
8

9
namespace RoboClerk
10
{
11
    public abstract class SourceCodeAnalysisPluginBase : DataSourcePluginBase
12
    {
13
        protected bool subDir = false;
51✔
14
        protected List<string> directories = new List<string>();
51✔
15
        protected List<string> fileMasks = new List<string>();
51✔
16
        protected List<string> sourceFiles = new List<string>();
51✔
17
        protected GitRepository gitRepo = null;
51✔
18

19
        public SourceCodeAnalysisPluginBase(IFileSystem fileSystem)
20
            : base(fileSystem)
51✔
21
        {
51✔
22
        }
51✔
23

24
        public override void InitializePlugin(IConfiguration configuration)
25
        {
50✔
26
            var config = GetConfigurationTable(configuration.PluginConfigDir, $"{name}.toml");
50✔
27
            subDir = (bool)config["SubDirs"];
48✔
28
            foreach (var obj in (TomlArray)config["TestDirectories"])
250✔
29
            {
53✔
30
                directories.Add((string)obj);
53✔
31
            }
53✔
32

33
            foreach (var obj in (TomlArray)config["FileMasks"])
258✔
34
            {
57✔
35
                fileMasks.Add((string)obj);
57✔
36
            }
57✔
37

38
            try
39
            {
48✔
40
                if (config.ContainsKey("UseGit") && (bool)config["UseGit"])
48!
41
                {
×
42
                    gitRepo = new GitRepository(configuration);
×
43
                }
×
44
            }
48✔
45
            catch (Exception)
×
46
            {
×
47
                logger.Error($"Error opening git repo at project root \"{configuration.ProjectRoot}\" even though the {name}.toml configuration file UseGit setting was set to true.");
×
48
                throw;
×
49
            }
50
        }
48✔
51

52
        protected void ScanDirectoriesForSourceFiles()
53
        {
45✔
54
            sourceFiles.Clear();
45✔
55
            foreach (var testDirectory in directories)
232✔
56
            {
49✔
57
                IDirectoryInfo dir = fileSystem.DirectoryInfo.New(testDirectory);
49✔
58
                try
59
                {
49✔
60
                    foreach (var fileMask in fileMasks)
264✔
61
                    {
59✔
62
                        IFileInfo[] files = dir.GetFiles(fileMask, subDir ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
59✔
63
                        foreach (var file in files)
284✔
64
                        {
55✔
65
                            sourceFiles.Add(file.FullName);
55✔
66
                        }
55✔
67
                    }
58✔
68
                }
48✔
69
                catch
1✔
70
                {
1✔
71
                    logger.Error($"Error reading directory {testDirectory}");
1✔
72
                    throw;
1✔
73
                }
74
            }
48✔
75

76
            // Preload git information for performance if git is enabled and we have files
77
            if (gitRepo != null && sourceFiles.Any())
44!
NEW
78
            {
×
NEW
79
                logger.Debug($"Preloading git information for {sourceFiles.Count} source files");
×
80
                
81
                // Get unique directories that contain our source files
NEW
82
                var sourceDirectories = sourceFiles
×
NEW
83
                    .Select(f => Path.GetDirectoryName(f))
×
NEW
84
                    .Where(d => !string.IsNullOrEmpty(d))
×
NEW
85
                    .Distinct()
×
NEW
86
                    .ToList();
×
87

88
                // Preload git information for each directory
NEW
89
                foreach (var directory in sourceDirectories)
×
NEW
90
                {
×
91
                    try
NEW
92
                    {
×
NEW
93
                        gitRepo.PreloadDirectoryInfo(directory);
×
NEW
94
                    }
×
NEW
95
                    catch (Exception ex)
×
NEW
96
                    {
×
NEW
97
                        logger.Warn($"Could not preload git information for directory {directory}: {ex.Message}");
×
98
                        // Continue processing other directories even if one fails
NEW
99
                    }
×
NEW
100
                }
×
NEW
101
            }
×
102
        }
44✔
103
    }
104
}
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