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

badges / shields / 45957384840

22 Nov 2026 09:43PM UTC coverage: 98.033% (-0.1%) from 98.17%
45957384840

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

6057 of 6325 branches covered (95.76%)

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

64 existing lines in 4 files now uncovered.

51041 of 52065 relevant lines covered (98.03%)

155.22 hits per line

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

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

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

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

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

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

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

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

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

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