CN111930632A - Method for detecting quality of front-end code - Google Patents

Method for detecting quality of front-end code Download PDF

Info

Publication number
CN111930632A
CN111930632A CN202010835304.5A CN202010835304A CN111930632A CN 111930632 A CN111930632 A CN 111930632A CN 202010835304 A CN202010835304 A CN 202010835304A CN 111930632 A CN111930632 A CN 111930632A
Authority
CN
China
Prior art keywords
code
development
quality
processor
codes
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
CN202010835304.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.)
Shandong Health Medical Big Data Co ltd
Original Assignee
Shandong Health Medical Big Data Co 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 Shandong Health Medical Big Data Co ltd filed Critical Shandong Health Medical Big Data Co ltd
Priority to CN202010835304.5A priority Critical patent/CN111930632A/en
Publication of CN111930632A publication Critical patent/CN111930632A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method for detecting the quality of a front-end code, which relates to the technical field of Web application, unifies the code style, and detects the code quality based on static type inspection through a Ts technology stack; through the use of blocking type development, the development steps are executed step by step, and the problem quick positioning is realized. The invention is developed based on unified standards, the unified coding style is beneficial to code reading, and the error rate is reduced; by adopting the blocking type development, the development of new functions of the project is ensured to be smoother, the readability, maintainability and expandability of the code quality are improved, and the development efficiency is ensured while the code quality is improved.

Description

Method for detecting quality of front-end code
Technical Field
The invention relates to the technical field of Web application, in particular to a method for detecting quality of a front-end code.
Background
With the rapid development of internet big data, along with the growth of business and the rapid increase of members of development teams, team members also have different coding styles and habits, find problems on a plurality of codes during the duplication of discs, and have the problem that the codes are difficult to maintain over time and even have low-level errors. How to improve the quality of the front-end code becomes a non-negligible problem: for example, there may be many solutions for completing the development of a website interface, but some solutions may have relatively high maintenance cost, some solutions may have performance problems in subsequent use, and some solutions may be easier to maintain and have higher performance. The factors that can affect these differences are the quality of the code, and the characteristics of different frames of different languages are different, and the requirements on the quality of the code are also different.
Disclosure of Invention
The technical task of the invention is to provide a method for detecting the quality of the front-end code aiming at the defects, which can improve the readability, maintainability and expandability of the code quality and ensure the development efficiency while improving the code quality.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a method for detecting quality of front-end code, the method unifies code style, through Ts technology stack, based on static type check, carries on the detection of code quality;
through the use of blocking type development, the development steps are executed step by step, and the problem quick positioning is realized.
The method is developed for online, developer-oriented and dragging-type Web application, balance is achieved between the coding quality and the coding efficiency, the efficiency is guaranteed, and meanwhile the quality of the codes is improved.
The codes with uniform styles are easier to be standardized, so that the maintenance cost of one piece of software can be reduced as much as possible, and the code quality is improved;
and (3) introducing a Ts (Ts) technology stack, wherein the improvement of the Ts technology stack on JS is mainly static type inspection, and the static type inspection has the advantages that the code quality is easy to detect: static type checking can be achieved by early fail, even if the written code is not executed, once the type mismatch occurs when the code is written, the language can be found in a compiling stage; the static type is beneficial to code reading, and has numerous methods and complex calling relation aiming at large-scale application, and the static type is very important prompt and constraint.
By the method, the college codes facing developers are rapidly developed, the readability, maintainability and expandability of the codes are improved, the developers are promoted to learn and write out the well-standardized codes, items are fed back, and the development efficiency is improved.
Preferably, the code style follows the Vue style.
Vue is a progressive framework for constructing user interface, and is suitable for constructing a webpage version application Vue which is similar to a webpage version and has many items and content needing to be modified according to user operation, so that the front-end application program based on the webpage can be developed more conveniently.
Preferably, in the data: boolean type is used for controlling the display and hiding of elements and uniformly starting with is; form class, the data used by the same Form are uniformly wrapped by an object.
Further, in created (): an abstract write method for data acquisition.
Preferably, the method written in the abstract of the acquired data is written as a private method, such as: this. _ getUserInfo ().
Preferably, the blocking development process is as follows:
1) introducing a PR workflow;
2) developing new functions and creating new branches;
3) submitting PR after the new function development is completed;
4) and submitting the main branch after the relevant personnel check the codes.
Furthermore, each time PR operation occurs, a relevant person is informed to check the codes to be merged, and the codes are checked in the checking process. This process ensures the robustness of the merged code on the master branch.
Preferably, each PR operation has a PR detail homepage, and each developer can propose own opinion for the implementation of the code, so that the code change is discussed more conveniently and efficiently, and the code change review is provided with possibility.
The invention also claims a device for detecting quality of front-end codes, which comprises: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor, configured to invoke the machine readable program, performs the method as described above.
The invention also claims a computer readable medium having stored thereon computer instructions which, when executed by a processor, cause the processor to perform the above-described method.
Compared with the prior art, the method for detecting the quality of the front-end code has the following beneficial effects:
the method is developed based on unified standards, the unified coding style is beneficial to code reading, and the error rate is reduced;
and by adopting blocking type development, the development of new functions of the project is ensured to be more smooth, and the readability, maintainability and expandability of the code quality are improved.
Drawings
Fig. 1 is a block development flow diagram provided by an embodiment of the present invention.
Detailed Description
The invention is further described with reference to the following figures and specific examples.
Aiming at the problems in the background art, a plurality of tools for detecting the code quality exist at present, but the use convenience degree is not high, the efficiency is reduced while the code quality is pursued, the method balances the code quality and the coding efficiency, and the online, developer-oriented and drag-type Web application development tool improves the code quality while ensuring the efficiency.
The embodiment of the invention provides a method for detecting the quality of a front-end code, which unifies the style of the code, and detects the quality of the code based on static type detection through a Ts technology stack;
through the use of blocking type development, the development steps are executed step by step, and the problem quick positioning is realized.
The method is developed for online, developer-oriented and dragging-type Web application, balance is achieved between the coding quality and the coding efficiency, the efficiency is guaranteed, and meanwhile the quality of the codes is improved.
In this method, the code style follows Vue style. The codes with the unified style are easier to be standardized, the maintenance cost of one piece of software can be reduced as much as possible, and the code quality is improved.
Vue is a progressive framework for constructing user interface, and is suitable for constructing a webpage version application Vue which is similar to a webpage version and has many items and content needing to be modified according to user operation, so that the front-end application program based on the webpage can be developed more conveniently.
The method comprises the following steps:
1) and in the data: boolean type is used for controlling the display and hiding of elements and uniformly starting with is; form class, the data used by the same Form are uniformly wrapped by an object.
2) In created (): certain abstract writing methods are generally used for acquiring data, and private methods are generally used, such as: this. _ getUserInfo ().
A Ts technology stack is introduced. The improvement of the Ts technology stack on JS is mainly static type checking, which has the advantage of easy detection of code quality.
Static languages specify the variable and formula type languages, java/C + +, whereas dynamic languages specify only the data type, such as: JavaScript/Ruby/PHP;
the static language compiling stage can find out the error with unmatched type, the type information is favorable for the compiler to optimize, and the IDE has file function of automatic complementing/checking, etc.
Specifically, the method comprises the following steps:
1) static type checking can be done early fail, and even if the written code is not executed, once the type mismatch occurs when the code is written, the language can be found in the compiling stage.
2) The static type is beneficial to code reading, and for large-scale application, the method is numerous, the calling relation is complex, and the static type is very important prompt and constraint.
By using the blocking development and distributing the execution development steps, the problem can be quickly located, and the processing flow is shown in fig. 1.
The blocking development process comprises the following steps:
1) introducing a PR workflow;
the benefits of PR operations on projects are two-fold: code review and code common platform. The former is that a correlative person is informed to check the code to be merged when each PR operation occurs, the code is checked in the checking process, and the process ensures the robustness of the merged code on the master branch; the latter is because each time PR has a PR details home page, each developer can propose his own opinion for the implementation of the code, so that the discussion of the code becomes more convenient and efficient, and the review of the code change is possible.
Functional branching workflows is one way that git project development is very flexible to use.
2) Developing new functions and creating new branches;
3) submitting PR after the new function development is completed;
4) and submitting the main branch after the relevant personnel check the codes.
By the method, the college codes facing developers are rapidly developed, the readability, maintainability and expandability of the codes are improved, the developers are promoted to learn and write out the well-standardized codes, items are fed back, and the development efficiency is improved.
The embodiment of the invention also provides a device for detecting the quality of the front-end code, which comprises the following steps: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine-readable program to execute a method for detecting quality of a front-end code according to the above embodiment of the present invention.
An embodiment of the present invention further provides a computer-readable medium, where a computer instruction is stored on the computer-readable medium, and when the computer instruction is executed by a processor, the processor is caused to execute the method for implementing quality detection of a front-end code in the embodiment of the present invention. Specifically, a system or an apparatus equipped with a storage medium on which software program codes that realize the functions of any of the above-described embodiments are stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program codes stored in the storage medium.
In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer via a communications network.
Further, it should be clear that the functions of any one of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform a part or all of the actual operations based on instructions of the program code.
Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described embodiments.
While the invention has been shown and described in detail in the drawings and in the preferred embodiments, it is not intended to limit the invention to the embodiments disclosed, and it will be apparent to those skilled in the art that various combinations of the code auditing means in the various embodiments described above may be used to obtain further embodiments of the invention, which are also within the scope of the invention.

Claims (10)

1. A method for detecting quality of front-end codes is characterized in that the method unifies code styles, and detects the code quality based on static type inspection through a Ts technology stack;
through the use of blocking type development, the development steps are executed step by step, and the problem quick positioning is realized.
2. A method for front-end code quality detection as claimed in claim 1, wherein said code style follows Vue style.
3. The method for front-end code quality detection according to claim 2, wherein in the data: boolean type is used for controlling the display and hiding of elements and uniformly starting with is; form class, the data used by the same Form are uniformly wrapped by an object.
4. A method for front-end code quality detection as claimed in claim 2 or 3, characterized in that in created (): an abstract write method for data acquisition.
5. The system according to claim 4, wherein the method for abstractly writing the acquired data is written as a proprietary method.
6. The system for realizing hospital diagnostic data standardization according to claim 1 or 2, characterized in that the process of said blocking development is:
1) introducing a PR workflow;
2) developing new functions and creating new branches;
3) submitting PR after the new function development is completed;
4) and submitting the main branch after the relevant personnel check the codes.
7. The system of claim 6, wherein each time PR operation occurs, the relevant person is notified to check the code to be merged, and the code is checked during the checking process.
8. The system of claim 6, wherein each PR operation has a main page of PR details, and each developer can make his own opinion about the implementation of the code.
9. An apparatus for front-end code quality checking, comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor, configured to invoke the machine readable program to perform the method of any of claims 1 to 8.
10. Computer readable medium, characterized in that it has stored thereon computer instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 8.
CN202010835304.5A 2020-08-19 2020-08-19 Method for detecting quality of front-end code Pending CN111930632A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010835304.5A CN111930632A (en) 2020-08-19 2020-08-19 Method for detecting quality of front-end code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010835304.5A CN111930632A (en) 2020-08-19 2020-08-19 Method for detecting quality of front-end code

Publications (1)

Publication Number Publication Date
CN111930632A true CN111930632A (en) 2020-11-13

Family

ID=73305981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010835304.5A Pending CN111930632A (en) 2020-08-19 2020-08-19 Method for detecting quality of front-end code

Country Status (1)

Country Link
CN (1) CN111930632A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130152090A1 (en) * 2011-12-07 2013-06-13 Soeren Balko Resolving Resource Contentions
CN109032949A (en) * 2018-08-02 2018-12-18 郑州悉知信息科技股份有限公司 A kind of front-end code quality determining method and device
CN111414302A (en) * 2020-02-28 2020-07-14 天津车之家数据信息技术有限公司 Static code quality analysis method and computing device for continuous integration process

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130152090A1 (en) * 2011-12-07 2013-06-13 Soeren Balko Resolving Resource Contentions
CN109032949A (en) * 2018-08-02 2018-12-18 郑州悉知信息科技股份有限公司 A kind of front-end code quality determining method and device
CN111414302A (en) * 2020-02-28 2020-07-14 天津车之家数据信息技术有限公司 Static code quality analysis method and computing device for continuous integration process

Similar Documents

Publication Publication Date Title
JP5415557B2 (en) User script code conversion for debugging
CN109254992B (en) Project generation method and system, computer system and computer-readable storage medium
US9158538B2 (en) User-extensible rule-based source code modification
US9703678B2 (en) Debugging pipeline for debugging code
US9898387B2 (en) Development tools for logging and analyzing software bugs
US9619211B2 (en) Code suggestion in a software development tool
US9471282B2 (en) System and method for using annotations to automatically generate a framework for a custom javaserver faces (JSF) component
KR20170081239A (en) Impact analysis
US20080313208A1 (en) Apparatus, system, and method for automated context-sensitive message organization
US8302087B2 (en) Quality assurance in software systems through autonomic reliability, availability and serviceability code generation
CN109634591B (en) File processing method and device
US10496379B2 (en) Facilitated production of code for software testing
CN115904480B (en) Code reconstruction method, device, electronic equipment and storage medium
CN116841883A (en) Method, device, electronic equipment and storage medium for code annotation detection
CN111930632A (en) Method for detecting quality of front-end code
JP2005338987A (en) Exception test support program and device
US20140129879A1 (en) Selection apparatus, method of selecting, and computer-readable recording medium
JP2009217664A (en) Automatic test execution system
CN113901025A (en) Database management method, device, equipment and storage medium
US7814069B2 (en) Wrapper for use with global standards compliance checkers
JP2016126700A (en) Program verification device, program verification method, and program verification program
CN115857900B (en) Automatic code generation method and device, electronic equipment and storage medium
CN112148581A (en) Code specification checking method, device, system and storage medium
CN112035367B (en) Method and system for checking workflow correctness of big data platform
CN115543323B (en) Page development method and device

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