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

badges / shields / 23974260957

01 Apr 2026 09:01PM UTC coverage: 98.033% (-0.04%) from 98.071%
23974260957

push

github

web-flow
chore(deps): bump @xmldom/xmldom from 0.9.8 to 0.9.9 (#11749)

Bumps [@xmldom/xmldom](https://github.com/xmldom/xmldom) from 0.9.8 to 0.9.9.
- [Release notes](https://github.com/xmldom/xmldom/releases)
- [Changelog](https://github.com/xmldom/xmldom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xmldom/xmldom/compare/0.9.8...0.9.9)

---
updated-dependencies:
- dependency-name: "@xmldom/xmldom"
  dependency-version: 0.9.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

5848 of 6109 branches covered (95.73%)

49337 of 50327 relevant lines covered (98.03%)

136.33 hits per line

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

85.37
/services/codacy/codacy-coverage.service.js
1
import Joi from 'joi'
3✔
2
import { coveragePercentage as coveragePercentageColor } from '../color-formatters.js'
3✔
3
import { BaseSvgScrapingService, NotFound, pathParams } from '../index.js'
3✔
4

3✔
5
const schema = Joi.object({
3✔
6
  message: Joi.alternatives()
3✔
7
    .try(Joi.string().regex(/^[0-9]+%$/), Joi.equal('!'))
3✔
8
    .required(),
3✔
9
}).required()
3✔
10

3✔
11
export default class CodacyCoverage extends BaseSvgScrapingService {
3✔
12
  static category = 'coverage'
3✔
13
  static route = { base: 'codacy/coverage', pattern: ':projectId/:branch*' }
3✔
14

3✔
15
  static openApi = {
3✔
16
    '/codacy/coverage/{projectId}': {
3✔
17
      get: {
3✔
18
        summary: 'Codacy coverage',
3✔
19
        parameters: pathParams({
3✔
20
          name: 'projectId',
3✔
21
          example: '84c0a068ce9349f2bcaa07b5977bd932',
3✔
22
        }),
3✔
23
      },
3✔
24
    },
3✔
25
    '/codacy/coverage/{projectId}/{branch}': {
3✔
26
      get: {
3✔
27
        summary: 'Codacy coverage (branch)',
3✔
28
        parameters: pathParams(
3✔
29
          {
3✔
30
            name: 'projectId',
3✔
31
            example: '84c0a068ce9349f2bcaa07b5977bd932',
3✔
32
          },
3✔
33
          {
3✔
34
            name: 'branch',
3✔
35
            example: 'master',
3✔
36
          },
3✔
37
        ),
3✔
38
      },
3✔
39
    },
3✔
40
  }
3✔
41

3✔
42
  static defaultBadgeData = { label: 'coverage' }
3✔
43

3✔
44
  static render({ percentage }) {
3✔
45
    return {
×
46
      message: `${percentage}%`,
×
47
      color: coveragePercentageColor(percentage),
×
48
    }
×
49
  }
×
50

3✔
51
  static transform({ coverageString }) {
3✔
52
    return {
×
53
      percentage: parseFloat(coverageString.replace(/%$/, '')),
×
54
    }
×
55
  }
×
56

3✔
57
  async handle({ projectId, branch }) {
3✔
58
    const { message: coverageString } = await this._requestSvg({
4✔
59
      schema,
4✔
60
      url: `https://api.codacy.com/project/badge/coverage/${encodeURIComponent(
4✔
61
        projectId,
4✔
62
      )}`,
4✔
63
      options: { searchParams: { branch } },
4✔
64
      valueMatcher: /text-anchor="middle">([^<>]+)<\/text>/,
4✔
65
      httpErrors: {
4✔
66
        404: 'project not found',
4✔
67
      },
4✔
68
    })
4✔
69

3✔
70
    // When sending an invalid branch, Codacy ignores the branch, failing
3✔
71
    // silently, so we can't provide an error message for this case.
3✔
72

3✔
73
    if (coverageString === '!') {
3✔
74
      throw new NotFound({
3✔
75
        prettyMessage: 'not enabled for this project',
3✔
76
      })
3✔
77
    }
3✔
78

×
79
    const { percentage } = this.constructor.transform({ coverageString })
×
80
    return this.constructor.render({ percentage })
×
81
  }
4✔
82
}
3✔
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