Software Quality
- 06 Software Quality Metrics
- 06 Cyclomatic Complexity
- 07 Software Quality Measurement and Indicators
- 08 Software quality metrics and ISO_IEC standard
- 10 Case Study Software Architecture and Quality Criteria
Code Vulnerabilities
You should run the Audit Report to identift code vulnerabilities and use the fix
subcommand to resolve these. Note that this occasionally causes issue with the scripts so make sure you commit your working code first and run your suite of automated tests afterwards to check.
$ npm audit
=== npm audit security report ===
found 165 vulnerabilities (134 low, 25 moderate, 6 high)
$ npm audit fix
added 200 packages from 108 contributors, removed 27 packages,
updated 109 packages and moved 6 packages in 40.712s
fixed 165 of 165 vulnerabilities in 7482 scanned packages
$ npm audit
found 0 vulnerabilities
in 17062 scanned packages
Devtool Tracing
Use Puppeteer to record a tracing and save it. Saved JSON file can be imported into the Chrome Dev tools (performance tab) to understand page performance. Add the following lines to the test suite:
await page.tracing.start({path: 'trace.json',screenshots:true})
// do stuff (tests)
await page.tracing.stop()
Cyclomatic Complexity
Eslint config:
complexity
controls the cyclomatic complexity.max-depth
controls nested code depth.max-len
controls the length of the line based on the specified tab size.max-lines
defines the maximum number of lines allowed in a module.max-lines-per-function
monitors how many lines are in each function definition.max-nested-callbacks
max-params
max-statements