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

samsmithnz / RepoGovernance / 5701615620

pending completion
5701615620

push

github

web-flow
Adding count to .NET frameworks (#501)

* Added count to code

* Added counter to dotnet languages

123 of 236 branches covered (52.12%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 2 files covered. (100.0%)

456 of 647 relevant lines covered (70.48%)

7.31 hits per line

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

41.38
/src/RepoGovernance.Core/APIAccess/DevOpsMetricServiceApi.cs
1
using RepoGovernance.Core.Models;
2

3
namespace RepoGovernance.Core.APIAccess
4
{
5
    public class DevOpsMetricServiceApi
6
    {
7
        private readonly HttpClient Client;
8

9
        public DevOpsMetricServiceApi(string devOpsServiceURL)
1✔
10
        {
1✔
11
            Client = new HttpClient
1✔
12
            {
1✔
13
                BaseAddress = new Uri(devOpsServiceURL)
1✔
14
            };
1✔
15
        }
1✔
16

17
        public async Task<DORASummaryItem?> GetDORASummaryItems(string owner, string repo)
18
        {
1✔
19
            try
20
            {
1✔
21
                // api/DORASummary/GetDORASummaryItems?owner=samsmithnz&repository=DevOpsMetrics
22
                string url = $"/api/DORASummary/GetDORASummaryItem?owner={owner}&project=&repo={repo}";
1✔
23
                return await BaseApi.GetResponse<DORASummaryItem>(Client, url);
1✔
24
            }
25
            catch (Exception ex)
×
26
            {
×
27
                return new DORASummaryItem()
×
28
                {
×
29
                    Owner = owner,
×
30
                    Repo = repo,
×
31
                    DeploymentFrequency = 0,
×
32
                    DeploymentFrequencyBadgeURL = "https://img.shields.io/badge/Deployment%20frequency-None-lightgrey",
×
33
                    LeadTimeForChanges = 0,
×
34
                    LeadTimeForChangesBadgeURL = "https://img.shields.io/badge/Lead%20time%20for%20changes-None-lightgrey",
×
35
                    MeanTimeToRestore = 0,
×
36
                    MeanTimeToRestoreBadgeURL = "https://img.shields.io/badge/Meant%20time%20to%20restore-None-lightgrey",
×
37
                    ChangeFailureRate = -1, //This is -1 because the value is a percentage, and 0 means something
×
38
                    ChangeFailureRateBadgeURL = "https://img.shields.io/badge/Change%20failure%20rate-None-lightgrey",
×
39
                    LastUpdated = DateTime.Now,
×
40
                    LastUpdatedMessage = "Error getting DORA summary item: " + ex.ToString()
×
41
                };
×
42
            }
43
        }
1✔
44
    }
45
}
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

© 2025 Coveralls, Inc