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

protofire / solhint / #143873

09 May 2026 04:16PM UTC coverage: 97.691% (+0.03%) from 97.657%
#143873

push

589 of 672 branches covered (87.65%)

2792 of 2858 relevant lines covered (97.69%)

118.93 hits per line

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

36.36
/lib/common/utils.js
1
const fs = require('fs')
1✔
2
const path = require('path')
1✔
3

4
const getLocFromIndex = (text, index) => {
1✔
5
  let line = 1
×
6
  let column = 0
×
7
  let i = 0
×
8
  while (i < index) {
×
9
    if (text[i] === '\n') {
×
10
      line++
×
11
      column = 0
×
12
    } else {
×
13
      column++
14
    }
15
    i++
16
  }
×
17

×
18
  return { line, column }
×
19
}
20

21
const walkSync = (dir, filelist = []) => {
×
22
  fs.readdirSync(dir).forEach((file) => {
23
    filelist = fs.statSync(path.join(dir, file)).isDirectory()
×
24
      ? walkSync(path.join(dir, file), filelist)
25
      : filelist.concat(path.join(dir, file))
26
  })
×
27
  return filelist
28
}
29

1✔
30
module.exports = {
24✔
31
  getLocFromIndex,
204✔
32
  walkSync,
33
}
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