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

SamboyCoding / Cpp2IL / 27107753227

07 Jun 2026 11:14PM UTC coverage: 33.79% (-0.007%) from 33.797%
27107753227

push

github

web-flow
Fix attributes on metadata version >= 104 (#555)

2220 of 7912 branches covered (28.06%)

Branch coverage included in aggregate %.

15 of 32 new or added lines in 7 files covered. (46.88%)

4661 of 12452 relevant lines covered (37.43%)

241399.24 hits per line

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

2.63
/Cpp2IL.Core/ProcessingLayers/AttributeAnalysisProcessingLayer.cs
1
using System;
2
using System.Linq;
3
using Cpp2IL.Core.Api;
4
using Cpp2IL.Core.Model.Contexts;
5

6
namespace Cpp2IL.Core.ProcessingLayers;
7

8
public class AttributeAnalysisProcessingLayer : Cpp2IlProcessingLayer
9
{
10
    public override string Name => "CustomAttribute Analyzer";
×
11
    public override string Id => "attributeanalyzer";
1✔
12

13
    public override void Process(ApplicationAnalysisContext appContext, Action<int, int>? progressCallback = null)
14
    {
15
        var total = appContext.Assemblies.Count + appContext.AllTypes.Select(t => 1 + t.Events.Count + t.Fields.Count + t.Methods.Count + t.Properties.Count).Sum();
×
16

NEW
17
        var count = 0;
×
NEW
18
        foreach (var a in appContext.Assemblies)
×
19
        {
NEW
20
            AnalyzeAndRaise(a, ref count, total, progressCallback);
×
NEW
21
            AnalyzeAndRaise(a.ManifestModule, ref count, total, progressCallback);
×
22
        }
23

24
        //TODO look into making this parallel
25
        foreach (var type in appContext.AllTypes)
×
26
        {
27
            AnalyzeAndRaise(type, ref count, total, progressCallback);
×
28
            type.Events.ForEach(e => AnalyzeAndRaise(e, ref count, total, progressCallback));
×
29
            type.Fields.ForEach(f => AnalyzeAndRaise(f, ref count, total, progressCallback));
×
30
            type.Methods.ForEach(m =>
×
31
            {
×
32
                AnalyzeAndRaise(m, ref count, total, progressCallback);
×
33
                m.Parameters.ForEach(p => AnalyzeAndRaise(p, ref count, total, progressCallback));
×
34
            });
×
35
            type.Properties.ForEach(p => AnalyzeAndRaise(p, ref count, total, progressCallback));
×
36
        }
37
    }
×
38

39
    private void AnalyzeAndRaise(HasCustomAttributes toAnalyze, ref int count, int total, Action<int, int>? progressCallback)
40
    {
41
        toAnalyze.AnalyzeCustomAttributeData();
×
42
        count++;
×
43
        progressCallback?.Invoke(count, total);
×
44
    }
×
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc