| Code is an important part of a software product,and the quality of the code reflects the quality of the software.The number of software companies' daily code is increasing in the form of an index.As the number of codes increases,and the team gradually expands and changes occur constantly,the quality control of the code becomes more and more important.Therefore,an automated code quality control platform is needed to maintain the quality of existing code and to strictly control the quality of new incoming code to ensure overall code quality.The paper analyzes the code quality control requirements of a large domestic Internet company and completes the analysis and design of the code quality control platform system.The goal of the platform is to manage the overall quality of the company's internal code,to achieve code problem detection and quality control.The platform adopts a layered architecture to implement code coverage detection technology in various programming languages,and integrates the platform with mature technologies such as Elastic Search,MySQL and SonarQube.This platform is mainly composed of the following four functional modules:(1)Coverage detection:Develop code coverage tools for multiple languages,use coverage tools and test cases to detect coverage of existing and new code,form mappings between modules and use cases,and store them in In the data search engine.(2)Impact surface analysis:Detect the modified module in the incremental code,extract the module information and compare the data in the data search engine,and generate an impact surface evaluation report of the incremental code.(3)Static code scanning:static code scanning of full and incremental codes,detecting the quality of the code before the code is submitted.(4)Code security detection:Check the security of the code before the code goes online to prevent security problems such as loopholes after going online.In the design and implementation process of this platform,I participated in the system's needs analysis and independently completed the development of the entire platform.The main work includes the development of multi-language coverage tool set.The main coverage languages are PHP,Go,Java,C/C++and other mainstream programming languages;for the development of coverage detection module,the main function is to use the multi-language coverage tool set to detect the coverage of the code and store the result;the development impact analysis module is mainly The code scans and generates reports based on the mapping results;develops static code scanning tools,security detection tools,and integrates them into the sonar platform.Integrate into the platform after all modules are developed and test the platform.At present,the code quality control platform has been applied across multiple departments of the Internet company and achieved the expected goals. |