vfile / vfile-statistics
Showing 1 of 2 files from the diff.
Other files ignored by Codecov
package.json has changed.

@@ -3,10 +3,18 @@
Loading
3 3
module.exports = statistics
4 4
5 5
// Get stats for a file, list of files, or list of messages.
6 -
function statistics(files) {
6 +
function statistics(value) {
7 7
  var result = {true: 0, false: 0, null: 0}
8 8
9 -
  count(files)
9 +
  if (value) {
10 +
    if (value[0] && value[0].messages) {
11 +
      // Multiple vfiles.
12 +
      countInAll(value)
13 +
    } else {
14 +
      // One vfile / messages.
15 +
      countAll(value.messages || value)
16 +
    }
17 +
  }
10 18
11 19
  return {
12 20
    fatal: result.true,
@@ -16,35 +24,21 @@
Loading
16 24
    total: result.true + result.false + result.null
17 25
  }
18 26
19 -
  function count(value) {
20 -
    if (value) {
21 -
      if (value[0] && value[0].messages) {
22 -
        // Multiple vfiles
23 -
        countInAll(value)
24 -
      } else {
25 -
        // One vfile / messages
26 -
        countAll(value.messages || value)
27 -
      }
28 -
    }
29 -
  }
30 -
31 27
  function countInAll(files) {
32 -
    var length = files.length
33 28
    var index = -1
34 29
35 -
    while (++index < length) {
36 -
      count(files[index].messages)
30 +
    while (++index < files.length) {
31 +
      countAll(files[index].messages)
37 32
    }
38 33
  }
39 34
40 35
  function countAll(messages) {
41 -
    var length = messages.length
42 36
    var index = -1
43 -
    var fatal
44 37
45 -
    while (++index < length) {
46 -
      fatal = messages[index].fatal
47 -
      result[fatal === null || fatal === undefined ? null : Boolean(fatal)]++
38 +
    while (++index < messages.length) {
39 +
      result[
40 +
        messages[index].fatal == null ? null : Boolean(messages[index].fatal)
41 +
      ]++
48 42
    }
49 43
  }
50 44
}
Files Coverage
index.js 100.00%
Project Totals (1 files) 100.00%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading