# Simplecov .resultset.json format changed with 0.18.0

**URL:** <https://community.sonarsource.com/t/simplecov-resultset-json-format-changed-with-0-18-0/19488>\
**Category:** SonarQube Server / Community Build\
**Tags:** ruby, slang\
**Created:** [January 31, 2020, 4:00am UTC](https://community.sonarsource.com/t/simplecov-resultset-json-format-changed-with-0-18-0/19488 "2020-01-31T04:00:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_Smith](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/j_smith/32/3241_2.png) [@J\_Smith](https://community.sonarsource.com/u/J_Smith)\
**Post date:** [January 31, 2020, 4:00am UTC](https://community.sonarsource.com/t/simplecov-resultset-json-format-changed-with-0-18-0/19488/1 "2020-01-31T04:00:18Z")

</div>

Simplecov 0.18.0 has changed the output that it uses to store its results and the SimplecovSensor class bombs out trying to parse it.

Before, the structure was essentially

```auto
{
  "Unit Tests": {
    "coverage": {
      "/Users/jay/Setup/ruby/my-extensions/ffi-geos-git/lib/ffi-geos.rb": [
        // array of line data
      ]
    }
}

```

This has changed to allow for both line and branch data, so a new key has been inserted – the array of line data has been replaced with an additional layer that will be either a “lines” or “branches” key depending on the options passed to Simplecov.

---

<div class="post-metadata">

**Author:** ![likeuwill](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@likeuwill](https://community.sonarsource.com/u/likeuwill)\
**Post date:** [February 5, 2020, 11:35am UTC](https://community.sonarsource.com/t/simplecov-resultset-json-format-changed-with-0-18-0/19488/2 "2020-02-05T11:35:35Z")

</div>

**Versions used:**

- SonarQube Scanner 4.2.0.1873
- Java 11.0.3 AdoptOpenJDK (64-bit)
- Linux 5.3.0-29-generic amd64
- Ruby 2.6.5p114
- Rails 6.0.2.1
- Simplecov 0.18.1 (2020-01-31)

**Error observed**  
Simplecov team was changed the structure of results.  
`.resultset.json` on `0.17.1` version

> `{ "RSpec": { "coverage": { "/home/user/RubymineProjects/MyProject/app/api_wrappers/base_api.rb": { "lines": [ null, ...`

`.resultset.json` on `0.18.1` version

> `{ "RSpec": { "coverage": { "/home/user/RubymineProjects/MyProject/app/api_wrappers/base_api.rb": [ null, ...`

So now they using array inside a file, inseted of using `json` format and **lines** key  
**Steps to reproduce**

- Install last version of simplecov, e.g. 0.18.1
- Run `rspec` test and check code coverage by runing `coverage/index.html` file
- Run `sonar-scanner`
- Results `0.0%` coverage  
 ![simple_cov](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/b/b459b0ecabe6169ea7dd409061893faf3a8f35d8.png)

---

<div class="post-metadata">

**Author:** ![saberduck](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/saberduck/32/27_2.png) [@saberduck](https://community.sonarsource.com/u/saberduck)\
**Post date:** [February 6, 2020, 1:41pm UTC](https://community.sonarsource.com/t/simplecov-resultset-json-format-changed-with-0-18-0/19488/3 "2020-02-06T13:41:47Z")

</div>

@J_Smith, @likeuwill,

thank you for reporting this problem, I created ticket to track it [https://jira.sonarsource.com/browse/SONARSLANG-477](https://jira.sonarsource.com/browse/SONARSLANG-477)

@likeuwill, if I am not mistaken, the change is actually the opposite, they changed from using simple array, to using object with `lines` key

---

<div class="post-metadata">

**Author:** ![likeuwill](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@likeuwill](https://community.sonarsource.com/u/likeuwill)\
**Post date:** [February 6, 2020, 2:08pm UTC](https://community.sonarsource.com/t/simplecov-resultset-json-format-changed-with-0-18-0/19488/4 "2020-02-06T14:08:34Z")

</div>

@saberduck yes, you right. Thank you, for your fast response.
