Your Greatest Code Quality Threats and How to Solve Them

June 19 2014

Intro

In the process of building Codacy, I’ve learned that software companies in different life stages have different needs in terms of code quality.
Early startups have, for example, very different needs in comparison to digital agencies and freelancers.
There is however a common ground that links them all together: code quality is not being taken seriously enough, regardless of the stage.

If this resonates with you, take action today. Continuous improvement is the central piece of software engineering craft.

1. No continuous integration

Continuous integration is an important key part of every modern development stack.
It implies that you also have unit testing, that those tests are centralized and that there is some sort of validation in your deployments.

2. Living with broken windows

Don’t leave “broken windows” (bad designs, wrong decisions, or poor code) unrepaired. Fix each one as soon as it is discovered. If there is insufficient time to fix it properly, then board it up. Perhaps you can comment out the offending code, or display a “Not Implemented” message, or substitute dummy data instead. Take some action to prevent further damage and to show that you’re on top of the situation.

Everyone has urgent time-to-markets and deadlines.
Companies that don't view code quality as something continuous rapidly lose control and the cost of redoing the product is less than maintaining it.

3. Gatekeeping

Sometimes teams and companies receive code or a product as a result of outsourcing.
In this case, the process of quality assuring is about gatekeeping and making sure your solution is being developed properly.

What can I do about it?

You should try to follow best practices to oursource your work. Do not integrate bad quality code, it will always cost you more on the long run.

4. Heterogeneity

Different code styles or practices are a way for teams to start diverging on things that should be common and agreed.

Making sure development teams are in agreement in their code style is imperative.

What can I do about it?

The first step is establishing your code style guide in the very beginning. Enforcing them is where most of the product owner fail. This is where Codacy can help. Codacy can help you centralize all your code best practices, making code quality an integrated part of your development process.

5. Growth phase

It's easy for companies to first output an MVP and prototype an idea. However, when the first users and customers start entering through the door, quality of the overall solution will be an increasing concern.

When growth is introduced, quality will start to matter.
One thing we've seen is that there is a threshold on which using tools or processes start to make sense.

If you're seeing yourself having the same problem over and over, it's probably a sign you've grown out of your current processes.

What can I do about it?

You should always question your current processes.
If quality problems are recurring, you should question whether it is time to introduce stricter rules, processes and quality tools.

6. No static analysis

You should get input and information from every available source that you can.
John Carmack wrote a great article about why it is important to pursue static analysis which serves as a motto for modern software development best practices.

What can I do about it?

You should also pursue static analysis and code linting.
If you use Javascript, take a look at JSHint.
If you use PHP, take a look at PHPMD, PHPCS and see their review and other tools in our Review of PHP Static Analysis Tools.
If you use Python, take a look at PyLint.
If you use Scala, take a look at Scalastyle
and CSSLint for CSS

If you want to use all of the tools above combined, organized and improved with a lot of features, you should take a look at our automated code review tool Codacy.

Codacy

Brought to you by the makers of Codacy, an automated code review tool focused on giving you code analysis results that matter.
We simplify and save time of your __code reviews and pull requests.