enterprise node - code quality
TRANSCRIPT
![Page 1: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/1.jpg)
ENTERPRISE NODECODE QUALITY
![Page 2: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/2.jpg)
ABOUT ME
Tech Lead @ MLS
Medium: @kurtiskempleTwitter: @kurtiskemple
GitHub: @kkemple
![Page 3: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/3.jpg)
3
REPO FOR THIS WEBINARKKEMPLE/AWESOME-ENTERPRISE-WEB-SERVICE
![Page 4: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/4.jpg)
WHY IS CODE QUALITY IMPORTANT?
![Page 5: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/5.jpg)
BENEFITS
• Prevents Entropy
• Improves Velocity
• Increases Developer Morale
![Page 6: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/6.jpg)
WHAT DEFINES QUALITY CODE?
![Page 7: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/7.jpg)
THE THREE Cs OF CODE QUALITY
• Clarity
• Complexity
• Coverage
![Page 8: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/8.jpg)
CLARITY
![Page 9: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/9.jpg)
![Page 10: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/10.jpg)
WHAT DOES CLARITY MEAN?
• Code Is Formatted Well
• Code Is Cohesive (Things that belong together are
together)
• Variable and Function Names Give Context
![Page 11: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/11.jpg)
COMPLEXITY
![Page 12: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/12.jpg)
“Cyclomatic complexity is a software metric (measurement), used to indicate the complexity of a program. It is a quantitative measure of the number of linearly independent paths through a program's source code.”
![Page 13: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/13.jpg)
http://blog.codeclimate.com/blog/2013/12/12/the-roots-of-static-analysis/
![Page 14: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/14.jpg)
WHY IS MEASURING COMPLEXITY IMPORTANT?
• It identifies tightly coupled sections of your application
• It identifies methods that might not be clear due to
excessive logic
• It helps identify trends (developer fatigue, tech-debt,
etc…)
![Page 15: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/15.jpg)
COVERAGE
![Page 16: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/16.jpg)
COVERAGE !== QUALITY
It’s important to note that a high coverage score is not equivalent to a quality test suite. However, it does show parts of your application that have no tests.
![Page 17: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/17.jpg)
WHY IS COVERAGE IMPORTANT?
• It identifies areas of the application that are not tested
• It identifies trends in test/code addition ratios
• It helps instill confidence in the application
![Page 18: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/18.jpg)
SETTING STANDARDS
![Page 19: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/19.jpg)
BIKESHEDDING
or Parkinson’s Law of Triviality…https://en.wikipedia.org/wiki/Law_of_triviality
![Page 20: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/20.jpg)
PICKING A STANDARD
![Page 21: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/21.jpg)
ENFORCING THE STANDARD
• Linting should be run during development (editor
plugins, watching files, etc)
• Linting should break your build when it fails!
• Broken builds should never be merged!
![Page 22: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/22.jpg)
INTEGRATING STANDARDS INTO YOUR WORKFLOW
![Page 23: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/23.jpg)
CODE CLIMATE
![Page 24: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/24.jpg)
HOUND CI
![Page 25: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/25.jpg)
CODECOV
![Page 26: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/26.jpg)
Q&A
![Page 27: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/27.jpg)
• Enterprise Node.js - Code Qualityhttps://www.crowdcast.io/e/enterprise-node-1
• Enterprise Node.js - Code Discoveryhttps://www.crowdcast.io/e/enterprise-node-2
• Enterprise Node.js - Securing Your Environmenthttps://www.crowdcast.io/e/enterprise-node-3
• Enterprise Node.js - Deploying with Dockerhttps://www.crowdcast.io/e/enterprise-node-4
27
ENTERPRISE NODE.JS
![Page 28: Enterprise Node - Code Quality](https://reader036.vdocuments.site/reader036/viewer/2022062412/58eef59f1a28abe5238b460f/html5/thumbnails/28.jpg)
JavaScript is replacing Java, Ruby, and .NET as the technology of choice for companies that want to build enterprise software faster, and with fewer resources. Learn about enterprise JavaScript applications at every level of the stack. As well as how to secure, integrate, test, store, monitor, and deploy them.
O’REILLY SOFTWARE ARCHITECTURE CONFERENCEArchitecting For Enterprise in Node.js