How to Improve Code Quality?

Ref: https://www.perforce.com/blog/sca/what-code-quality-and-how-improve-it

Measuring quality helps you understand where you’re at. After you’ve measured, you can take steps to improve overall quality.

Here are four ways you can improve code quality.

1. Use a Coding Standard
Using a coding standard is one of the best ways to ensure high quality code.

A coding standard makes sure everyone uses the right style. It improves consistency and readability of the codebase. This is key for lower complexity and higher quality.

How to Do It
The best way to use a coding standard is to:

  • Train your developers
  • Help them to comply with it
  • You can do this by using a static code analyzer.

2. Analyze Code — Before Code Reviews

Quality should be a priority from the very start of development. There isn’t always the luxury of time as development progresses. That’s why it’s important to analyze code before code reviews begin. And it’s best to analyze code as soon as it’s written.

In DevOps, code analysis takes place during the create phase. Static analyzers can be run over code as soon as it’s written. This creates an automated feedback loop, so developers can improve code before it goes to the code review phase.

After all, the earlier you find errors, the faster, easier, and cheaper they are to resolve.

How to Do It
The best way to improve quality is by analyzing code automatically. By running a static analyzer over code early and often, you’ll make sure the code that gets to the code review phase is the highest quality possible. Plus, you can use static analyzers (such as Helix QAC) to monitor key quality metrics.

3. Follow Code Review Best Practices
Manual code reviews are still important for verifying the intent of the code. When code reviews are done well, they improve overall software quality.

How to Do It
The best way to do code reviews is to follow best practices and take advantage of automated tools.

4. Refactor Legacy Code (When Necessary)
One way to improve the quality of an existing codebase is through refactoring. Refactoring legacy code can help you clean up your codebase and lower its complexity.

[Reproduced] How to Improve Code Quality?的更多相关文章

  1. What is Code Quality?

    Ref detail : https://realpython.com/python-code-quality/ What is Code Quality? Of course you want qu ...

  2. Code Quality

    Code Quality https://www.sonarqube.org/ java https://www.sonarsource.com/products/codeanalyzers/sona ...

  3. WebGoat系列实验Buffer Overflows & Code Quality & Concurrency

    WebGoat系列实验Buffer Overflows & Code Quality & Concurrency Off-by-One Overflows 实验需要访问OWASP Ho ...

  4. jshint-eclipse: JavaScript Code Quality Plugin for Eclipse

    https://blog.oio.de/2012/03/26/jshint-eclipse-javascript-code-quality-plugin-for-eclipse/   techscou ...

  5. Code Quality and Security | SonarQube

    SonarQube - 国内版 Binghttps://cn.bing.com/search?FORM=U227DF&PC=U227&q=SonarQube Code Quality ...

  6. Peer Code Reviews Made Easy with Eclipse Plug-In

    欢迎关注我的社交账号: 博客园地址: http://www.cnblogs.com/jiangxinnju/p/4781259.html GitHub地址: https://github.com/ji ...

  7. Code Complete阅读笔记(三)

    2015-05-26   628   Code-Tuning Techniques    ——Even though a particular technique generally represen ...

  8. 自动化测试UI Test, Performance Test, Load Test 总结整理

    MSDN: 测试应用程序,Test apps early and often ,Improve Code Quality 推荐书: <Visual Studio 2015高级编程> < ...

  9. A Practical Guide to Distributed Scrum - 分布式Scrum的实用指南 - 读书笔记

    最近读了这本IBM出的<A Practical Guide to Distributed Scrum>(分布式Scrum的实用指南),书中的章节结构比较清楚,是针对Scrum项目进行,一个 ...

随机推荐

  1. Android存储及getCacheDir()、getFilesDir()、getExternalFilesDir()、getExternalCacheDir()区别:

    存储介绍: Android系统分为内部存储和外部存储,内部存储是手机系统自带的存储,一般空间都比较小,外部存储一般是SD卡的存储,空间一般都比较大,但不一定可用或者剩余空间可能不足.一般我们存储内容都 ...

  2. Java分布式:分布式锁之Redis实现

    Java分布式:分布式锁之Redis实现 分布式锁系列教程重点分享锁实现原理 Redis锁原理 核心命令 Redis分布式锁的原理是基于其SETNX命令,我们来看SETNX的解释. 实现过程 使用SE ...

  3. 读Secrets of the JavaScript Ninja(二)对象

    面向对象和原型 理解原型 在JavaScript中,可通过原型实现继承.原型的概念很简单.每个对象都含有原型的引用,当查找属性时,若对象本身不具有该属性,则会查找原型上是否有该属性. 每个对象都可以有 ...

  4. spark 性能优化简要总结

    1.从同一个数据源尽量只创建一个rdd,后续业务逻辑复用该rdd2.如果要对某个rdd进行多次的transformation或action操作,应当持久化该rdd3.从数据源读取到rdd后,要尽早的进 ...

  5. dockerfile使用

    一.构筑镜像命令 docker build -t test/nginx:v1.0 - prese/nginx:v1.0 -f /git/dockerfile . -t:指定存储库:镜像名和标签保存新镜 ...

  6. 【idea】【sonarlint】指定文件夹扫描

    选择文件夹右键->Analyze->Analyze with SonarLint

  7. matlab循环中显示figure时窗口跳动

    在Matlab中,当在一个循环内部利用figure显示图片时,有时候会出现窗口跳动,尤其是两个显示器的时候, 具体就是每次循环中显示的figure的位置都出现在屏幕的不同位置,导致看起来灰常不爽 go ...

  8. 【剑指offer】对称的二叉树

    题目描述 请实现一个函数,用来判断一颗二叉树是不是对称的.注意,如果一个二叉树同此二叉树的镜像是同样的,定义其为对称的. 分析:从上到下直接遍历,利用栈或者队列暂存结点,注意结点的存和取都是成对的 c ...

  9. Mysql Lua语言拼接

    [1]Mysql Lua语言拼接实例 (1)基本语句 local sql = "select * from task_control where cycle_id = '" .. ...

  10. mysql5.7新增加用户和授权

    迁移mysql数据库,运行项目的时候发现nginx和uWSGI都配置正确,可就是网站打不开,看了log文件,发现错误: django.db.utils.OperationalError: (1044, ...