Abstract

To ensure the internal code quality of contributions in open source software (OSS) communities, static analysis tools (e.g. Code Climate and SonarQube) have been integrated into the modern pull-based workflow for detecting code quality issues (CQIs). Automated CQI fixing is conducive to improve the efficiency of converging massive contributions. In this paper, we propose a history-driven approach to automatically fix CQIs utilizing the fixing knowledge mined from the change history in the code repositories. We collected 5,047,678 CQI isstances, 31,013 fixes of the CQIs that were detected by SonarQube from 206 GitHub projects and mined 68 common Fix Patterns for 56 CQI types. Evaluated by fixing the unfix CQI Instances, we find that the average correctness of our approach is 80% in top 1 fix patch and 69.17% of Top 5. We further conducted a live study by sending CQI’s fix patches to GitHub projects. The results show that developers approved or merged 11 of 17 patches.

Highlights

  • The code quality plays an essential role for software project’s success [5]

  • Star is corresponding with the GitHub users who are interested in this project, Loc describe the line of Java Code in the project and code quality issues (CQIs) Fix Commits are commit that is related with CQI Fix

  • WORK In this paper, we propose a history-driven approach to automatically fix CQIs

Read more

Summary

Introduction

Code quality can be classified as internal and external quality attributes [4]. The external quality attributes are reflected at runtime stage such as functionality and correctness, while internal quality attributes exist in development and maintenance [2], which is concerned by developers, such as maintainability and readability. High internal quality source code improves the readability of code and help developers quickly understand explicit and implicit meanings expressed by code, and reduces the risk of crash and the cost of software maintenance [7]. We focus on the internal quality attributes from the point of view of developers, since it’s critical for developers to review, maintain source code in Pull-based code contributions of OSS community. CQIs can be classified as Vulnerability, Bug and Code Smell

Results
Discussion
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call