Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Code static auditing device and method

A code and static technology, applied to code static review devices and fields, to achieve efficient solution, efficient discovery, and efficient code problems

Inactive Publication Date: 2018-04-13
SNAIL GAMES
View PDF5 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The technical problem to be solved by the present invention is to overcome the disadvantages of reviewing codes that need associated files or pass compilation when reviewing files, and provide a method that can review any file at any time, so that reviewers can review other people's codes without any engineering environment restrictions. Let developers check their own code at any time during the development process

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Code static auditing device and method
  • Code static auditing device and method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0033] As an example for the [pointer not protected] check item, the audit method is as follows:

[0034] Step 1: Analyze and check items: According to the actual situation, the definition structure of the pointer is generally in the format of [type * pointer variable name], and there are common characteristics when there is a null pointer, that is, this [pointer variable] before use No protection was done.

[0035] Step 2: We need to check which are pointer variable names. According to the lexical rules, the first one to appear is the * symbol, followed by a string (starting with letters or underscores and starting with letters, underscores, numbers, etc.) String, this string is the required pointer variable name. For example, if such int*pXXX code statement is scanned, according to the above lexical description, after scanning *, the first one will be recorded, and a series of strings will appear after scanning *. The lexical rule that the two digits start to consist of le...

Embodiment 2

[0040] Take the [divisor protection] check item as an example, and the audit method is as follows:

[0041] Step 1: Analyze and check items: According to the actual situation, the definition structure of the divisor is generally in the format of [ / divisor variable name], and the problem of divisor protection has a common feature, that is, this [divisor variable] has no Make a judgment whether it is 0.

[0042] Step 2: We need to check which are the divisors. According to the lexical rules, the first occurrence of the / symbol is followed by a string (starting with letters or underscores and starting with letters, underscores, numbers, etc.) , this string is the desired divisor variable. Such as scanning to such a temp=nMax / nCount code statement, according to the above lexical description, after scanning to / , the first one will be recorded, and a series of character strings will appear after the scan / . The second digit at the beginning begins to consist of letters, undersco...

Embodiment 3

[0047] Take an example of the [Array subscript out-of-bounds protection] check item, and the audit method is as follows:

[0048] Step 1: Analysis and inspection items: According to the actual situation, the definition structure of the subscript is generally in the format of [[subscript variable name]]. The problem of subscript out-of-bounds protection has a common feature, that is, this [subscript variable] There is no value range judgment before use.

[0049]Step 2: We need to check which are subscript variables. According to the lexical rules, the first occurrence of the [ symbol is followed by a string (starting with letters or underscores and starting with letters, underscores, numbers, etc.) String, plus a ] symbol at the end, this string is the required subscript variable name. For example, after scanning such a vEveryKom[index] code statement, according to the above description, after scanning the [ symbol, start to record the first one, and scan a series of strings t...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a code static auditing device and method. The auditing device comprises an analysis module, a variable partition module, a detection rule generating module, a check rule judging module and a logical protection judging module, wherein the analysis module is used for analyzing the structures and characteristics of items needing to be checked; the variable partition module isused for partitioning variables of the items needing to be checked according to a structural morphology rule; the detection rule generating module is used for building a regular expression taken as adetection rule according to the characteristics and variables of the items needing to be checked; the check rule judging module is used for judging whether the variables partitioned by the variable partition module conform to a check rule or not through the regular expression built through the detection rule production module; and the logical protection judging module is used for scanning the context of codes which do not conform to the check rule, and judging whether logical protection is available or not. Compared with the prior art, the code review method disclosed by the invention has theadvantages that codes can be audited without compiling the codes or associating a plurality of files, and code problems can be found and solved more efficiently.

Description

Technical field: [0001] The invention relates to a method and a device for directly auditing static codes of any file without associating with any other files or compiling. Background technique: [0002] There are many code review tools on the market. Although they support many functions, their use conditions require that the code project needs to be compiled and passed before code review can be performed. The static review on the market also has this problem, which requires multiple files and compilation. to review. There is no way that any file or folder can be audited without being associated with anything. It also fails to provide developers and reviewers with the ability to quickly detect code issues at any time. And in actual use, developers or auditors are more concerned about the files (code files) or folders (folders including many code files) he wants to audit, rather than auditing all files or the entire project. Invention content: [0003] The technical prob...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/41
CPCG06F8/43
Inventor 黄海虎黄志文
Owner SNAIL GAMES
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products