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

badges / shields / 45774165149

22 Nov 2026 09:43PM UTC coverage: 79.735% (-18.4%) from 98.17%
45774165149

push

github

web-flow
[Endpoint] Support message override and position it after label in API docs (#12235)

* [Endpoint] Support message override and position it after label in API docs

* Preserve error message when a message override is provided

3371 of 3616 branches covered (93.22%)

43 of 53 new or added lines in 3 files covered. (81.13%)

9589 existing lines in 490 files now uncovered.

41514 of 52065 relevant lines covered (79.73%)

51.0 hits per line

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

70.97
/services/sourceforge/sourceforge-commit-count.service.js
1
import Joi from 'joi'
2 ✔
2
import { BaseJsonService, pathParams } from '../index.js'
2 ✔
3
import { metric } from '../text-formatters.js'
2 ✔
4

2 ✔
5
const schema = Joi.object({
2 ✔
6
  commit_count: Joi.number().required(),
2 ✔
7
}).required()
2 ✔
8

2 ✔
9
export default class SourceforgeCommitCount extends BaseJsonService {
2 ✔
10
  static category = 'activity'
2 ✔
11

2 ✔
12
  static route = {
2 ✔
13
    base: 'sourceforge/commit-count',
2 ✔
14
    pattern: ':project/:repo',
2 ✔
15
  }
2 ✔
16

2 ✔
17
  static openApi = {
2 ✔
18
    '/sourceforge/commit-count/{project}/{repo}': {
2 ✔
19
      get: {
2 ✔
20
        summary: 'SourceForge Commit Count',
2 ✔
21
        parameters: pathParams(
2 ✔
22
          {
2 ✔
23
            name: 'project',
2 ✔
24
            example: 'guitarix',
2 ✔
25
          },
2 ✔
26
          {
2 ✔
27
            name: 'repo',
2 ✔
28
            example: 'git',
2 ✔
29
            description:
2 ✔
30
              'The repository name, usually `git` but might be different.',
2 ✔
31
          },
2 ✔
32
        ),
2 ✔
33
      },
2 ✔
34
    },
2 ✔
35
  }
2 ✔
36

2 ✔
37
  static defaultBadgeData = { label: 'commit count' }
2 ✔
38

2 ✔
39
  static render({ commitCount }) {
2 ✔
UNCOV
40
    return {
×
UNCOV
41
      message: metric(commitCount),
×
UNCOV
42
      color: 'blue',
×
UNCOV
43
    }
×
UNCOV
44
  }
×
45

2 ✔
46
  async fetch({ project, repo }) {
2 ✔
UNCOV
47
    return this._requestJson({
×
UNCOV
48
      url: `https://sourceforge.net/rest/p/${project}/${repo}`,
×
UNCOV
49
      schema,
×
UNCOV
50
      httpErrors: {
×
UNCOV
51
        404: 'project or repo not found',
×
UNCOV
52
      },
×
UNCOV
53
    })
×
UNCOV
54
  }
×
55

2 ✔
56
  async handle({ project, repo }) {
2 ✔
UNCOV
57
    const body = await this.fetch({ project, repo })
×
UNCOV
58
    return this.constructor.render({
×
UNCOV
59
      commitCount: body.commit_count,
×
UNCOV
60
    })
×
UNCOV
61
  }
×
62
}
2 ✔
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