Skip to main content

Code Changes Lines

From For

Definition

Code Changes Lines is a metric defined by the CHAOSS community. For a detailed definition of this metric, please refer to CHAOSS Metrics - Code Changes Lines.

The Code Changes Lines metric considers the aggregated number of lines touched by changes to the source code performed during a certain period. This means that if a certain line in a certain file is touched in three different changes, it will count as three lines. Since in most source code management systems it is difficult or impossible to tell accurately if a line was removed and then added, or just edited, we will consider editing a line as removing it and later adding it back with new content. Each of those (removing and adding) will be considered as "touching". Therefore, if a certain line in a certain file is edited three times, it will count as six different changes (three removals, and three additions).

The Code Changes Lines metric provides insights into the volume of code changes, helping to understand the activity and effort involved in maintaining and developing the source code.

Data

  • Link (add): https://oss.open-digger.cn/{platform}/{owner}/{repo}/code_change_lines_add.json
  • Link (remove): https://oss.open-digger.cn/{platform}/{owner}/{repo}/code_change_lines_remove.json
  • Link (sum): https://oss.open-digger.cn/{platform}/{owner}/{repo}/code_change_lines_sum.json

To get the data for a certain repository, replace {platform}, {owner} and {repo} with the actual name. For the add variant, here is an example. Similarly, for the remove variant, refer to this example & for the sum variant, refer to this example.

Code

Here's the implementation code.

CodePen Demo