Code Metrics: How good is your code ?

Code review and code metrics are two facts of life that a good developer cannot (or should not) escape. Code metrics are ways of quantifying traits about your source code that can give developers feedback about the quality of the source code. Code metrics are usually run by an automated process like a continuos integration process (see Continuous Integration: Going Beyond Builds). Setting up a process to generate code metrics and collecting them at intervals is quite easy. However code metrics is a slippery slope because it will also give you tools to squarely point a finger at your developers and tell them how bad their code is, when in reality nothing may be wrong with their code. It is very important to know how to interpret the metrics in the context of your application and developers. So let's have a look at few of those metrics.

One of the most often used metrics is LoC (Lines of Code) or KLoC (Kilo Lines of Code). It is either the most liked metrics (mostly managers) or the most hated metric (mostly developers). Simply put it is the number of lines of code your developers can hammer out, not counting the comments, spaces and auto generated code. Some people tend to equate this to productivity and that may or may not be true based on the context in which it is interpreted. More often than not by itself this metric is not very useful, however it does need to be measured as it can provide a base for other useful metrics like LoC/class or function, bug density i.e. number of bugs per lines of code, etc both of which should always be low.

You can read the complete article here Code Metrics: How good is your code ?

要查看或添加评论,请登录

Nilesh Nimkar的更多文章

  • Diagram as Code with Python

    Diagram as Code with Python

    As a Cloud Native Development Architect everything for me usually starts with a diagram. Sometimes I create the diagram…

    3 条评论
  • The Holy Grail called Immutable Infrastructure

    The Holy Grail called Immutable Infrastructure

    it is quite common to fix small problems directly on production servers by directly logging on to them and then back…

    1 条评论
  • Database Version Control Tools

    Database Version Control Tools

    A couple of years ago I wrote a blog post about Database Versioning and how it was ignored over source code versioning.…

    2 条评论
  • Walmart's OneOps: A Closer Look.

    Walmart's OneOps: A Closer Look.

    Walmartlabs recently released OneOps into the wild as an open source project. Walmart's OneOps is a Application…

  • DevOps: An Organic Evolution

    DevOps: An Organic Evolution

    The benefits of DevOps are immense as can be seen here, here, here and many other similar examples. Although many of…

    3 条评论
  • Version Control: Branching Models

    Version Control: Branching Models

    A good developer always versions his or her code. And all good version control systems provide means to create branches.

    1 条评论
  • Database Versioning: Using Liquibase

    Database Versioning: Using Liquibase

    Last week I wrote an article about Database Versioning called Database Versioning: The ignored aspect of version…

    1 条评论
  • Database Versioning: The ignored aspect of version control.

    Database Versioning: The ignored aspect of version control.

    Version control is an important aspect of writing code. From the initial check-in to the final build, it is crucial to…

    1 条评论

社区洞察

其他会员也浏览了