CN106776270A - A kind of code detection method, device and terminal - Google Patents
A kind of code detection method, device and terminal Download PDFInfo
- Publication number
- CN106776270A CN106776270A CN201610998210.3A CN201610998210A CN106776270A CN 106776270 A CN106776270 A CN 106776270A CN 201610998210 A CN201610998210 A CN 201610998210A CN 106776270 A CN106776270 A CN 106776270A
- Authority
- CN
- China
- Prior art keywords
- code
- detected
- static
- detection
- static detecting
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a kind of code detection method, wherein, the method includes:One or more static detecting tools are configured in Code Edit platform by configuration-direct, code to be detected is detected by the one or more of static detecting tools for configuring.The invention also discloses a kind of code detecting apparatus and terminal, solve the problems, such as in correlation technique to be taken according to detection code separately through Static Detection long, code is detected according to being configured in platform by by Static Detection, effectively shorten the time of detection, improve Consumer's Experience.
Description
Technical field
The present invention relates to field of terminal technology, more particularly to a kind of code detection method, device and terminal.
Background technology
With the development and the popularization of terminal of internet, the customer group of terminal is increasing, while also being proposed to software
More intelligence, the demand of hommization.
In existing technology, terminal in fact, although by user as a game machine or television set, it is also possible to
Learning machine, it is also possible to paradise as baby etc., more enjoyment are brought to our life.
In JAVA software development process, development teams will often be expended considerable time and effort and find and change code
Defect.JAVA static code analysis tools can help developer's fast and effectively location code during code construction
Defect simultaneously corrects these problems in time, so as to be greatly enhanced software reliability and save software development and testing cost.At present
The JAVA static code analysis tool species of in the market is various and each has something to recommend him, common are Findbugs, Pmd, Coverity,
Fortify etc., the emphasis that these static code checking tools are checked is all different, has this several code static tool to examine
Look into, the possibility that code goes wrong is reduced to a certain extent, but individually go operation these instruments inspection code to compare
It is time-consuming.
Long problem is taken according to detection code separately through Static Detection in correlation technique, is not yet carried at present
Go out solution.
The content of the invention
It is a primary object of the present invention to propose a kind of code detection method, device and terminal, it is intended to solve correlation technique
In separately through Static Detection according to detection code take long problem.
To achieve the above object, the invention provides a kind of code detection method, including:By configuration-direct by one or
Multiple static detecting tools are configured in Code Edit platform;Treated by the one or more of static detecting tools for configuring
Detection code is detected.
Alternatively, the one or more of static detecting tools by configuring carry out detection bag to the code to be detected
Include:It is the multiple quiet by what is configured according to the order for pre-setting in the case where the static detecting tool of configuration is for multiple
State detection instrument is detected to the code to be detected.
Alternatively, the multiple static detecting tool for configuring is being passed through to described to be detected according to the order for pre-setting
After code is detected, methods described also includes:Collect the multiple static detecting tool is carried out to the code to be detected
The result of detection, and examining report is generated, wherein, the content and quantity of the code for making a mistake are carried in the examining report
Warning information;Push the examining report of generation.
Alternatively, the examining report for pushing generation includes:Sent by way of mail to the mail of advance association
In.
Alternatively, the one or more of static detecting tools by configuring carry out detection bag to the code to be detected
Include:Receive the trigger message that triggering is detected to the code to be detected;According to the trigger message to the generation to be detected
Code is detected.
Alternatively, the one or more of static detecting tools by configuring carry out detection to code to be detected includes:
The timer of a cycle is set;
When timer resets, triggering is entered by the one or more of static detecting tools for configuring to code to be detected
Row detection.
According to another aspect of the present invention, there is provided a kind of code detecting apparatus, including:
Configuration module, for one or more static detecting tools to be configured into Code Edit platform by configuration-direct
In;
Detection module, examines for the one or more of static detecting tools by configuring to code to be detected
Survey.
Alternatively, the detection module, is additionally operable in the case where the static detecting tool of configuration is for multiple, according to advance
The multiple static detecting tool that the order of setting passes through to configure is detected to the code to be detected.
Alternatively, described device also includes:
Summarizing module, for collecting the result that the multiple static detecting tool is detected to the code to be detected,
And examining report is generated, wherein, the content of the code for making a mistake and the warning information of quantity are carried in the examining report;
Pushing module, the examining report for pushing generation.
Alternatively, the pushing module, is additionally operable to by way of mail send into the mail of advance association.
Alternatively, the detection module includes:
Receiving unit, for receiving the trigger message that triggering is detected to the code to be detected;
Detection unit, for being detected to the code to be detected according to the trigger message.
Alternatively, the detection module includes:
Setting unit, the timer for setting a cycle;
Trigger element, for when timer resets, triggering to pass through the one or more of static detecting tools for configuring
Code to be detected is detected.
One of according to another aspect of the present invention, a kind of terminal is additionally provided, including above-mentioned device.
By the present invention, one or more static detecting tools are configured in Code Edit platform by configuration-direct,
Code to be detected is detected by the one or more of static detecting tools for configuring, is solved in correlation technique individually
Long problem is taken according to detection code by Static Detection, by by Static Detection according to being configured in platform to code
Detected, effectively shortened the time of detection, improve Consumer's Experience.
Brief description of the drawings
Fig. 1 is a hardware architecture diagram for optional mobile terminal for realizing each embodiment of the invention;
Fig. 2 is the wireless communication system schematic diagram of mobile terminal as shown in Figure 1;
Fig. 3 is the flow chart of code detection method according to embodiments of the present invention;
Fig. 4 is the schematic diagram of code detection system according to embodiments of the present invention;
Fig. 5 is the flow chart of code detection method according to the preferred embodiment of the invention;
Fig. 6 is the block diagram of code detecting apparatus according to embodiments of the present invention;
Fig. 7 is the block diagram one of code detecting apparatus according to the preferred embodiment of the invention;
Fig. 8 is the block diagram two of code detecting apparatus according to the preferred embodiment of the invention;
Fig. 9 is the block diagram three of code detecting apparatus according to the preferred embodiment of the invention.
The realization of the object of the invention, functional characteristics and advantage will be described further referring to the drawings in conjunction with the embodiments.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The mobile terminal of each embodiment of the invention is realized referring now to Description of Drawings.In follow-up description, use
For represent element such as " module ", " part " or " unit " suffix only for being conducive to explanation of the invention, itself
Not specific meaning.Therefore, " module " can be used mixedly with " part ".
Mobile terminal can be implemented in a variety of manners.For example, the terminal described in the present invention can include such as moving
Phone, smart phone, notebook computer, digit broadcasting receiver, PDA (personal digital assistant), PAD (panel computer), PMP
The mobile terminal of (portable media player), guider etc. and such as numeral TV, desktop computer etc. are consolidated
Determine terminal.Hereinafter it is assumed that terminal is mobile terminal.However, it will be understood by those skilled in the art that, except being used in particular for movement
Outside the element of purpose, construction according to the embodiment of the present invention can also apply to the terminal of fixed type.
Fig. 1 is a hardware architecture diagram for optional mobile terminal for realizing each embodiment of the invention.
Mobile terminal 1 00 can include wireless communication unit 110, A/V (audio/video) input block 120, user input
Unit 130, sensing unit 140, output unit 150, memory 160, interface unit 170, controller 180 and power subsystem 190
Etc..
Fig. 1 shows the mobile terminal 1 00 with various assemblies, it should be understood that being not required for implementing all showing
The component for going out.More or less component can alternatively be implemented.The element of mobile terminal 1 00 will be discussed in more detail below.
Wireless communication unit 110 can generally include one or more assemblies, and it allows mobile terminal 1 00 and radio communication
Radio communication between system or network.For example, wireless communication unit 110 can include that broadcasting reception module 111, movement are logical
At least one of letter module 112, wireless Internet module 113, short range communication module 114 and location information module 115.
Broadcasting reception module 111 receives broadcast singal and/or broadcast via broadcast channel from external broadcast management server
Relevant information.Broadcast channel can include satellite channel and/or terrestrial channel.Broadcast management server can be generated and sent
The broadcast singal and/or broadcast related information generated before the server or reception of broadcast singal and/or broadcast related information
And send it to the server of terminal.Broadcast singal can include TV broadcast singals, radio signals, data broadcasting
Signal etc..And, broadcast singal may further include the broadcast singal combined with TV or radio signals.Broadcast phase
Pass information can also be provided via mobile communications network, and in this case, broadcast related information can be by mobile communication mould
Block 112 is received.Broadcast singal can exist in a variety of manners, for example, it can be with the electronics of DMB (DMB)
The form of program guide (EPG), the electronic service guidebooks (ESG) of digital video broadcast-handheld (DVB-H) etc. and exist.Broadcast
Receiver module 111 can receive signal and broadcast by using various types of broadcast systems.Especially, broadcasting reception module 111
Can be wide by using such as multimedia broadcasting-ground (DMB-T), DMB-satellite (DMB-S), digital video
Broadcast-hand-held (DVB-H), Radio Data System, the received terrestrial digital broadcasting integrated service of forward link media (MediaFLO@)
Etc. (ISDB-T) digit broadcasting system receives digital broadcasting.Broadcasting reception module 111 may be constructed such that and be adapted to provide for extensively
Broadcast the various broadcast systems and above-mentioned digit broadcasting system of signal.Via broadcasting reception module 111 receive broadcast singal and/
Or broadcast related information can be stored in memory 160 (or other types of storage medium).
Mobile communication module 112 sends radio signals to base station (for example, access point, node B etc.), exterior terminal
And at least one of server and/or receive from it radio signal.Such radio signal can be logical including voice
Words signal, video calling signal or the various types of data for sending and/or receiving according to text and/or Multimedia Message.
Wireless Internet module 113 supports the Wi-Fi (Wireless Internet Access) of mobile terminal.The module can be internally or externally
It is couple to terminal.Wi-Fi (Wireless Internet Access) technology involved by the module can include WLAN (WLAN) (Wi-Fi), Wibro
(WiMAX), Wimax (worldwide interoperability for microwave accesses), HSDPA (high-speed downlink packet access) etc..
Short range communication module 114 is the module for supporting junction service.Some examples of short-range communication technology include indigo plant
Tooth TM, radio frequency identification (RFID), Infrared Data Association (IrDA), ultra wide band (UWB), purple honeybee TM etc..
Location information module 115 is the module for checking or obtaining the positional information of mobile terminal.Location information module
115 typical case is GPS (global positioning system).According to current technology, GPS calculate from three or more satellites away from
Information application triangulation from information and correct time information and for calculating, so as to according to longitude, latitude and height
Degree calculates three-dimensional current location information exactly.Currently, three satellites are used simultaneously for calculating the method for position and temporal information
And the error of the position and temporal information for calculating is corrected by using an other satellite.Additionally, GPS can be by real-time
Ground Continuous plus current location information carrys out calculating speed information.
A/V input blocks 120 are used to receive audio or video signal.A/V input blocks 120 can include the He of camera 121
Microphone 122, the static images that 121 pairs, camera is obtained in Video Capture pattern or image capture mode by image capture apparatus
Or the view data of video is processed.Picture frame after treatment may be displayed on display unit 151.Processed through camera 121
Picture frame afterwards can be stored in memory 160 (or other storage mediums) or sent out via wireless communication unit 110
Send, two or more cameras 121 can be provided according to the construction of mobile terminal 1 00.Microphone 122 can be in telephone relation mould
In formula, logging mode, speech recognition mode etc. operational mode sound (voice data), and energy are received via microphone 122
Enough is voice data by such acoustic processing.Audio (voice) data after treatment can be in the case of telephone calling model
The form that being converted to can be sent to mobile communication base station via mobile communication module 112 is exported.Microphone 122 can be implemented various
The noise of type eliminates (or suppression) algorithm and is being received and making an uproar of producing during sending audio signal with eliminating (or suppression)
Sound or interference.
User input unit 130 can generate key input data to control mobile terminal 1 00 according to the order of user input
Various operations.User input unit 130 allow the various types of information of user input, and can include keyboard, metal dome,
Touch pad (for example, detection due to being touched caused by resistance, pressure, electric capacity etc. change sensitive component), roller, shake
Bar etc..Especially, when touch pad is superimposed upon on display unit 151 in the form of layer, touch-screen can be formed.
Sensing unit 140 detects the current state of mobile terminal 1 00, (for example, mobile terminal 1 00 opens or closes shape
State), the presence or absence of the contact (that is, touch input) of the position of mobile terminal 1 00, user for mobile terminal 1 00, mobile terminal
The acceleration or deceleration movement of 100 orientation, mobile terminal 1 00 and direction etc., and generate for controlling mobile terminal 1 00
The order of operation or signal.For example, when mobile terminal 1 00 is embodied as sliding-type mobile phone, sensing unit 140 can be sensed
The sliding-type phone is opened or closed.In addition, sensing unit 140 can detect power subsystem 190 whether provide electric power or
Whether person's interface unit 170 couples with external device (ED).Sensing unit 140 can include proximity transducer 141.
Interface unit 170 is connected the interface that can pass through with mobile terminal 1 00 as at least one external device (ED).For example,
External device (ED) can include wired or wireless head-band earphone port, external power source (or battery charger) port, wired or nothing
Line FPDP, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Identification module can be that storage uses each of mobile terminal 1 00 for verifying user
Kind of information and subscriber identification module (UIM), client identification module (SIM), Universal Subscriber identification module (USIM) can be included
Etc..In addition, the device (hereinafter referred to as " identifying device ") with identification module can take the form of smart card, therefore, know
Other device can be connected via port or other attachment means with mobile terminal 1 00.Interface unit 170 can be used for reception and come from
The input (for example, data message, electric power etc.) of the external device (ED) and input that will be received is transferred in mobile terminal 1 00
One or more elements can be used for transmitting data between mobile terminal 1 00 and external device (ED).
In addition, when mobile terminal 1 00 is connected with external base, interface unit 170 can serve as allowing by it by electricity
Power provides to the path of mobile terminal 1 00 from base or can serve as allowing the various command signals being input into from base to pass through it
It is transferred to the path of mobile terminal 1 00.Can serve as recognizing mobile terminal 1 00 from the various command signals or electric power of base input
Whether signal base on is accurately fitted within.Output unit 150 is configured to be provided with vision, audio and/or tactile manner
Output signal (for example, audio signal, vision signal, alarm signal, vibration signal etc.).Output unit 150 can include aobvious
Show unit 151, dio Output Modules 152, alarm unit 153 etc..
Display unit 151 may be displayed on the information processed in mobile terminal 1 00.For example, when mobile terminal 1 00 is in electricity
During words call mode, display unit 151 can show and converse or other communicate (for example, text messaging, multimedia file
Download etc.) related user interface (UI) or graphic user interface (GUI).When mobile terminal 1 00 is in video calling pattern
Or during image capture mode, display unit 151 can show the image of capture and/or the image of reception, show video or figure
UI or GUI of picture and correlation function etc..
Meanwhile, when display unit 151 and touch pad in the form of layer it is superposed on one another to form touch-screen when, display unit
151 can serve as input unit and output device.Display unit 151 can include liquid crystal display (LCD), thin film transistor (TFT)
In LCD (TFT-LCD), Organic Light Emitting Diode (OLED) display, flexible display, three-dimensional (3D) display etc. at least
It is a kind of.Some in these displays may be constructed such that transparence to allow user to be watched from outside, and this is properly termed as transparent
Display, typical transparent display can be, for example, TOLED (transparent organic light emitting diode) display etc..According to specific
Desired implementation method, mobile terminal 1 00 can include two or more display units (or other display devices), for example, moving
Dynamic terminal 100 can include outernal display unit (not shown) and inner display unit (not shown).Touch-screen can be used to detect
Touch input pressure and touch input position and touch input area.
Dio Output Modules 152 can be in call signal reception pattern, call mode, record mould in mobile terminal 1 00
It is that wireless communication unit 110 is received or in memory when under the isotypes such as formula, speech recognition mode, broadcast reception mode
In 160 store voice data transducing audio signal and be output as sound.And, dio Output Modules 152 can provide with
The audio output of the specific function correlation that mobile terminal 1 00 is performed is (for example, call signal receives sound, message sink sound etc.
Deng).Dio Output Modules 152 can include loudspeaker, buzzer etc..
Alarm unit 153 can provide output and be notified to mobile terminal 1 00 with by event.Typical event can be with
Including calling reception, message sink, key signals input, touch input etc..In addition to audio or video is exported, alarm unit
153 can in a different manner provide output with the generation of notification event.For example, alarm unit 153 can be in the form of vibrating
Output is provided, when calling, message or some other entrance communication (incoming communication) are received, alarm list
Unit 153 can provide tactile output (that is, vibrating) to notify to user.Exported by providing such tactile, even if
When in pocket of the mobile phone of user in user, user also can recognize that the generation of various events.Alarm unit 153
The output of the generation of notification event can be provided via display unit 151 or dio Output Modules 152.
Memory 160 can store software program for the treatment and control operation performed by controller 180 etc., Huo Zheke
Temporarily to store oneself data (for example, telephone directory, message, still image, video etc.) through exporting or will export.And
And, memory 160 can store the vibration of various modes on being exported when touching and being applied to touch-screen and audio signal
Data.
Memory 160 can include the storage medium of at least one type, and the storage medium includes flash memory, hard disk, many
Media card, card-type memory (for example, SD or DX memories etc.), random access storage device (RAM), static random-access storage
Device (SRAM), read-only storage (ROM), Electrically Erasable Read Only Memory (EEPROM), programmable read only memory
(PROM), magnetic storage, disk, CD etc..And, mobile terminal 1 00 can perform memory with by network connection
The network storage device cooperation of 160 store function.
The overall operation of the generally control mobile terminal of controller 180.For example, controller 180 is performed and voice call, data
Communication, video calling etc. related control and treatment.In addition, controller 180 can be included for reproducing (or playback) many matchmakers
The multi-media module 181 of volume data, multi-media module 181 can be constructed in controller 180, or can be structured as and control
Device 180 is separated.Controller 180 can be with execution pattern identifying processing, the handwriting input that will be performed on the touchscreen or picture
Draw input and be identified as character or image.
Power subsystem 190 receives external power or internal power under the control of controller 180 and provides operation each unit
Appropriate electric power needed for part and component.
Various implementation methods described herein can be with use such as computer software, hardware or its any combination of calculating
Machine computer-readable recording medium is implemented.Implement for hardware, implementation method described herein can be by using application-specific IC
(ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), scene can
Programming gate array (FPGA), processor, controller, microcontroller, microprocessor, it is designed to perform function described herein
At least one in electronic unit is implemented, and in some cases, such implementation method can be implemented in controller 180.
For software implementation, the implementation method of such as process or function can with allow to perform the single of at least one function or operation
Software module is implemented.Software code can be come by the software application (or program) write with any appropriate programming language
Implement, software code can be stored in memory 160 and performed by controller 180.
So far, oneself according to its function through describing mobile terminal 1 00.In addition, the mobile terminal 1 00 in the embodiment of the present invention
Can be such as folded form, board-type, oscillating-type, sliding-type and other various types of mobile terminals, not do herein specifically
Limit.
Mobile terminal 1 00 as shown in Figure 1 may be constructed such that using via frame or packet transmission data it is all if any
Line and wireless communication system and satellite-based communication system are operated.
The communication system that mobile terminal wherein of the invention can be operated is described referring now to Fig. 2.
Such communication system can use different air interface and/or physical layer.For example, used by communication system
Air interface includes such as frequency division multiple access (FDMA), time division multiple acess (TDMA), CDMA (CDMA) and universal mobile communications system
System (UMTS) (especially, Long Term Evolution (LTE)), global system for mobile communications (GSM) etc..As non-limiting example, under
The description in face is related to cdma communication system, but such teaching is equally applicable to other types of system.
With reference to Fig. 2, cdma wireless communication system can include multiple intelligent terminals 100, multiple base station (BS) 270, base station
Controller (BSC) 275 and mobile switching centre (MSC) 280.MSC 280 is configured to and Public Switched Telephony Network (PSTN)
290 form interface.MSC 280 is also structured to be formed with the BSC 275 that can be couple to base station 270 via back haul link and connects
Mouthful.If any one in the interface that back haul link can be known according to Ganji is constructed, the interface can include such as Europe mark
Quasi- high power capacity digital circuit/Unite States Standard high power capacity digital circuit (E1/T1), asynchronous transfer mode (ATM), procotol
(IP), point-to-point protocol (PPP), frame relay, high-bit-rate digital subscriber line road (HDSL), Asymmetrical Digital Subscriber Line (ADSL)
Or all kinds digital subscriber line (xDSL).It will be appreciated that system can include multiple BSC 275 as shown in Figure 2.
Each BS 270 can service one or more subregions (or region), by multidirectional antenna or the day of sensing specific direction
Each subregion of line covering is radially away from BS 270.Or, each subregion can by two for diversity reception or more
Multiple antennas are covered.Each BS 270 may be constructed such that the multiple frequency distribution of support, and the distribution of each frequency has specific frequency
Spectrum (for example, 1.25MHz, 5MHz etc.).
What subregion and frequency were distributed intersects can be referred to as CDMA Channel.BS 270 can also be referred to as base station transceiver
System (BTS) or other equivalent terms.In this case, term " base station " can be used for broadly representing single BSC
275 and at least one BS 270.Base station can also be referred to as " cellular station ".Or, each subregion of specific BS 270 can be claimed
It is multiple cellular stations.
As shown in Figure 2, broadcast singal is sent to broadcsting transmitter (BT) 295 mobile terminal operated in system
100.Broadcasting reception module 111 as shown in Figure 1 is arranged at mobile terminal 1 00 to receive the broadcast sent by BT 295
Signal.In fig. 2 it is shown that several global positioning system (GPS) satellites 300.Satellite 300 helps position multiple mobile terminals
At least one of 100.
In fig. 2, multiple satellites 300 are depicted, it is understood that be, it is possible to use any number of satellite obtains useful
Location information.Location information module 115 as shown in Figure 1 is (such as:GPS) it is generally configured to coordinate to obtain with satellite 300
The location information that must be wanted.Substitute GPS tracking techniques or outside GPS tracking techniques, it is possible to use can track mobile whole
Other technologies of the position at end.In addition, at least one gps satellite 300 can optionally or additionally process satellite dmb biography
It is defeated.
Used as a typical operation of wireless communication system, BS 270 receives the reverse strand from various mobile terminal 1s 00
Road signal.Mobile terminal 1 00 generally participates in call, information receiving and transmitting and other types of communication.Each of certain base station reception is anti-
Processed in specific BS 270 to link signal.The data of acquisition are forwarded to the BSC 275 of correlation.BSC provides logical
Words resource allocation and the mobile management function of the coordination including the soft switching process between BS 270.BSC 275 will also be received
Data be routed to MSC 280, its provide for PSTN 290 formed interface extra route service.Similarly, PSTN
290 form interface with MSC 280, and MSC and BSC 275 form interface, and BSC 275 correspondingly controls BS 270 with by forward direction
Link signal is sent to mobile terminal 1 00.
Based on above-mentioned mobile terminal, a kind of code detection method is the embodiment of the invention provides, Fig. 3 is according to the present invention
The flow chart of the code detection method of embodiment, as shown in figure 3, the method is comprised the following steps:
, be configured to one or more static detecting tools in Code Edit platform by configuration-direct by step S302;
Step S304, is detected by the one or more of static detecting tools for configuring to code to be detected.
By above-mentioned steps, one or more static detecting tools are configured to by Code Edit platform by configuration-direct
In, code to be detected is detected by the one or more of static detecting tools for configuring, in solving correlation technique
Long problem is taken according to detection code separately through Static Detection, by the way that Static Detection is right in platform according to being configured to
Code detected, effectively shortens the time of detection, improves Consumer's Experience.
The order of detection can be pre-set, you can with the demand according to user by all of Static Detection according to being set to
Certain order, in the case where the static detecting tool of configuration is for multiple, according to the institute that the order for pre-setting passes through to configure
Multiple static detecting tools are stated to detect the code to be detected.
Alternatively, the multiple static detecting tool for configuring is being passed through to described to be detected according to the order for pre-setting
After code is detected, collect the result that the multiple static detecting tool is detected to the code to be detected, and it is raw
Into examining report, wherein, the content of the code for making a mistake and the warning information of quantity are carried in the examining report, push
The examining report of generation, can be sent into the mail of advance association by way of mail.
In an optional embodiment, by one or more of static detecting tools for configuring to code to be detected
Carrying out detection can include:Receive the trigger message that triggering is detected to the code to be detected;According to the trigger message
The code to be detected is detected.In another optional embodiment, the timer of a cycle can also be set,
When timer resets, triggering is detected by the one or more of static detecting tools for configuring to code to be detected,
Realize and periodically detected, the value of timer can be configured according to the demand of user.
A set of automation constructing system is the embodiment of the invention provides, can regularly go to check, it is also possible to accomplish to customize
These code static check instruments are run, the report of the result of all inspections can finally be collected together and by mail
Mode notifies developer.Pinpoint the problems in advance, helper developer performs static code analysis automatically, quick positioning
Code concealing errors and defect, help Code Design personnel to focus more on analysis and solve Code Design defect, substantially reduce
Code checks the time of cost line by line, improves software reliability and saves software development and testing cost, and code is checked automatically,
Convenient customization.
Fig. 4 is the schematic diagram of code detection system according to embodiments of the present invention, as shown in figure 4, a set of flat based on JAVA
The code check system of platform, the system can timing, customize code static check instrument is put together according to necessarily it is suitable
Sequence checks code, and the result of each static check instrument inspection can be collected, and the technology mainly used is exactly
JAVA、MAVEN, static check instrument and construction platform JENKINS(such as JENKINS, Cruise Control etc.).
Fig. 5 is the flow chart of code detection method according to the preferred embodiment of the invention, as shown in figure 5, workflow diagram
Comprise the following steps:
Step S502, in JENKINSAccording to project situation according to certain attribute configuration static check instrument in platform;
Step S504, configuration starts specifies static detecting tool;
Step S506, configuration timing builds or code submits triggering to;
JenKins is an open source projects, there is provided a kind of wieldy continuous integration system, makes developer from numerous and diverse
It is integrated in free, be absorbed in even more important service logic and realize.Deposited during Jenkins energy implementing monitoring is integrated simultaneously
Mistake, there is provided detailed journal file and prompting function, moreover it is possible to visually show becoming for project build with the form of chart
Gesture and stability, additionally support integrated hundreds of plug-in unit, be can be used under these plug-in card configurations, very easily a structure
Platform.
FindBugs is a static analysis tools, and it checks class or jar file, by bytecode and one group of defect mode
The problem to have found that it is likely that is contrasted, such as be common are:The database connection being not turned off;Lack necessary null
Check, unnecessary null check, unnecessary if postconditions, identical conditional branching, the code block for repeating, mistake make
Replace character series winding to add using stringbuffer with "==" and suggestion etc..
Coverity static analysis tools, it is with better function, the safety problem of code is mainly checked, such as:List not
The code that can be performed to, list be not initialised class members's variable, list not captured exception, list and be not given
Although the return sentences of return value, certain function have return value, but call the place of the function not use its return value,
This can also be listed, list the new not being recovered objects out, list be not turned off handle, be pin-pointed to
Code line, and provide successively the function of expanded function, list possible value type and overflow etc..
Fority is the software source code safe test tool of a static state, whitepack.It is big main by built-in five
Analysis engine:Data flow, semanteme, structure, controlling stream, configuration stream etc. carry out the analysis of static state to the source code of application software, point
Comprehensively matched with its distinctive software security flaw rule set during analysis, searched, so as to exist in source code
Security scan out, and give adjustment report of the receipts of freight and miscellany.Not only include the information of detailed security breaches in the result of scanning, also
The explanation of the security knowledge of correlation, and the offer for repairing opinion are provided.
There is the above code static tool inspection, the possibility that code goes wrong reduced to a certain extent,
Certainly other some static check instruments just do not list one by one.
The engineering of currently the majority is all Maven engineerings, and Maven equally supports many plug-in units, and this just gives reality of the invention
Difficulty is now reduced, major part configuration only needs to the configuration in pom files and is capable of achieving.
The deployment of Findbugs:
Increase the configuration of findbugs plug-in units in pom files
Configuration report output configuration
Jekins is configured:Findbugs is set in the Goals and options of Jenkins:Findbugs just can be with
.
Because Maven and Jenkins support plug-in unit, so, the component such as PMD, Fortify, Coverity can lead to
The mode of configuration plug-in is crossed to complete.
Step S508, collects and builds result, and the public lecture of different checking tool generations is put into different catalogues, it is necessary in institute
After thering is static check structure to terminate, a step is increased newly on Jenkins, the step is exactly to call ant scripts that structure is reported
Collect together.
Step S510, summary report;
Step S512, by examining report mail to related personnel.The report of different checking tool generations is all independent, and
Pattern is inconsistent, it is necessary to parsed using Java and reported according to certain template generation to collecting report together, most
Increase a step newly on Jenkins afterwards, report is sent to related personnel's mailbox by the step.In view of Maven and Jenkins are
Plug-in unit is supported, if increase other instruments newly be convenient to, it is only necessary to can just be completed by newly-increased configuration.
A kind of another aspect according to embodiments of the present invention, there is provided code detecting apparatus, Fig. 6 is implemented according to the present invention
The block diagram of the code detecting apparatus of example, as shown in fig. 6, including:
Configuration module 62, for one or more static detecting tools to be configured into Code Edit platform by configuration-direct
In;
Detection module 64, examines for the one or more of static detecting tools by configuring to code to be detected
Survey.
Alternatively, the detection module 64, is additionally operable in the case where the static detecting tool of configuration is for multiple, according to pre-
The multiple static detecting tool that the order for first setting passes through to configure is detected to the code to be detected.
Fig. 7 is the block diagram one of code detecting apparatus according to the preferred embodiment of the invention, as shown in fig. 7, described device is also
Including:
Summarizing module 72, for collecting the knot that the multiple static detecting tool is detected to the code to be detected
Really, and examining report is generated, wherein, the content of the code for making a mistake and the alarm letter of quantity are carried in the examining report
Breath;
Pushing module 74, the examining report for pushing generation.
Alternatively, the pushing module 74, is additionally operable to by way of mail send into the mail of advance association.
Fig. 8 is the block diagram two of code detecting apparatus according to the preferred embodiment of the invention, as shown in figure 8, the detection mould
Block 64 includes:
Receiving unit 82, for receiving the trigger message that triggering is detected to the code to be detected;
Detection unit 84, for being detected to the code to be detected according to the trigger message.
Fig. 9 is the block diagram three of code detecting apparatus according to the preferred embodiment of the invention, as shown in figure 9, the detection mould
Block 64 includes:
Setting unit 92, the timer for setting a cycle;
Trigger element 94, for when timer resets, triggering to pass through the one or more of Static Detection works for configuring
Tool is detected to code to be detected.
One of another aspect according to embodiments of the present invention, additionally provides a kind of terminal, including above-mentioned device.
By the embodiment of the present invention, one or more static detecting tools are configured to by Code Edit by configuration-direct and are put down
In platform, code to be detected is detected by the one or more of static detecting tools for configuring, solve correlation technique
In long problem is taken according to detection code separately through Static Detection, by by Static Detection according to being configured in platform
Code is detected, the time of detection is effectively shortened, Consumer's Experience is improve.
It should be noted that herein, term " including ", "comprising" or its any other variant be intended to non-row
His property is included, so that process, method, article or device including a series of key elements not only include those key elements, and
And also include other key elements being not expressly set out, or also include for this process, method, article or device institute are intrinsic
Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this
Also there is other identical element in the process of key element, method, article or device.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably implementation method.Based on such understanding, technical scheme is substantially done to prior art in other words
The part for going out contribution can be embodied in the form of software product, and the computer software product is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), including some instructions are used to so that a station terminal equipment (can be mobile phone, computer, clothes
Business device, air-conditioner, or network equipment etc.) perform the method that each embodiment of the invention is somebody's turn to do.
Obviously, those skilled in the art should be understood that above-mentioned of the invention each module or each step can be with general
Computing device realize that they can be concentrated on single computing device, or be distributed in multiple computing devices and constituted
Network on, alternatively, the program code that they can be can perform with computing device be realized, it is thus possible to they are stored
Performed by computing device in the storage device, and in some cases, can be with different from shown in order execution herein
The step of going out or describe, or they are fabricated to each integrated circuit modules respectively, or by the multiple modules in them or
Step is fabricated to single integrated circuit module to realize.So, the present invention is not restricted to any specific hardware and software combination.
The preferred embodiments of the present invention are these are only, the scope of the claims of the invention is not thereby limited, it is every to utilize this hair
Equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of code detection method, it is characterised in that including:
One or more static detecting tools are configured in Code Edit platform by configuration-direct;
Code to be detected is detected by the one or more of static detecting tools for configuring.
2. method according to claim 1, it is characterised in that by the one or more of static detecting tools for configuring
Carrying out detection to the code to be detected includes:
It is the multiple quiet by what is configured according to the order for pre-setting in the case where the static detecting tool of configuration is for multiple
State detection instrument is detected to the code to be detected.
3. method according to claim 2, it is characterised in that described many pass through to configure according to the order for pre-setting
After individual static detecting tool is detected to the code to be detected, methods described also includes:
Collect the result that the multiple static detecting tool is detected to the code to be detected, and generate examining report, its
In, the content of the code for making a mistake and the warning information of quantity are carried in the examining report;
Push the examining report of generation.
4. method according to claim 3, it is characterised in that the examining report for pushing generation includes:
Sent by way of mail into the mail of advance association.
5. method according to any one of claim 1 to 4, it is characterised in that one or more of by what is configured
Static detecting tool carries out detection to the code to be detected to be included:
Receive the trigger message that triggering is detected to the code to be detected;
The code to be detected is detected according to the trigger message.
6. method according to claim 5, it is characterised in that by the one or more of static detecting tools for configuring
Carrying out detection to code to be detected includes:
The timer of a cycle is set;
When timer resets, triggering is examined by the one or more of static detecting tools for configuring to code to be detected
Survey.
7. a kind of code detecting apparatus, it is characterised in that including:
Configuration module, for one or more static detecting tools to be configured in Code Edit platform by configuration-direct;
Detection module, detects for the one or more of static detecting tools by configuring to code to be detected.
8. device according to claim 7, it is characterised in that the detection module, is additionally operable to
It is the multiple quiet by what is configured according to the order for pre-setting in the case where the static detecting tool of configuration is for multiple
State detection instrument is detected to the code to be detected.
9. device according to claim 8, it is characterised in that described device also includes:
Summarizing module is for collecting the result that the multiple static detecting tool is detected to the code to be detected and raw
Into examining report, wherein, the content of the code for making a mistake and the warning information of quantity are carried in the examining report;
Pushing module, the examining report for pushing generation.
10. a kind of terminal, it is characterised in that including the device any one of claim 7 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610998210.3A CN106776270A (en) | 2016-11-11 | 2016-11-11 | A kind of code detection method, device and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610998210.3A CN106776270A (en) | 2016-11-11 | 2016-11-11 | A kind of code detection method, device and terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106776270A true CN106776270A (en) | 2017-05-31 |
Family
ID=58973381
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610998210.3A Pending CN106776270A (en) | 2016-11-11 | 2016-11-11 | A kind of code detection method, device and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106776270A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107357720A (en) * | 2017-06-16 | 2017-11-17 | 广州云测信息技术有限公司 | A kind of method of testing and system of running software mistake |
CN107783780A (en) * | 2017-11-21 | 2018-03-09 | 中国银行股份有限公司 | A kind of Code Review method and system |
CN108509346A (en) * | 2018-04-13 | 2018-09-07 | 郑州云海信息技术有限公司 | A kind of dual system BIOS continuous integratings platform and method |
CN108519951A (en) * | 2018-04-13 | 2018-09-11 | 郑州云海信息技术有限公司 | Three node BIOS continuous integratings platforms of one kind and method |
CN108536558A (en) * | 2018-04-13 | 2018-09-14 | 郑州云海信息技术有限公司 | A kind of BIOS continuous integratings platform and method |
CN112256575A (en) * | 2020-10-22 | 2021-01-22 | 深圳我家云网络科技有限公司 | Code quality management method, system and related equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101706749A (en) * | 2009-11-18 | 2010-05-12 | 电子科技大学 | Comprehensive processing method based on software safety defect detection and functional module framework thereof |
US20130067532A1 (en) * | 2011-09-08 | 2013-03-14 | International Business Machines Corporation | Generating security permissions |
CN105159831A (en) * | 2015-08-31 | 2015-12-16 | 浪潮集团有限公司 | Method for automatically monitoring quality of software code |
CN105320591A (en) * | 2014-07-25 | 2016-02-10 | 腾讯科技(深圳)有限公司 | Code detection method and device |
-
2016
- 2016-11-11 CN CN201610998210.3A patent/CN106776270A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101706749A (en) * | 2009-11-18 | 2010-05-12 | 电子科技大学 | Comprehensive processing method based on software safety defect detection and functional module framework thereof |
US20130067532A1 (en) * | 2011-09-08 | 2013-03-14 | International Business Machines Corporation | Generating security permissions |
CN105320591A (en) * | 2014-07-25 | 2016-02-10 | 腾讯科技(深圳)有限公司 | Code detection method and device |
CN105159831A (en) * | 2015-08-31 | 2015-12-16 | 浪潮集团有限公司 | Method for automatically monitoring quality of software code |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107357720A (en) * | 2017-06-16 | 2017-11-17 | 广州云测信息技术有限公司 | A kind of method of testing and system of running software mistake |
CN107783780A (en) * | 2017-11-21 | 2018-03-09 | 中国银行股份有限公司 | A kind of Code Review method and system |
CN107783780B (en) * | 2017-11-21 | 2021-04-20 | 中国银行股份有限公司 | Code review method and system |
CN108509346A (en) * | 2018-04-13 | 2018-09-07 | 郑州云海信息技术有限公司 | A kind of dual system BIOS continuous integratings platform and method |
CN108519951A (en) * | 2018-04-13 | 2018-09-11 | 郑州云海信息技术有限公司 | Three node BIOS continuous integratings platforms of one kind and method |
CN108536558A (en) * | 2018-04-13 | 2018-09-14 | 郑州云海信息技术有限公司 | A kind of BIOS continuous integratings platform and method |
CN108509346B (en) * | 2018-04-13 | 2021-10-22 | 郑州云海信息技术有限公司 | Dual-system BIOS continuous integration platform and method |
CN112256575A (en) * | 2020-10-22 | 2021-01-22 | 深圳我家云网络科技有限公司 | Code quality management method, system and related equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104750420B (en) | Screenshotss method and device | |
CN104883430B (en) | A kind of mobile terminal and do not read the treating method and apparatus of footmark | |
CN106776270A (en) | A kind of code detection method, device and terminal | |
CN104778067B (en) | Start method and the terminal unit of audio | |
CN106911806A (en) | A kind of method of PUSH message, terminal, server and system | |
CN104917896A (en) | Data pushing method and terminal equipment | |
CN106911850A (en) | Mobile terminal and its screenshotss method | |
CN107104970A (en) | A kind of regular and synchronized processing method, system, rule server and gray scale server | |
CN106157970A (en) | A kind of audio identification methods and terminal | |
CN106851006A (en) | A kind of apparatus and method for recognizing Quick Response Code | |
CN104951549A (en) | Mobile terminal and photo/video sort management method thereof | |
CN105204992A (en) | Test script generating device and method | |
CN106778514A (en) | A kind of method and device for identifying object | |
CN106570945A (en) | Terminal, check-in machine and check-in method | |
CN105183830B (en) | picture browsing method and device | |
CN106873887A (en) | It is a kind of that the system and method for application function is controlled based on gesture | |
CN106371682A (en) | Gesture recognition system based on proximity sensor and method thereof | |
CN107071161A (en) | The aggregation display method and mobile terminal of icon in a kind of status bar | |
CN106547674A (en) | A kind of fingerprint input method, device and terminal | |
CN106412328A (en) | Method and device for obtaining user feedback information | |
CN106341687A (en) | Method and device for locating video decoding abnormality | |
CN106125898A (en) | The method and device of screen rotation | |
CN106376004A (en) | Information processing method and terminal | |
CN106777251A (en) | A kind of file management method and device | |
CN106454771A (en) | Information sending method and device and terminal |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170531 |