Code Quality Challenge - Week 3

Senior Full-Stack Developer with over 20 years of experience building web applications for startups, government, and higher education.
Search for a command to run...

Senior Full-Stack Developer with over 20 years of experience building web applications for startups, government, and higher education.
No comments yet. Be the first to comment.
Journal of my [Code quality challenge](https://justinramel.com/im-taking-the-code-quality-challenge)
Final week of the CQC lets see what it was in store for us... Day 22 - Audit your DB schema I can do full stack development and know the ins and outs of DB schemas but that's not something I deal with day to day with on this codebase. The closest thi...
Writing this up so I have somewhere to quickly grab basic Jest setup. This information is copied from the Jest Documentation Site compressed into just the parts I'm interested in. Create folders mkdir -p <project>/src cd <project> Install and init n...

In this blog post, we'll explore the process of setting up and configuring a Postgres database using Docker and seeding it with test data. This approach can be used for a variety of apps and can be easily adapted for your own needs. We'll cover all t...

Continuing from last time, we will explore the concepts behind Create and Update functionality and provide a step-by-step guide on how to implement it in your SvelteKit application. Let's get started! Server & Client Code In SvelteKit, the server-sid...

Introduction In this post, I will explore how to create a REST API using Spring Boot and Kotlin. We will dive into the fundamentals of Spring Boot and Kotlin, explain how to set up the project, and guide you through the process of building the API st...

Introduction Welcome to the latest post in my series of Koan Battles using Kotlin and TypeScript. In this series, we'll complete a Koan in both languages and then discuss the differences between the two solutions. My goal is to help you gain a deeper...

Third week of the Code Quality Challenge, half way! We’re not counting the weekend days, so we jump to Day 15.
Improve one name today. Any name.
It can be a class name, a method name, a variable name, a constant name, a filename, anything.
I was working on a component that’s primary purpose had changed, so this was perfect timing. Nice easy challenge to ease us into the week 😀
Crack open your Gemfile, package.json, setup.py, or whatever file your language/dependency manager uses.
Give it a slow scan. Ask yourself:
Do you still need everything in there?
Does anything need to be updated?
Can you reduce a production dependency to a development/test one?
An easy check for vulnerabilities is npm audit:
$ npm audit
found 0 vulnerabilities
All good there 😀
Now lets take a look at the the package.json...
We recently dropped Font Awesome for Heroicons and there are still a few packages hanging around. Time to uninstall those packages!
npm remove @fortawesome/fontawesome-svg-core @fortawesome/free-regular-svg-icons @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome
Nice, I enjoy removing dependencies as much as deleting code.
Let's go extra meta today.
Please spend 20 minutes tidying up your PRs/issues/tickets/whatever.
If something is irrelevant, close or delete it.
Lets take at look at Git...
0 Pull requests
0 Issues
0 Tickets
Not much to do there, I'll try some backlog clean up instead.
I managed to find one old bug that had been fixed but not updated so I set that for Review.
Ben Orenstein offers a tip here that did come in useful:
I recommend working from oldest to newest.
As always, remember that the point isn't to clean up all the things, it's to spend 20 minutes chipping away at them.
Do a search through your project for long parameter lists, where long is defined as more than three parameters.
Ben offers a naive regex to find single-line method calls with at least four parameters:
(.*,.*,.*,.*)
This was useful for finding long parameter lists in the code.
The long parameter list code I did find was mostly library calls which I couldn't do much about so not much success today. I put this down to not liking long parameter lists so its not something I tend to do.
Please spend 20 minutes automating/systematizing some action that you perform repetitively.
Our current deploy to production process is a very manual process. It involves logging into GitLab, merging branches and creating Tags to kick off the deploy. I'd love to automate it, this is going to be a worthwhile challenge!
I didn't get the whole process automated in the 20 minutes but I did research the creation of Tags from the git command line which is going to allow me to automate the deploy.
I'll continue this challenge during our next deploy that will allow me to automate the tag creation scripts.
My favourite task this week was Day 19 - Automate a repetitive action, automated deploy is going to be a great time saver 😀