Skip to content
Permalink
f907a0fc2c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

Software Quality

  1. 06 Software Quality Metrics
  2. 06 Cyclomatic Complexity
  3. 07 Software Quality Measurement and Indicators
  4. 08 Software quality metrics and ISO_IEC standard
  5. 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:

  1. complexity controls the cyclomatic complexity.
  2. max-depth controls nested code depth.
  3. max-len controls the length of the line based on the specified tab size.
  4. max-lines defines the maximum number of lines allowed in a module.
  5. max-lines-per-function monitors how many lines are in each function definition.
  6. max-nested-callbacks
  7. max-params
  8. max-statements