Code analysis method and system

A code analysis and code technology, applied in the field of code analysis methods and systems, can solve problems such as incompatibility with enterprise-level code analysis, low code analysis efficiency, poor flexibility, etc., to achieve the effect of improving efficiency and flexibility

CN102193859AActive Publication Date: 2011-09-21SHENZHEN SHI JI GUANG SU INFORMATION TECH
4 Cites 8 Cited by

Patent Information

Authority / Receiving Office
CN · China
Current Assignee / Owner
Publication Date
2011-09-21

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention is suitable for the field of computer software and provides a code analysis method and system. The method comprises the following steps of: collecting code information and establishing an index database; according to a configured checking rule, querying the index database, thereby acquiring a query result; and performing code analysis on the query result and outputting a code analysis result. According to the method, the code is collected, the index is established and the code query result is analyzed, so that code reading is separated from code analysis, the efficiency and flexibility of code analysis are greatly increased, the enterprise-level codes are analyzed and managed, and code collection and the index can be realized by utilizing a search engine.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention belongs to the field of computer software, in particular to a code analysis method and system. Background technique

[0002] Code analysis, also known as code scanning or code inspection, mainly checks the degree of compliance of the source code to the standard, the level of readability, the correctness of the code logic expression, and the rationality of the code structure. Through code analysis, you can find problems that violate the programming standards in the program, as well as unsafe, ambiguous and vague parts in the program, and find out the repetitive or non-portable parts in the program. Code analysis includes variable inspection, naming and type inspection, program logic inspection, program syntax inspection, and program structure inspection.

[0003] At present, there are many tools for implementing code analysis, and the technical methods adopted are similar, such as figure 1 As shown, it is generally divided into three par...

Examples

Embodiment Construction

[0022] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0023] The embodiment of the present invention collects and processes codes, establishes an index database, uses a high-speed query interface to query, and performs code analysis on the query results, which can greatly improve the efficiency and flexibility of code analysis, and realize enterprise-level code analysis and management.

[0024] figure 2 The implementation flow of the code analysis method provided by the embodiment of the present invention is shown, and the details are as follows:

[0025] In step S101, code information is collected, and an index library is established;

[0026] As ...