CN115237425A - Code viewing method and device, computer equipment and storage medium - Google Patents

Code viewing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115237425A
CN115237425A CN202210929168.5A CN202210929168A CN115237425A CN 115237425 A CN115237425 A CN 115237425A CN 202210929168 A CN202210929168 A CN 202210929168A CN 115237425 A CN115237425 A CN 115237425A
Authority
CN
China
Prior art keywords
code
viewing
information
user
opinion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210929168.5A
Other languages
Chinese (zh)
Inventor
胡纪云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202210929168.5A priority Critical patent/CN115237425A/en
Publication of CN115237425A publication Critical patent/CN115237425A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application belongs to the field of data processing, and relates to a code viewing method, which comprises the following steps: after a preset code inspection plug-in is configured in the code development tool, starting a working page corresponding to the code inspection plug-in; responding to a creation instruction which is triggered in a work page by a user and corresponds to a code viewing theme, and displaying a preset theme dialog box; receiving the viewing code information input by a user in the topic dialog box, and displaying a target code file corresponding to the viewing code information; receiving a viewing opinion input by a user and corresponding to a designated code selected from the target code file; generating a record table based on the specified codes and the inspection opinions; and displaying the record table in the work interface. The application also provides a code viewing device, computer equipment and a storage medium. In addition, the present application also relates to blockchain techniques, where the inspection opinion may be stored in a blockchain. The method and the device improve the processing efficiency of generating the inspection opinions and improve the data integrity and accuracy of the inspection opinions.

Description

Code viewing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a code viewing method and apparatus, a computer device, and a storage medium.
Background
Code inspection is an important link in the software development process, bug can be found in advance through code inspection, human errors are reduced, and project quality is improved; and the code level of the code inspection participants can be effectively improved, and a good technical atmosphere is created for a team.
The existing code inspection process needs to manually record found code defects, generally, the code defects are recorded as text documents, the content formats are disordered, and in most cases, in order to save recording time, only defect descriptions are recorded, and specific files and codes are not recorded in detail. This may result in the defect description being viewed afterwards, failing to immediately associate the specific code, or even being forgotten. If the viewing records are sent to team members who are not participating all the way, there is no clear way to know where the code is problematic. And code defect modification can also be missed and can only be supervised by people. Therefore, the conventional code inspection processing process needs to consume more human resources, has low processing efficiency, and cannot ensure the integrity and the accuracy of the generated inspection opinions of the codes.
Disclosure of Invention
An object of the embodiments of the present application is to provide a code inspection method, an apparatus, a computer device, and a storage medium, so as to solve the technical problems that the existing code inspection processing process needs to consume more human resources, the processing efficiency is low, and the integrity and accuracy of the generated inspection opinions for the code cannot be guaranteed.
In order to solve the above technical problem, an embodiment of the present application provides a code inspection method, which adopts the following technical solutions:
after a preset code viewing plug-in is configured in a code development tool, starting a working page corresponding to the code viewing plug-in;
responding to a creation instruction which is triggered in the working page by a user and corresponds to the code viewing theme, and displaying a preset theme dialog box;
receiving the viewing code information input by the user in the subject dialog box, and displaying a target code file corresponding to the viewing code information;
receiving a viewing opinion input by the user corresponding to a designated code selected from the object code file;
generating a corresponding record table based on the specified code and the viewing opinion; wherein, the record table at least comprises the item information, the position information, the code abstract information, the viewing opinion and the state information of the designated code;
and displaying the record table in the work interface.
Further, the step of generating a corresponding record table based on the specified code and the viewing comment includes:
acquiring project information, position information and code abstract information of the designated code;
generating status information corresponding to the viewing opinion based on the viewing opinion;
acquiring a preset form template;
filling the project information, the position information, the code abstract information, the viewing opinions and the state information of the designated codes to corresponding positions in the form template to obtain a filled form template;
and taking the filled form template as the record form.
Further, the step of displaying the record table in the work interface specifically includes:
acquiring a preset code detection component;
detecting and analyzing the target code file based on the code detection component to obtain a corresponding analysis opinion;
filling the analysis opinions into the record table to obtain a supplemented record table;
and displaying the supplemented record table in the working interface.
Further, the step of performing detection analysis on the target code file based on the code detection component to obtain a corresponding analysis opinion specifically includes:
configuring the code detection component within the code development tool;
carrying out standard detection on the target code file based on the code detection component to obtain a corresponding standard detection result;
performing statement detection on the target code file based on the code detection component to obtain a corresponding statement detection result;
and generating the analysis opinion based on the standard detection result and the statement detection result.
Further, after the step of displaying the record table in the work interface, the method further includes:
judging whether a storage instruction triggered by the user in the working page is received;
if yes, responding to the storage instruction, and exporting the record table to a preset document template to obtain a corresponding code viewing document;
storing the code viewing document.
Further, after the step of displaying the record table in the work interface, the method further includes:
judging whether a sharing instruction triggered by the user in the working page is received;
if yes, responding to the sharing instruction, and exporting the record table to be a target file in a preset format;
acquiring communication information of a target user;
and sending the target file to a communication address corresponding to the communication information.
Further, after the step of displaying the record table in the work interface, the method further includes:
judging whether an appointed inspection opinion meeting preset conditions exists or not;
if so, generating reminding information corresponding to the specified inspection opinions;
acquiring a preset reminding frequency;
and displaying the reminding information based on the reminding frequency.
In order to solve the above technical problem, an embodiment of the present application further provides a code viewing apparatus, which adopts the following technical solutions:
the starting module is used for starting a working page corresponding to the code inspection plug-in after a preset code inspection plug-in is configured in the code development tool;
the first response module is used for responding to a creation instruction which is triggered by a user in the working page and corresponds to the code viewing theme and displaying a preset theme dialog box;
the first display module is used for receiving the viewing code information input by the user in the topic dialog box and displaying the target code file corresponding to the viewing code information;
a receiving module, configured to receive a viewing opinion input by the user and corresponding to a specified code selected from the target code file;
the first generation module is used for generating a corresponding record table based on the specified code and the viewing opinion; wherein, the record table at least comprises the item information, the position information, the code abstract information, the viewing opinion and the state information of the designated code;
and the second display module is used for displaying the record table in the working interface.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
after a preset code viewing plug-in is configured in a code development tool, starting a working page corresponding to the code viewing plug-in;
responding to a creation instruction which is triggered in the working page by a user and corresponds to the code viewing theme, and displaying a preset theme dialog box;
receiving the viewing code information input by the user in the subject dialog box, and displaying a target code file corresponding to the viewing code information;
receiving a viewing opinion input by the user corresponding to a designated code selected from the target code file;
generating a corresponding record table based on the specified code and the viewing opinion; wherein, the record table at least comprises the item information, the position information, the code abstract information, the viewing opinion and the state information of the designated code;
and displaying the record table in the work interface.
In order to solve the foregoing technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
after a preset code viewing plug-in is configured in a code development tool, starting a working page corresponding to the code viewing plug-in;
responding to a creation instruction which is triggered in the working page by a user and corresponds to the code viewing theme, and displaying a preset theme dialog box;
receiving the viewing code information input by the user in the subject dialog box, and displaying a target code file corresponding to the viewing code information;
receiving a viewing opinion input by the user corresponding to a designated code selected from the target code file;
generating a corresponding record table based on the specified code and the viewing opinion; wherein, the record table at least comprises the project information, the position information, the code abstract information, the viewing opinion and the state information of the specified code;
and displaying the record table in the work interface.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
after a preset code inspection plug-in is configured in a code development tool, a working page corresponding to the code inspection plug-in is started; then responding to a creation instruction which is triggered in a working page by a user and corresponds to the code viewing theme, and displaying a preset theme dialog box; then receiving the viewing code information input by the user in the topic dialog box, and displaying a target code file corresponding to the viewing code information; subsequently receiving a viewing opinion input by a user and corresponding to a designated code selected from the target code file; and finally, generating a corresponding record table based on the specified code and the inspection opinions, and displaying the record table in a working interface. This application is through using configuration and use code inspection plug-in the code development instrument, can conveniently record the inspection suggestion to the code of user input, and can perfect this inspection suggestion in order to generate corresponding record form, and then show this record form, make no longer need the manual work to record the code defect of discovery, manpower resources's consumption has been reduced, the efficiency of processing of the suggestion of formation inspection has been improved effectively, the data integrality and the accuracy of inspecting the suggestion have been improved, user's use experience has been improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the description below are some embodiments of the present application, and that other drawings may be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram to which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a code viewing method according to the present application;
FIG. 3 is a schematic structural diagram of one embodiment of a code viewing device according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 101, 102, 103 to interact with a server 105 over a network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that, the code inspection method provided in the embodiments of the present application is generally executed by a server/terminal device, and accordingly, the code inspection apparatus is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flowchart of one embodiment of a code viewing method according to the present application is shown. The code viewing method comprises the following steps:
step S201, after a preset code inspection plug-in is configured in the code development tool, a working page corresponding to the code inspection plug-in is started.
In the present embodiment, the electronic device (e.g., the server/terminal device shown in fig. 1) on which the code viewing method operates. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G/5G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, an UWB (ultra wideband) connection, and other wireless connection means now known or developed in the future.
In this embodiment, the code development tool may be an IntelliJIDEA tool. The code viewing plug-in can exist in a code development tool in the form of plug-ins, and the running of the code viewing plug-in can be configured through a preset hook script, such as Jenkins or GitHooks. The code viewing plug-in can be installed in the code development tool, and specifically, the code viewing plug-in can be stored in a project structure in which the code contained in the code development tool is located. The code viewing plug-in can support multiple programming languages, and the code viewing plug-in can integrate operation carriers of codes of different programming languages in advance, such as Shell language, nodeJS language and the like, so that corresponding codes of the multiple programming languages can be directly operated on the code viewing plug-in. In addition, the IntelliJIDEA tool described above is an integrated environment developed by the java programming language. IntelliJIDEA is recognized in the industry as the best java development tool, and particularly functions in intelligent code assistant, code auto-hinting, reconfiguration, javaEE support, various version tools (git, svn, etc.), JUnit, CVS integration, code analysis, innovative GUI design, etc. can be said to be supernormal. The Jenkins is an open source software project, is a continuous integration tool developed based on Java, is used for monitoring continuous and repeated work, aims to provide an open and easy-to-use software platform, enables the software project to be continuously integrated, and supports integration of hundreds of plug-ins, and the plug-ins can be used under configuration, so that the Jenkins is a very convenient construction platform. The above-mentioned GitHooks are scripts that can trigger execution after a specific event is executed in the code development tool.
Step S202, responding to a creating instruction which is triggered by the user in the work page and corresponds to the code viewing theme, and displaying a preset theme dialog box.
In this embodiment, the creation instruction corresponding to the code viewing theme triggered by the user in the work page refers to a click operation of adding a "+" icon to the toolbar in the work page triggered by the user. The topic dialog box comprises the inspection code information which needs to be filled by the user, such as the dialog box of the information of a code inspection topic name, a code inspection participant and the like.
Step S203, receiving the viewing code information input by the user in the topic dialog box, and displaying the target code file corresponding to the viewing code information.
In this embodiment, the viewing code information at least includes a code viewing topic name, which refers to a name of a code file to be viewed. Wherein, the corresponding target code file can be inquired out based on the code viewing theme name.
Step S204, receiving the viewing opinion input by the user and corresponding to the designated code selected from the target code file.
In this embodiment, the specified code refers to a code that the user needs to add a viewing comment to the object code file. The user can select a code needing to add the viewing opinion in the target code file, namely, the specified code, and then adds a viewing opinion under the currently selected code viewing subject name through a right-key menu 'AddComment' or a shortcut key 'Alt + 3', and also can add information such as a modifier and the like. In addition, the user can also use the left mouse button to select and perform the following operations after seeing: the left mouse button dragging or Ctrl, shift and other buttons can be used for multi-row post-selection operation: 1. deleting the inspection opinions: deleting unnecessary inspection opinions; 2. update to modified state: the repaired code can mark the inspection opinion as a modified state for easy differentiation.
Step S205, generating a corresponding record table based on the specified code and the viewing opinion; the record table at least comprises item information, position information, code abstract information, viewing opinions and state information of the specified codes.
In the embodiment, the detailed implementation process of generating the corresponding record table based on the specified code and the viewing opinion will be described in further detail in the following embodiments, which will not be described in detail herein.
And step S206, displaying the record table in the work interface.
In this embodiment, after the record table is generated, the record table can be persisted in the sql ite database built in the code detection plug-in, so that the restart of the code development tool is realized without losing records, and the storage security of the record table is ensured.
After a preset code inspection plug-in is configured in a code development tool, a working page corresponding to the code inspection plug-in is started firstly; then responding to a creation instruction which is triggered in a working page by a user and corresponds to the code viewing theme, and displaying a preset theme dialog box; then receiving the viewing code information input by the user in the theme dialog box, and displaying a target code file corresponding to the viewing code information; subsequently receiving a viewing opinion input by a user and corresponding to a designated code selected from the target code file; and finally, generating a corresponding record form based on the specified code and the inspection opinion, and displaying the record form in a working interface. This application is through using configuration and use code inspection plug-in the code development instrument, can conveniently record the inspection suggestion to the code of user input, and can perfect this inspection suggestion in order to generate corresponding record form, and then show this record form, make no longer need the manual work to record the code defect of discovery, manpower resources's consumption has been reduced, the efficiency of processing of the suggestion of formation inspection has been improved effectively, the data integrality and the accuracy of inspecting the suggestion have been improved, user's use experience has been improved.
In some alternative implementations, step S205 includes the following steps:
and acquiring project information, position information and code abstract information of the specified code.
In this embodiment, after a code viewing plug-in is configured in the code development tool, when a specified code selected from an object code file by a user is detected, the code viewing plug-in automatically acquires project information, location information, and code summary information of the specified code. The item information refers to item information of an item to which the designated code belongs, and the position information refers to position information of the designated code in the target code file.
Based on the viewing opinion, generating status information corresponding to the viewing opinion.
In this embodiment, the status information is specifically an unmodified status.
And acquiring a preset form template.
And filling the project information, the position information, the code abstract information, the viewing opinions and the state information of the specified codes to corresponding positions in the form template to obtain the filled form template.
In this embodiment, the form template is created in advance according to actual usage requirements, the field information and the filling position information corresponding to each field information are preset in the form template, and the filling position of the item information, the position information, the code summary information, the inspection opinion and the status information in the form template can be determined based on the corresponding relationship between the item information, the position information, the code summary information, the inspection opinion and the status information of the designated code and the field information.
And taking the filled form template as the record form.
In the present embodiment, the generated record table also has a function of quickly locating a defective code position: double clicking on a row of the form automatically opens the associated code file and locates the code location where the viewing opinion is recorded. The content tip prompt of the viewing opinion is displayed at the initial position, so that the content of the viewing opinion does not need to be viewed in a user record form, and the use experience of a user can be improved.
After a user inputs a viewing idea corresponding to a designated code selected from an object code file, the method and the device automatically acquire the project name, the code position and the related code abstract of the designated code and fill the project name, the code position and the related code abstract into a form template to generate a record form. The generated record table records the detailed and complete viewing information related to the specified codes, so that a user can clearly look up the detailed and complete viewing information of the specified codes when the record table is displayed in the follow-up process, and the use experience of the user is improved.
In some optional implementations of this embodiment, step S206 includes the following steps:
and acquiring a preset code detection component.
In this embodiment, the code detection component, which may also be referred to as a code detection plug-in, may be constructed according to pre-constructed code detection rules. The code detection rule refers to a rule or content which needs to be detected and is preset by a user according to actual use requirements. Specifically, the process of constructing the code detection component may include: creating a code detection project, and generating a code configuration file according to the code detection project; creating a configuration rule file in a root directory of the code configuration file; and adding the code detection rule and the preset error reporting rule into a configuration rule file, and executing the configured code inspection item to obtain a code inspection component. The ESLint code format tool can be used for constructing the code inspection component, the ESLint is a completely-pluged JS code detection tool, escript is used for carrying out javascript analysis on the code, and AST syntax tree is used for modifying the code mode. Each rule constructed by ESLint is a detection plug-in, and a configurable code check plug-in can be constructed by the rule input by a user, so that the flexibility of code detection is improved.
And detecting and analyzing the target code file based on the code detection component to obtain a corresponding analysis opinion.
In this embodiment, after the code detection component is successfully configured in the code development tool, the code detection component may be used to perform specification detection and statement detection on the target code file to obtain a corresponding specification detection result and a corresponding statement detection result, and further generate an analysis suggestion based on the specification detection result and the statement detection result. The analysis opinion at least comprises a standard detection result and a statement detection result.
And filling the analysis opinions into the record table to obtain a supplemented record table.
In this embodiment, the record table may further be preset with an analysis opinion field and a filling position corresponding to the analysis opinion field, and further, the analysis opinion may be added to the filling position corresponding to the analysis opinion field, so that a supplemented record table may be obtained.
And displaying the supplemented record table in the working interface.
According to the method and the device, after the user inputs the viewing idea corresponding to the designated code selected from the target code file, the target code file can be further obtained by using the preset code detection component, and the target code file is automatically detected and analyzed, so that the content of the record table is further improved, and the richness and the accuracy of the generated record table are improved.
In some optional implementation manners, the detecting and analyzing the target code file based on the code detecting component to obtain a corresponding analysis opinion includes the following steps:
configuring the code detection component within the code development tool.
And carrying out standard detection on the target code file based on the code detection component to obtain a corresponding standard detection result.
In this embodiment, the process of performing specification detection on the target code file based on the code detection component to obtain a corresponding specification detection result may include: judging whether all codes contained in the target code file meet a preset grammar specification or not; if all codes contained in the target code file meet the grammar specification, judging that the specification checking result is that specification detection is passed; and if codes in all codes contained in the object code file do not meet the grammar specification, judging that the specification inspection result is that specification detection fails.
And performing statement detection on the target code file based on the code detection component to obtain a corresponding statement detection result.
In this embodiment, the process of performing statement detection on the target code file based on the code detection component to obtain a corresponding statement detection result may include: analyzing a loop statement in the target code file by using a code detection component; judging whether the mark in the loop sentence is used in a preset keyword or not; if the mark in the loop sentence is used in the preset keyword, judging that the sentence detection result is that the sentence detection fails; and if the mark in the loop sentence is not used in the preset keyword, judging that the sentence detection result is that the sentence detection is passed.
And generating the analysis opinion based on the standard detection result and the statement detection result.
In this embodiment, the analysis opinion includes a specification detection result and a sentence detection result.
The code detection component is used for carrying out standard detection and statement detection on the target code file, and the analysis opinions can be quickly and accurately generated based on the obtained corresponding standard detection results and statement detection results, so that the subsequent supplement and improvement of the inspection opinions corresponding to the target code file by utilizing the analysis opinions can be facilitated, and the data integrity of the inspection opinions can be improved.
In some optional implementations, after step S206, the electronic device may further perform the following steps:
and judging whether a storage instruction triggered by the user in the working page is received.
In this embodiment, the storage instruction triggered by the user in the work page refers to a click operation triggered by the user on a storage icon of a toolbar in the work page. The storage icon may also be referred to as a download icon.
And if so, responding to the storage instruction, and exporting the record table to a preset document template to obtain a corresponding code viewing document.
In this embodiment, the preset document template may specifically be a document template in a MarkDown format.
Storing the code viewing document.
In this embodiment, the storage manner of the code viewing document is not particularly limited, and may be set according to actual use requirements. For example, the code view document may be stored within a knowledge database of the team. Or the code viewing document may also be stored within the blockchain to further ensure privacy and security of the generated code viewing document.
After receiving a storage instruction triggered by a user in a working page, the method and the device can lead the record form out of a preset document template and store the obtained code viewing document for filing, so that the storage safety of the record form can be ensured.
In some optional implementations of this embodiment, after step S206, the electronic device may further perform the following steps:
and judging whether a sharing instruction triggered by the user in the working page is received.
In this embodiment, the sharing instruction triggered by the user in the work page refers to a click operation triggered by the user on a sharing icon of a toolbar in the work page. The share icon may also be referred to as a export icon.
And if so, responding to the sharing instruction, and exporting the record table to a target file in a preset format.
In this embodiment, the preset format is specifically an sql format.
And acquiring the communication information of the target user.
In this embodiment, the communication information may be mail address information of the target user.
And sending the target file to a communication address corresponding to the communication information.
In this embodiment, if the communication information is the mail address information of the target user, the corresponding communication address is the mail address corresponding to the mail address information. In addition, after the target file is sent to the target user, the target user can import the target file through the import function, so that operations such as checking, managing and viewing opinions and the like in IntelliJIDEA tools of other users can be realized, and the use experience of the user is improved.
According to the method and the device, after the record form corresponding to the viewing opinions of the codes is generated, the record form can be exported to the target file in the preset format based on the sharing instruction triggered by the user on the working page, and then the target file is sent to the communication address corresponding to the target user, so that the target user can view the target file and manage the viewing opinions, the management intelligence of the viewing opinions is improved, and the use experience of the user is improved.
In some optional implementation manners of this embodiment, after step S206, the electronic device may further perform the following steps:
and judging whether the specified inspection opinions meeting the preset conditions exist or not.
In this embodiment, the code viewing plug-in further has a viewing comment notification reminding function, and the code viewing plug-in scans the status of the viewing comments, and pops up a dialog box in the IntelliJIDEA tool to remind when the viewing comments that are in an unmodified status for a long time are found. The preset condition may refer to a condition that the unmodified state exceeds a preset duration. The value of the preset duration is not particularly limited, and may be set according to actual use requirements, for example, may be set to 48h.
And if so, generating reminding information corresponding to the specified viewing opinion.
In this embodiment, the reminding information is used to remind the user to modify the long-time unmodified code corresponding to the specified viewing opinion in time. The specific content of the reminding information is not specifically limited, and the reminding information can be generated according to actual use requirements.
And acquiring a preset reminding frequency.
In this embodiment, the reminding frequency may be preset for the relevant user according to the actual use requirement. The user can set the reminding frequency of the reminding information in the setting information of the code inspection plug-in by accessing an operation path corresponding to the code inspection plug-in, such as File- > Settings- > Other Settings- > CodeReview.
And displaying the reminding information based on the reminding frequency.
In this embodiment, the display manner of the reminder information is not specifically limited, and a dialog box including the reminder information may pop up in a window corresponding to the window position information according to the window position information of the viewing opinion in the setting information of the code viewing plugin, so as to display the reminder information.
This application can monitor the inspection suggestion intelligently to can regularly remind through the inspection suggestion that is in the unmodified state for a long time, in order to avoid appearing the condition that relevant user forgets the modification code, be favorable to improving user's use and experience, improve the processing intelligence of inspecting the suggestion.
It is emphasized that, in order to further ensure the privacy and security of the viewing comments, the viewing comments may also be stored in nodes of a block chain.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless otherwise indicated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of execution is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a code viewing apparatus, which corresponds to the embodiment of the method shown in fig. 2 and can be applied to various electronic devices.
As shown in FIG. 3, the code viewing apparatus 300 of the present embodiment includes: an initiating module 301, a first responding module 302, a first presenting module 303, a receiving module 304, a first generating module 305, and a second presenting module 306. Wherein:
the starting module 301 is configured to, after a preset code viewing plug-in is configured in a code development tool, start a working page corresponding to the code viewing plug-in;
a first response module 302, configured to respond to a creation instruction, triggered in the work page by the user, corresponding to the code viewing theme, and display a preset theme dialog box;
a first display module 303, configured to receive viewing code information input by the user in the topic dialog box, and display an object code file corresponding to the viewing code information;
a receiving module 304, configured to receive the viewing opinion input by the user corresponding to the selected specified code from the target code file;
a first generation module 305 for generating a corresponding record table based on the specified code and the viewing opinion; wherein, the record table at least comprises the item information, the position information, the code abstract information, the viewing opinion and the state information of the designated code;
a second displaying module 306, configured to display the record table in the work interface.
In this embodiment, the operations performed by the modules or units respectively correspond to the steps of the code inspection method of the foregoing embodiment one by one, and are not described herein again.
In some optional implementations of the present embodiment, the first generating module 305 includes:
the first acquisition submodule is used for acquiring the project information, the position information and the code abstract information of the specified code;
the first generation sub-module is used for generating state information corresponding to the viewing opinion based on the viewing opinion;
the second obtaining submodule is used for obtaining a preset form template;
the first filling sub-module is used for filling the project information, the position information, the code abstract information, the viewing opinions and the state information of the specified codes into corresponding positions in the form template to obtain a filled form template;
and the determining submodule is used for taking the filled form template as the record form.
In this embodiment, the operations performed by the modules or units are corresponding to the steps of the code inspection method in the foregoing embodiment, and are not described herein again.
In some optional implementations of this embodiment, the second display module 306 includes:
the third acquisition submodule is used for acquiring a preset code detection assembly;
the analysis submodule is used for carrying out detection analysis on the target code file based on the code detection component to obtain a corresponding analysis suggestion;
the second filling submodule is used for filling the analysis opinions into the record table to obtain a supplemented record table;
and the display submodule is used for displaying the supplemented record table in the working interface.
In this embodiment, the operations executed by the modules or units respectively correspond to the steps of the code inspection method in the foregoing embodiment one by one, and are not described herein again.
In some optional implementations of this embodiment, the analysis submodule includes:
a configuration unit to configure the code detection component within the code development tool;
the first detection unit is used for carrying out standard detection on the target code file based on the code detection component to obtain a corresponding standard detection result;
the second detection unit is used for carrying out statement detection on the target code file based on the code detection component to obtain a corresponding statement detection result;
and the generating unit is used for generating the analysis opinions based on the standard detection result and the statement detection result.
In this embodiment, the operations performed by the modules or units are corresponding to the steps of the code inspection method in the foregoing embodiment, and are not described herein again.
In some optional implementations of this embodiment, the code viewing apparatus further includes:
the first judgment module is used for judging whether a storage instruction triggered by the user in the working page is received or not;
the second response module is used for responding to the storage instruction if the code is in the storage state, and exporting the record table to a preset document template to obtain a corresponding code viewing document;
and the storage module is used for storing the code viewing document.
In this embodiment, the operations performed by the modules or units are corresponding to the steps of the code inspection method in the foregoing embodiment, and are not described herein again.
In some optional implementations of this embodiment, the code viewing apparatus further includes:
the second judgment module is used for judging whether a sharing instruction triggered by the user in the working page is received or not;
the third response module is used for responding to the sharing instruction if the sharing instruction is received, and exporting the record table to a target file in a preset format;
the first acquisition module is used for acquiring the communication information of a target user;
and the sending module is used for sending the target file to a communication address corresponding to the communication information.
In this embodiment, the operations performed by the modules or units are corresponding to the steps of the code inspection method in the foregoing embodiment, and are not described herein again.
In some optional implementations of this embodiment, the code viewing apparatus further includes:
the third judgment module is used for judging whether the specified inspection opinions meeting the preset conditions exist or not;
the second generation module is used for generating reminding information corresponding to the specified viewing opinion if the first generation module is used for generating the reminding information corresponding to the specified viewing opinion;
the second acquisition module is used for acquiring a preset reminding frequency;
and the third display module is used for displaying the reminding information based on the reminding frequency.
In this embodiment, the operations performed by the modules or units are corresponding to the steps of the code inspection method in the foregoing embodiment, and are not described herein again.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It is noted that only computer device 4 having components 41-43 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to instructions set or stored in advance, and the hardware thereof includes but is not limited to a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 4. Of course, the memory 41 may also include both an internal storage unit of the computer device 4 and an external storage device thereof. In this embodiment, the memory 41 is generally used for storing an operating system installed on the computer device 4 and various types of application software, such as computer readable instructions of a code viewing method. Further, the memory 41 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for executing the code viewing method.
The network interface 43 may comprise a wireless network interface or a wired network interface, and the network interface 43 is generally used for establishing communication connection between the computer device 4 and other electronic devices.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in the embodiment of the application, after a preset code inspection plug-in is configured in a code development tool, a working page corresponding to the code inspection plug-in is started firstly; then responding to a creation instruction which is triggered in a working page by a user and corresponds to the code viewing theme, and displaying a preset theme dialog box; then receiving the viewing code information input by the user in the topic dialog box, and displaying a target code file corresponding to the viewing code information; subsequently receiving a viewing opinion input by a user and corresponding to a designated code selected from the target code file; and finally, generating a corresponding record table based on the specified code and the inspection opinions, and displaying the record table in a working interface. This application is through using configuration and use code inspection plug-in the code development instrument, can conveniently record the inspection suggestion to the code of user input, and can perfect this inspection suggestion in order to generate corresponding record form, and then show this record form, make no longer need the manual work to record the code defect of discovery, manpower resources's consumption has been reduced, the efficiency of processing of the suggestion of formation inspection has been improved effectively, the data integrality and the accuracy of inspecting the suggestion have been improved, user's use experience has been improved.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the code viewing method as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in the embodiment of the application, after a preset code inspection plug-in is configured in a code development tool, a working page corresponding to the code inspection plug-in is started firstly; then responding to a creation instruction which is triggered in a working page by a user and corresponds to the code viewing theme, and displaying a preset theme dialog box; then receiving the viewing code information input by the user in the topic dialog box, and displaying a target code file corresponding to the viewing code information; subsequently receiving a viewing opinion input by a user and corresponding to a designated code selected from the target code file; and finally, generating a corresponding record form based on the specified code and the inspection opinion, and displaying the record form in a working interface. This application is through using configuration and use code inspection plug-in the code development instrument, can conveniently record the inspection suggestion to the code of user input, and can perfect this inspection suggestion in order to generate corresponding record form, and then show this record form, make no longer need the manual work to record the code defect of discovery, manpower resources's consumption has been reduced, the efficiency of processing of the suggestion of formation inspection has been improved effectively, the data integrality and the accuracy of inspecting the suggestion have been improved, user's use experience has been improved.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A method for code inspection, comprising the steps of:
after a preset code inspection plug-in is configured in a code development tool, starting a working page corresponding to the code inspection plug-in;
responding to a creation instruction which is triggered in the working page by a user and corresponds to the code viewing theme, and displaying a preset theme dialog box;
receiving the viewing code information input by the user in the subject dialog box, and displaying a target code file corresponding to the viewing code information;
receiving a viewing opinion input by the user corresponding to a designated code selected from the target code file;
generating a corresponding record table based on the specified code and the viewing opinion; wherein, the record table at least comprises the item information, the position information, the code abstract information, the viewing opinion and the state information of the designated code;
and displaying the record table in the work interface.
2. The method for viewing code according to claim 1, wherein said step of generating a corresponding record form based on said specified code and said viewing comment comprises:
acquiring project information, position information and code abstract information of the designated code;
generating status information corresponding to the viewing opinion based on the viewing opinion;
acquiring a preset form template;
filling the project information, the position information, the code abstract information, the viewing opinions and the state information of the designated codes to corresponding positions in the form template to obtain a filled form template;
and taking the filled form template as the record form.
3. The method for viewing code according to claim 1, wherein said step of presenting said record form in said work interface comprises:
acquiring a preset code detection component;
detecting and analyzing the target code file based on the code detection component to obtain a corresponding analysis opinion;
filling the analysis opinions into the record table to obtain a supplemented record table;
and displaying the supplemented record table in the working interface.
4. The method according to claim 3, wherein the step of detecting and analyzing the object code file based on the code detection component to obtain the corresponding analysis opinion comprises:
configuring the code detection component within the code development tool;
carrying out standard detection on the target code file based on the code detection component to obtain a corresponding standard detection result;
performing statement detection on the target code file based on the code detection component to obtain a corresponding statement detection result;
and generating the analysis opinion based on the standard detection result and the statement detection result.
5. The code viewing method of claim 1, wherein after the step of presenting the record form in the work interface, further comprising:
judging whether a storage instruction triggered by the user in the working page is received;
if yes, responding to the storage instruction, and exporting the record table to a preset document template to obtain a corresponding code viewing document;
storing the code viewing document.
6. The code viewing method of claim 1, wherein after the step of presenting the record form in the work interface, further comprising:
judging whether a sharing instruction triggered by the user in the working page is received;
if yes, responding to the sharing instruction, and exporting the record table into a target file with a preset format;
acquiring communication information of a target user;
and sending the target file to a communication address corresponding to the communication information.
7. The code viewing method of claim 1, wherein after the step of presenting the record form in the work interface, further comprising:
judging whether an appointed inspection opinion meeting preset conditions exists or not;
if so, generating reminding information corresponding to the specified viewing opinions;
acquiring a preset reminding frequency;
and displaying the reminding information based on the reminding frequency.
8. A code viewing apparatus, comprising:
the starting module is used for starting a working page corresponding to a code viewing plug-in after a preset code viewing plug-in is configured in a code development tool;
the first response module is used for responding to a creation instruction which is triggered by a user in the working page and corresponds to the code viewing theme and displaying a preset theme dialog box;
the first display module is used for receiving the viewing code information input by the user in the topic dialog box and displaying the target code file corresponding to the viewing code information;
a receiving module, configured to receive a viewing opinion input by the user and corresponding to a specified code selected from the target code file;
a first generation module, configured to generate a corresponding record table based on the specified code and the viewing opinion; wherein, the record table at least comprises the item information, the position information, the code abstract information, the viewing opinion and the state information of the designated code;
and the second display module is used for displaying the record table in the working interface.
9. A computer apparatus comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of the code viewing method of any of claims 1 to 7.
10. A computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the steps of the code viewing method of any of claims 1 to 7.
CN202210929168.5A 2022-08-03 2022-08-03 Code viewing method and device, computer equipment and storage medium Pending CN115237425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210929168.5A CN115237425A (en) 2022-08-03 2022-08-03 Code viewing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210929168.5A CN115237425A (en) 2022-08-03 2022-08-03 Code viewing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115237425A true CN115237425A (en) 2022-10-25

Family

ID=83677904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210929168.5A Pending CN115237425A (en) 2022-08-03 2022-08-03 Code viewing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115237425A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024104054A1 (en) * 2022-11-14 2024-05-23 华为云计算技术有限公司 Code viewing method and apparatus, device cluster, and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024104054A1 (en) * 2022-11-14 2024-05-23 华为云计算技术有限公司 Code viewing method and apparatus, device cluster, and storage medium

Similar Documents

Publication Publication Date Title
US20210133632A1 (en) Systems and methods for model monitoring
CA2684822C (en) Data transformation based on a technical design document
US20170357486A1 (en) Enhancing a crowdsourced integrated development environment application
US11443144B2 (en) Storage and automated metadata extraction using machine teaching
US10175954B2 (en) Method of processing big data, including arranging icons in a workflow GUI by a user, checking process availability and syntax, converting the workflow into execution code, monitoring the workflow, and displaying associated information
US20160314408A1 (en) Leveraging learned programs for data manipulation
US11418592B2 (en) Uploading user and system data from a source location to a destination location
CN110278143B (en) E-mail data processing method and device, computer equipment and storage medium
US11443239B2 (en) Interface for machine teaching modeling
US20160012082A1 (en) Content-based revision history timelines
CN112394908A (en) Method and device for automatically generating embedded point page, computer equipment and storage medium
US11720376B2 (en) Methods and systems for content generation via templates with rules and/or triggers
US20200371754A1 (en) Use and advancements of assistive technology in automation for the visually-impaired workforce
CN115237425A (en) Code viewing method and device, computer equipment and storage medium
CN114185750A (en) Process monitoring method, device, equipment and storage medium
CN116974929A (en) Automatic test tool construction method, automatic test method and related equipment thereof
CN115757075A (en) Task abnormity detection method and device, computer equipment and storage medium
CN114968725A (en) Task dependency relationship correction method and device, computer equipment and storage medium
CN115481025A (en) Script recording method and device for automatic test, computer equipment and medium
CN112069807A (en) Text data theme extraction method and device, computer equipment and storage medium
CN110851346A (en) Method, device and equipment for detecting boundary problem of query statement and storage medium
US9965131B1 (en) System and processes to capture, edit, and publish problem solving techniques
CN113918142B (en) Data acquisition task code generation method, device and computer equipment
CN115033240A (en) Processing method and device for error reporting information, computer equipment and storage medium
CN114879952A (en) Popup control method based on low-code platform and related equipment thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination