soprasteria / sonar-report

Generates an html report from SonarQube
GNU General Public License v3.0
87 stars 43 forks source link

fix: resolve undefined date error #247

Closed jiahao1553 closed 5 months ago

jiahao1553 commented 8 months ago

Suggestion to fix when period is not available but periods with object array

Raw error:

Error while getting quality gate status :  - Cannot read properties of undefined (reading 'date') -  -  - 
file:///Users/******/.nvm/versions/node/v18.17.1/lib/node_modules/sonar-report/index.js:405
        json.projectStatus.period.date
                                  ^

TypeError: Cannot read properties of undefined (reading 'date')
    at generateReport (file:///Users/******/.nvm/versions/node/v18.17.1/lib/node_modules/sonar-report/index.js:405:35)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
sonarcloud[bot] commented 8 months ago

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

thecampagnards commented 5 months ago

thx I doing a batch on this project it's implemented in https://github.com/soprasteria/sonar-report/commit/faea9576a433d5df12af45c31dd5440865b0962c

Thx for your PR !