CN108446135A - A kind of lines of code statistical method and device - Google Patents

A kind of lines of code statistical method and device Download PDF

Info

Publication number
CN108446135A
CN108446135A CN201810203932.4A CN201810203932A CN108446135A CN 108446135 A CN108446135 A CN 108446135A CN 201810203932 A CN201810203932 A CN 201810203932A CN 108446135 A CN108446135 A CN 108446135A
Authority
CN
China
Prior art keywords
code
version
lines
file
edition
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
CN201810203932.4A
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.)
Bank of China Ltd
Original Assignee
Bank 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201810203932.4A priority Critical patent/CN108446135A/en
Publication of CN108446135A publication Critical patent/CN108446135A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

This application discloses a kind of lines of code statistical method and devices, the method includes when meeting scheduled lines of code statistical condition, generating lines of code statistics instruction, and respond the instruction by following processing procedure:Based on the corresponding edition tree of the intended branch code, obtain the first version file and second edition file of the intended branch code, line number of the second edition file compared to the variance codes row of the first version file is counted, and the submission personal information of the lines of code counted and the second edition file is associated.It can be seen that the application realizes a kind of programming count scheme of lines of code, using application scheme, the lines of code of employee can be counted automatically, be not necessarily to a large amount of manual working, and there is higher statistical efficiency.

Description

A kind of lines of code statistical method and device
Technical field
The invention belongs to the exploitation of software code and administrative skill field more particularly to a kind of lines of code statistical method and Device.
Background technology
Lines of code is current many company especially IT (Information Technology, information technology) companies pair One critically important index of evaluation of employee, the examination of the index necessarily involve the statistics of lines of code.
Currently, generally carrying out the statistics of lines of code using code statistical tool common on the market, staff makes When carrying out lines of code statistics with existing common code statistical tool, generally requires and carry out a large amount of manual working, for example, adding Add the project to be counted, and selects that the object code file counted is wherein needed to submit to code statistical tool into line code statistics Deng the defect that such mode is big naturally there are labor workload and statistical efficiency is low.
Invention content
In view of this, the application's is designed to provide a kind of lines of code statistical method and device, it is intended to overcome existing The above problem existing for technology realizes the programming count of lines of code and promotes statistical efficiency.
For this purpose, the application is disclosed directly below technical solution:
A kind of lines of code statistical method, including:
When meeting scheduled lines of code statistical condition, lines of code statistics instruction is generated;The lines of code statistics Instruction includes intended branch marking code and first version mark, second edition mark, the first version mark, the second edition Mark is respectively used to indicate to need be compared two adjacent versions in the corresponding each code release of the intended branch code Version file:First version file and second edition file, and the submission time of the second edition file is later than described The submission time of one version file;
Based on the corresponding edition tree of the intended branch code, obtain the intended branch code first version file and Second edition file;Wherein, each branch code corresponds to an edition tree, and each node in edition tree corresponds to a version mark Knowledge, the corresponding code file of the version identifier and submission personal information;
Line number of the second edition file compared to the variance codes row of the first version file is counted, and will statistics The submission personal information of the lines of code gone out and the second edition file is associated.
The above method, it is preferred that it is described when meeting scheduled lines of code statistical condition, it generates lines of code statistics and refers to It enables, including:
When the corresponding edition tree of current branch code for detecting that submission personnel are handled to it submits code, in the version The node corresponding to submitted code is generated in tree, and generates the node for being directed to submitted code and the thereon code of a node Line number statistics instruction;
Alternatively,
When reaching scheduled lines of code timing statistics, generate for each two not counted in each edition tree The lines of code statistics instruction of adjacent node.
The above method, it is preferred that the generation lines of code statistics instruction, including:
Version development baseline based on structure generates lines of code system when meeting scheduled lines of code statistical condition Meter instruction;
Wherein, the version development baseline includes multiple activities, and each activity is corresponded with each branch code, each Activity includes the version change collection of corresponding branch code, and it includes being based on timestamp string that the version change of branch code, which is concentrated, The version information of the version information of each version for the branch code that connection gets up, each version of branch code corresponds to a time Stamp;Each corresponding edition tree of branch code is associated in the version development baseline.
The above method, it is preferred that difference of the statistics second edition file compared to the first version file The line number of code line, including:
The content for scanning the second edition file and the first version file determines that the second edition file is compared In the difference row of the first version file;
The null and comment line in the difference row are filtered out, obtains the second edition file compared to the first version The variance codes row of file;
Count the lines of code corresponding to the variance codes row.
The above method, it is preferred that further include:
Corresponding statistical report is generated based on scheduled report template, and is obtaining the instruction for showing the statistical report When, show the statistical report.
A kind of lines of code statistic device, including:
Instruction generation unit, for when meeting scheduled lines of code statistical condition, generating lines of code statistics instruction; The lines of code statistics instruction includes that intended branch marking code and first version mark, the second edition identify, and described first Version identifier, second edition mark are respectively used to indicate to need to be compared in the corresponding each code release of the intended branch code Compared with two adjacent versions version file:First version file and second edition file, and the second edition file carries The time is handed over to be later than the submission time of the first version file;
File obtaining unit obtains the intended branch generation for being based on the corresponding edition tree of the intended branch code The first version file and second edition file of code;Wherein, each branch code corresponds to an edition tree, each of edition tree Node corresponds to a version identifier, the corresponding code file of the version identifier and submits personal information;
Lines of code statistic unit, for counting difference of the second edition file compared to the first version file The line number of code line, and the submission personal information of the lines of code counted and the second edition file is associated.
Above-mentioned apparatus, it is preferred that described instruction generation unit is specifically used for:
When the corresponding edition tree of current branch code for detecting that submission personnel are handled to it submits code, in the version The node corresponding to submitted code is generated in tree, and generates the node for being directed to submitted code and the thereon code of a node Line number statistics instruction;
Alternatively,
When reaching scheduled lines of code timing statistics, generate for each two not counted in each edition tree The lines of code statistics instruction of adjacent node.
Above-mentioned apparatus, it is preferred that described instruction generation unit is specifically used for:
Version development baseline based on structure generates lines of code system when meeting scheduled lines of code statistical condition Meter instruction;
Wherein, the version development baseline includes multiple activities, and each activity is corresponded with each branch code, each Activity includes the version change collection of corresponding branch code, and it includes being based on timestamp string that the version change of branch code, which is concentrated, The version information of the version information of each version for the branch code that connection gets up, each version of branch code corresponds to a time Stamp;Each corresponding edition tree of branch code is associated in the version development baseline.
Above-mentioned apparatus, it is preferred that the lines of code statistic unit is specifically used for:
The content for scanning the second edition file and the first version file determines that the second edition file is compared In the difference row of the first version file;
The null and comment line in the difference row are filtered out, obtains the second edition file compared to the first version The variance codes row of file;
Count the lines of code corresponding to the variance codes row.
Above-mentioned apparatus, it is preferred that further include:
Report generation and display unit for generating corresponding statistical report based on scheduled report template, and are obtaining When showing the instruction of the statistical report, the statistical report is shown.
As it can be seen from the above scheme lines of code statistical method provided by the present application and device, are meeting scheduled code line When number statistical condition, lines of code statistics instruction is generated, and the instruction is responded by following processing procedure:Based on intended branch generation The corresponding edition tree of code obtains the first version file and second edition file of the intended branch code, statistics described second Version file compared to the variance codes row of the first version file line number, and by the lines of code counted and described the The submission personal information of two version files is associated.It can be seen that the application realizes a kind of programming count of lines of code Scheme can automatically count the lines of code of employee using application scheme, be not necessarily to a large amount of manual working, and have Higher statistical efficiency.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of lines of code statistical method flow chart that the embodiment of the present application one provides;
Fig. 2 is another lines of code statistical method flow chart that the embodiment of the present application two provides;
Fig. 3 is the schematic diagram that lines of code statistics is carried out based on version development baseline that the embodiment of the present application two provides;
Fig. 4 is another lines of code statistical method flow chart that the embodiment of the present application three provides;
Fig. 5 is another lines of code statistical method flow chart that the embodiment of the present application four provides;
Fig. 6 is a kind of structural schematic diagram for lines of code statistic device that the embodiment of the present application five provides;
Fig. 7 is the structural schematic diagram for another lines of code statistic device that the embodiment of the present application five provides.
Specific implementation mode
For the sake of quoting and understanding, the technical term that hereinafter uses is write a Chinese character in simplified form or summary of abridging is explained as follows:
CCRC:ClearCase Remote Client, CC remote client softwares, are a kind of Versions, are The product for carrying out resources configuration management under wan environment that IBM Rational are released is one and is based on Eclipse The user interface of Rich Client technological development has provided one kind to the user and has accessed and make by ClearCase Web servers The easy way serviced with ClearCase, similar functions also have SVN etc..
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The embodiment of the present invention one provides a kind of lines of code statistical method, the lines of code statistical method with reference to shown in figure 1 Flow chart, this method may comprise steps of:
Step 101, when meeting scheduled lines of code statistical condition, generate lines of code statistics instruction;The code Line number statistics instruction includes that intended branch marking code and first version mark, the second edition identify, the first version mark, Second edition mark is respectively used to indicate to need be compared two in the corresponding each code release of the intended branch code The version file of adjacent version:First version file and second edition file, and the submission time evening of the second edition file In the submission time of the first version file.
One complete software project code is often made of multiple branch codes, in the development process of software code, Technical staff can be finally completed the exploitation of entire project by carrying out continuous code development to each branch.
Management philosophy of the application based on edition tree, to be carried in the process of development by technical staff to each branch code The code file for the multiple and different versions handed over is managed, and on this basis, technology oriented people is automatically performed based on edition tree The lines of code statistics of member.
Specifically, for example, CCRC (ClearCase Remote Client, remote client software) edition tree can be based on Management philosophy, be project each code branch create an edition tree, in this branch, often submit code (this Shen Please in the code submitted every time refer to that this branches to the newest full dose code for submitting the moment), can using the code of this submission as One new version generates a node in edition tree for it, and generates a version identifier for the node and such as generate version number (version number also corresponds to be node number) etc. carries at the same time it can also include submission time in nodal community, submit personnel ID The information such as the code content of friendship.
It should be noted that technical staff can carry out different branches parallel code development, and in same branch, Synchronization is only capable of carrying out code revision/write (without allowing to the current latest edition in the branch by a technical staff It is carried out at the same time code revision for same version file by multiple technical staff or is write), it is directed to the branch to be gradually completing Code development.It, can be by adding exclusive lock to version file so that version file is only capable of in synchronization by one in practical application A technical staff carries out code revision/write, and after technical staff is to the code revision of the version file/write, it can The exclusive lock is discharged, so that opening the code revision of the version file/write permission to others skilled in the art, it is also necessary to Illustrate, although being only capable of carrying out code revision/write, other skills to version file by a technical staff in synchronization Art personnel still have the permission checked into line code to the version file.
, can be when technical staff to submit code to edition tree every time in practical application, triggering is once directed to technical staff The lines of code statistic processes of this submitted code, or can also when reaching scheduled lines of code timing statistics, than When such as reaching fixation measurement period daily or weekly, triggered towards each technology people for the version not counted in entire project The lines of code statistic processes etc. of member, in consideration of it, the scheduled lines of code statistical condition can " detect submission personnel The corresponding edition tree of current branch code handled to it submits code ", or can also be and " reach scheduled lines of code system Between timing ", it should be noted that the scheduled lines of code statistical condition is not limited to above two, and specific implementation is originally When application, the lines of code statistical condition can be set according to actual demand by technical staff.
In this step 101, when meeting above-mentioned scheduled lines of code statistical condition, automatic code generating line number statistics refers to It enables, lines of code statistics instruction may include that intended branch marking code and first version mark, the second edition identify, described First version mark, second edition mark is respectively used to indicate in the corresponding each code release of the intended branch code need to be into The version file for two adjacent versions that row compares:First version file and second edition file, and the second edition file Submission time be later than the submission time of the first version file.
Wherein, if the scheduled lines of code statistical condition is the current branch for detecting submission personnel and being handled to it The corresponding edition tree of code submits code, then the intended branch marking code that the lines of code statistics instruction includes is described The mark of current branch code, first version mark, the second edition that the lines of code statistics instruction includes identify difference Version file corresponding to being used to indicate when this submits code in generated node in version file and a upper node.
If the scheduled lines of code statistical condition is to reach scheduled lines of code timing statistics, the code The intended branch marking code that line number statistics instruction includes includes the institute that coding change is produced from after the last statistics There is a mark of branch, and lines of code statistics instruction includes that more set first versions marks, the second edition identify, respectively covers the One version identifier, second edition mark are used to indicate in the edition tree for all branches for producing coding change with variance codes Each two adjacent node version file.
The application method can be realized by a plug-in unit, and automatically generating for lines of code statistics instruction can pass through setting One triger trigger realize, whenever detect meet the scheduled lines of code statistical condition when, using setting Triger triggers triggering plug-in unit automatically generates the lines of code statistics instruction.
Step 102 is based on the corresponding edition tree of the intended branch code, obtains the first edition of the intended branch code This document and second edition file;Wherein, each branch code corresponds to an edition tree, and each node in edition tree corresponds to one A version identifier, the corresponding code file of the version identifier and submission personal information.
After obtaining the lines of code statistics instruction, it can be determined according to the intended branch marking code that the instruction includes The corresponding edition tree of the branch, and the first version mark, the second edition that include according to the instruction further identify, from this point Need to be compared two adjacent nodes are determined in the edition tree of branch, and the version file in two adjacent nodes is respectively institute State the indicated file of first version mark, second edition mark.
Step 103 counts line number of the second edition file compared to the variance codes row of the first version file, And the submission personal information of the lines of code counted and the second edition file is associated.
Based on the corresponding edition tree of the intended branch code, the first version file and second that need to be compared is obtained After version file, the content of the first version file and the second edition file can be scanned, described second is determined with this Version file can count the variance codes row on this basis compared to the variance codes row of the first version file Corresponding lines of code, and by the submission personal information of the line number of the variance codes row counted and the second edition file It such as submits personnel ID to be associated, changes/compile in this latest edition submitted code file as submission personnel The lines of code write.
Specifically, for the above two different situations of the lines of code statistical condition, if as soon as often submit time code, Trigger a lines of code statistic processes, then every time statistics can to the node newly submitted and thereon the edition code of a node into Row compares, and counts the variance codes line number of two versions, and the submission personnel ID of the line number of statistics and new node is associated.
If at regular intervals, periodically triggering the lines of code system towards all branches that coding change has occurred Meter process, then every time statistics can be directed in all branches that coding change has occurred have neither part nor lot in each two adjacent node of statistics into Row statistics, and the submission personnel ID of the statistical result node later with generated time in the adjacent node is associated, it will Its lines of code changed/write as associated submission personnel, for example, daily/all technology people towards company weekly Member is once counted, with examine each technical staff it is daily/lines of code etc. weekly.
It should be noted that if the newly-increased code of all technical staff of code in this submitted version, as before Begin the code etc. submitted in the case of exploitation, then the first version file is sky.
As it can be seen from the above scheme lines of code statistical method provided in this embodiment, is meeting scheduled lines of code system When meter condition, lines of code statistics instruction is generated, and the instruction is responded by following processing procedure:Based on the intended branch generation The corresponding edition tree of code obtains the first version file and second edition file of the intended branch code, statistics described second Version file compared to the variance codes row of the first version file line number, and by the lines of code counted and described the The submission personal information of two version files is associated.It can be seen that the application realizes a kind of programming count of lines of code Scheme can automatically count the lines of code of employee using application scheme, be not necessarily to a large amount of manual working, and have Higher statistical efficiency.
It is a kind of lines of code statistical method flow chart provided by Embodiment 2 of the present invention, in the present embodiment two with reference to figure 2 In, the step 101 can be realized by processing procedure below:
Step 1011, the version development baseline based on structure generate generation when meeting scheduled lines of code statistical condition Code line number statistics instruction.
Wherein, the version development baseline includes multiple activities, and each activity is corresponded with each branch code, each Activity includes the version change collection of corresponding branch code, and it includes being based on timestamp string that the version change of branch code, which is concentrated, The version information of the version information of each version for the branch code that connection gets up, each version of branch code corresponds to a time Stamp;Each corresponding edition tree of branch code is associated in the version development baseline.
Specifically, refering to what is shown in Fig. 3, the version exploitation in Fig. 3 starts baseline and version end-of-development baseline constitutes version Development baseline every time before exploitation, can establish version exploitation and start baseline, baseline includes activity activity, and activity includes version This change collects, and change collection includes version variation one by one, wherein, can when generating new v ion in respective version tree The precedence that the version information of the node is stamped timestamp, and temporally stabbed adds it to the base corresponding to the edition tree In line branch, each version embodies its version by the different time stamp of its mark to be changed, and baseline is in this way item Version variation in all branches of mesh one by one is included.
In practical application, application scheme can be implemented with card format, so that user only needs in CCRC works One plug-in unit is installed, you can lines of code statistics is carried out to the respective version file in edition tree automatically on tool.
Specifically, it can be based on setting when developer is based on activity exploitation check-in based on the version development baseline established Fixed triger triggers, are counted by plug-in unit automatic trigger, the difference of developer detection and check-in are compared, if it is new Increase, be directly based upon edition tree and complete this check-in statistics, if it is modification, by the version of this minor node and upper node text Part compares code difference, and variance codes row is included in statistics.Wherein, having oneself (such as technical staff) due to each user ID, therefore in statistics, it can be counted automatically according to User ID.
The present embodiment is based on timestamp by all branches of project by building version development baseline in version development baseline In version variation one by one be included, and the corresponding edition tree of each branch is associated, is realized to project institute There is the versioning information of branch to carry out concluding unification, and realizes baseline Zhong Ge branch's versioning informations and corresponding point Organic association of branch edition tree is provided convenience for the programming count of lines of code.
It is a kind of lines of code statistical method flow chart that the embodiment of the present invention three provides, in the present embodiment three with reference to figure 4 In, the step 103 can be realized by processing procedure below:
Step 1031, the content for scanning the second edition file and the first version file, determine the second edition Difference row of the file compared to the first version file.
Based on the corresponding edition tree of the intended branch code, the first version file and second that need to be compared is obtained After version file, the content of the first version file and the second edition file can be scanned, described second is determined with this Difference row of the version file compared to the first version file.
1032, the null and comment line in the difference row are filtered out, obtains the second edition file compared to described The variance codes row of one version file.
Due to when carrying out code development, often there is null and comment line in code file, and to employee such as When each technical staff examines, null or comment line can not be included in the statistics of lines of code as valid code row In, in consideration of it, after determining difference row of the second edition file compared to the first version file, the present embodiment Continue in the difference row determined carry out null and comment line detection, specifically, for example, detect often go in whether deposit In code, nonexistent code is then considered as null, and detection often go in the presence or absence of " // " "/* " etc. annotate row identifier, Determine that the line code is specially valid code row or comment line with this.
It, can be from the second edition file compared to the first version file after detecting null and/or comment line Difference row in filter out detected null and/or comment line, to obtain the second edition file compared to described the The variance codes row of one version file, the often row in the variance codes row are all the second edition file compared to described first Effective variance codes row of version file.
1033, the lines of code corresponding to the variance codes row is counted.
On the basis of obtaining variance codes row of the second edition file compared to the first version file, this step Suddenly continue to count the lines of code corresponding to the variance codes row, the lines of code system for relevant art personnel is realized with this Meter.
The present embodiment, by filtering out null therein and comment line, effectively improves code when carrying out lines of code statistics The accuracy of line number statistics, compared to used by the market without distinction to all differences row (including effective code line, sky Row, comment line) for the mode that is counted, the mode of the present embodiment considerably reduces the error in lines of code statistics, is The evaluation of employee of the enterprises such as IT provides more accurate data foundation.
It is a kind of lines of code statistical method flow chart that the embodiment of the present invention four provides, in the present embodiment four with reference to figure 5 In, the lines of code statistical method can also include the following steps:
Step 104 is generated corresponding statistical report based on scheduled report template, and shows the statistical report obtaining Instruction when, show the statistical report.
As shown in figure 3, on the basis for carrying out lines of code statistics based on constructed version development baseline and edition tree On, it can be based on scheduled report template, generate corresponding statistical report.
The scheduled report template can be report template of the user according to its actual demand customized, or also Can be template of the user directly selected in multiple alternative templates that plug-in unit carries.
It may include the statistical items of multiple and different types in the statistical report, for example, each technical staff is within certain period The total code line number that the lines of code of production, each technical staff are produced until current development progress, Mei Gefen The lines of code that branch produces within certain period, the total code line number that each branch produces until current development progress Or the total code line number etc. of entire project.
After generating the statistical report, can the statistical report that is generated of automatic Display, or can also be needed in user When consulting the statistical report, enforcement of going forward side by side is recalled by user and is used, the present embodiment is not construed as limiting this.
The embodiment of the present application five provides a kind of lines of code statistic device, the lines of code statistic device with reference to shown in figure 6 Structural schematic diagram, which includes:
Instruction generation unit 601 refers to for when meeting scheduled lines of code statistical condition, generating lines of code statistics It enables;Lines of code statistics instruction includes that intended branch marking code and first version mark, the second edition identify, and described the One version identifier, second edition mark are respectively used to indicate to need to carry out in the corresponding each code release of the intended branch code The version file of the two adjacent versions compared:First version file and second edition file, and the second edition file Submission time is later than the submission time of the first version file;
File obtaining unit 602 obtains the intended branch for being based on the corresponding edition tree of the intended branch code The first version file and second edition file of code;Wherein, each branch code corresponds to an edition tree, every in edition tree A node corresponds to a version identifier, the corresponding code file of the version identifier and submits personal information;
Lines of code statistic unit 603, for counting the second edition file compared to the first version file The line number of variance codes row, and the submission personal information of the lines of code counted and the second edition file is closed Connection.
In an embodiment of the embodiment of the present application, described instruction generation unit 601 is specifically used for:
When the corresponding edition tree of current branch code for detecting that submission personnel are handled to it submits code, in the version The node corresponding to submitted code is generated in tree, and generates the node for being directed to submitted code and the thereon code of a node Line number statistics instruction;Alternatively, when reaching scheduled lines of code timing statistics, generates to be directed in each edition tree and not unite The lines of code statistics instruction of each two adjacent node of meter.
In an embodiment of the embodiment of the present application, described instruction generation unit 601 is specifically used for:
Version development baseline based on structure generates lines of code system when meeting scheduled lines of code statistical condition Meter instruction;
Wherein, the version development baseline includes multiple activities, and each activity is corresponded with each branch code, each Activity includes the version change collection of corresponding branch code, and it includes being based on timestamp string that the version change of branch code, which is concentrated, The version information of the version information of each version for the branch code that connection gets up, each version of branch code corresponds to a time Stamp;Each corresponding edition tree of branch code is associated in the version development baseline.
In an embodiment of the embodiment of the present application, the lines of code statistic unit 603 is specifically used for:
The content for scanning the second edition file and the first version file determines that the second edition file is compared In the difference row of the first version file;The null and comment line in the difference row are filtered out, obtains the second edition herein Variance codes row of the part compared to the first version file;Count the lines of code corresponding to the variance codes row.
In an embodiment of the embodiment of the present application, as shown in fig. 7, lines of code statistics and device, it can be with Including:
Report generation and display unit 604 for generating corresponding statistical report based on scheduled report template, and are obtaining When must show the instruction of the statistical report, the statistical report is shown.
For lines of code statistic device disclosed in the embodiment of the present application, due to itself and generation disclosed in above example Code line number statistical method is corresponding, and technique effect having the same, so description is fairly simple, related similarity please join See the explanation of lines of code statistical method part in above example, and will not be described here in detail.
In conclusion the lines of code statistical method and device of the application, have advantageous effect below:
1) can automatically be directed to different technologies personnel carry out lines of code statistics, be not necessarily to a large amount of manual working, and with compared with High statistical efficiency;
2) it can be counted with continuous integrating code, the code that daily technical staff develops is counted, employee is understood with this Development efficiency, and normal code production capacity can carry out rational task distribution for the relatively high personnel of development efficiency;
3) lines of code statistics can be carried out from multiple and different angles, such as counts each technical staff life within certain period The total code line number that the lines of code of production, each technical staff are produced until current development progress, each branch The lines of code etc. produced within certain period, and the statistical accuracy of lines of code is high, error is low, is the member of the enterprises such as IT Work examination provides more accurate data foundation;
4) opening for technical staff can be found out by the way that lines of code statistical report and code quality report are combined comparison The incidence relation between efficiency and development quality is sent out, is then allocated, adjusts to manager, and establish the healthy and safe shelves of project Case, and employee skill targetedly train and improve.
It should be noted that each embodiment in this specification is described in a progressive manner, each embodiment weight Point explanation is all difference from other examples, and the same or similar parts between the embodiments can be referred to each other.
For convenience of description, it describes to be divided into various modules when system above or device with function or unit describes respectively. Certainly, the function of each unit is realized can in the same or multiple software and or hardware when implementing the application.
As seen through the above description of the embodiments, those skilled in the art can be understood that the application can It is realized by the mode of software plus required general hardware platform.Based on this understanding, the technical solution essence of the application On in other words the part that contributes to existing technology can be expressed in the form of software products, the computer software product It can be stored in a storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions are used so that a computer equipment (can be personal computer, server either network equipment etc.) executes the certain of each embodiment of the application or embodiment Method described in part.
Finally, it is to be noted that, herein, such as first, second, third and fourth or the like relational terms It is only used to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying these There are any actual relationship or orders between entity or operation.Moreover, the terms "include", "comprise" or its is any Other variants are intended to non-exclusive inclusion, so that including the process, method, article or equipment of a series of elements Include not only those elements, but also include other elements that are not explicitly listed, or further includes for this process, side Method, article or the intrinsic element of equipment.In the absence of more restrictions, limited by sentence "including a ..." Element, it is not excluded that there is also other identical elements in the process, method, article or apparatus that includes the element.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of lines of code statistical method, which is characterized in that including:
When meeting scheduled lines of code statistical condition, lines of code statistics instruction is generated;The lines of code statistics instruction Including intended branch marking code and first version mark, second edition mark, the first version mark, second edition mark It is respectively used to the version for indicating to need be compared two adjacent versions in the corresponding each code release of the intended branch code This document:First version file and second edition file, and the submission time of the second edition file is later than the first edition The submission time of this document;
Based on the corresponding edition tree of the intended branch code, the first version file and second of the intended branch code is obtained Version file;Wherein, each branch code corresponds to an edition tree, each node in edition tree correspond to a version identifier, The corresponding code file of the version identifier and submission personal information;
It counts line number of the second edition file compared to the variance codes row of the first version file, and will count The submission personal information of lines of code and the second edition file is associated.
2. according to the method described in claim 1, it is characterized in that, described when meeting scheduled lines of code statistical condition, Lines of code statistics instruction is generated, including:
When the corresponding edition tree of current branch code for detecting that submission personnel are handled to it submits code, in the edition tree The node corresponding to submitted code is generated, and generates the node for being directed to submitted code and the thereon lines of code of a node Statistics instruction;
Alternatively,
When reaching scheduled lines of code timing statistics, generate adjacent for each two not counted in each edition tree The lines of code statistics instruction of node.
3. according to the method described in claim 2, it is characterized in that, the generation lines of code statistics instruction, including:
Version development baseline based on structure generates lines of code statistics and refers to when meeting scheduled lines of code statistical condition It enables;
Wherein, the version development baseline includes multiple activities, and each activity is corresponded with each branch code, each activity Include the version change collection of corresponding branch code, it includes being connected based on timestamp that the version change of branch code, which is concentrated, The version information of the version information of each version of the branch code come, each version of branch code corresponds to a timestamp; Each corresponding edition tree of branch code is associated in the version development baseline.
4. according to the method described in claim 1, it is characterized in that, the statistics second edition file is compared to described the The line number of the variance codes row of one version file, including:
The content for scanning the second edition file and the first version file determines the second edition file compared to institute State the difference row of first version file;
The null and comment line in the difference row are filtered out, obtains the second edition file compared to the first version file Variance codes row;
Count the lines of code corresponding to the variance codes row.
5. according to claim 1-4 any one of them methods, which is characterized in that further include:
Corresponding statistical report is generated based on scheduled report template, and when obtaining the instruction for showing the statistical report, exhibition Show the statistical report.
6. a kind of lines of code statistic device, which is characterized in that including:
Instruction generation unit, for when meeting scheduled lines of code statistical condition, generating lines of code statistics instruction;It is described Lines of code statistics instruction includes intended branch marking code and first version mark, second edition mark, the first version Mark, second edition mark are respectively used to indicate to need in the corresponding each code release of the intended branch code to be compared The version file of two adjacent versions:First version file and second edition file, and when the submission of the second edition file Between be later than the submission time of the first version file;
File obtaining unit obtains the intended branch code for being based on the corresponding edition tree of the intended branch code First version file and second edition file;Wherein, each branch code corresponds to an edition tree, each node in edition tree A corresponding version identifier, the corresponding code file of the version identifier and submission personal information;
Lines of code statistic unit, for counting variance codes of the second edition file compared to the first version file Capable line number, and the submission personal information of the lines of code counted and the second edition file is associated.
7. device according to claim 6, which is characterized in that described instruction generation unit is specifically used for:
When the corresponding edition tree of current branch code for detecting that submission personnel are handled to it submits code, in the edition tree The node corresponding to submitted code is generated, and generates the node for being directed to submitted code and the thereon lines of code of a node Statistics instruction;
Alternatively,
When reaching scheduled lines of code timing statistics, generate adjacent for each two not counted in each edition tree The lines of code statistics instruction of node.
8. device according to claim 7, which is characterized in that described instruction generation unit is specifically used for:
Version development baseline based on structure generates lines of code statistics and refers to when meeting scheduled lines of code statistical condition It enables;
Wherein, the version development baseline includes multiple activities, and each activity is corresponded with each branch code, each activity Include the version change collection of corresponding branch code, it includes being connected based on timestamp that the version change of branch code, which is concentrated, The version information of the version information of each version of the branch code come, each version of branch code corresponds to a timestamp; Each corresponding edition tree of branch code is associated in the version development baseline.
9. device according to claim 8, which is characterized in that the lines of code statistic unit is specifically used for:
The content for scanning the second edition file and the first version file determines the second edition file compared to institute State the difference row of first version file;
The null and comment line in the difference row are filtered out, obtains the second edition file compared to the first version file Variance codes row;
Count the lines of code corresponding to the variance codes row.
10. according to claim 6-9 any one of them devices, which is characterized in that further include:
Report generation and display unit for generating corresponding statistical report based on scheduled report template, and are being shown When the instruction of the statistical report, the statistical report is shown.
CN201810203932.4A 2018-03-13 2018-03-13 A kind of lines of code statistical method and device Pending CN108446135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810203932.4A CN108446135A (en) 2018-03-13 2018-03-13 A kind of lines of code statistical method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810203932.4A CN108446135A (en) 2018-03-13 2018-03-13 A kind of lines of code statistical method and device

Publications (1)

Publication Number Publication Date
CN108446135A true CN108446135A (en) 2018-08-24

Family

ID=63194833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810203932.4A Pending CN108446135A (en) 2018-03-13 2018-03-13 A kind of lines of code statistical method and device

Country Status (1)

Country Link
CN (1) CN108446135A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190974A (en) * 2018-08-30 2019-01-11 北京云族佳科技有限公司 Workload Account method and system
CN109918412A (en) * 2019-01-22 2019-06-21 新智云数据服务有限公司 Data processing method, device, equipment and storage medium
CN110716739A (en) * 2019-09-19 2020-01-21 平安科技(深圳)有限公司 Code change information statistical method, system and readable storage medium
CN110866492A (en) * 2019-11-13 2020-03-06 广州品唯软件有限公司 Baseline branch identification method and device and computer system
CN111367529A (en) * 2020-03-02 2020-07-03 浙江中控技术股份有限公司 Code contribution statistical method and device
CN111737126A (en) * 2020-06-19 2020-10-02 中国银行股份有限公司 Code quality automatic identification method and device based on configuration management tool
CN112860261A (en) * 2019-11-28 2021-05-28 腾讯科技(深圳)有限公司 Static code checking method and device, computer equipment and readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120071817A (en) * 2010-12-23 2012-07-03 한국인터넷진흥원 Automatic management system for dna and meta-data of malicious code
CN103699637A (en) * 2013-12-23 2014-04-02 国云科技股份有限公司 Code productivity statistic method and system
CN104750469A (en) * 2013-12-30 2015-07-01 ***股份有限公司 Source code statistical analysis method and source code statistical analysis system
CN104933101A (en) * 2015-05-29 2015-09-23 南车株洲电力机车研究所有限公司 SVN-based method for automatic statistics of configuration audit information
CN106293662A (en) * 2015-05-22 2017-01-04 中兴通讯股份有限公司 A kind of code change statistics of variables method and device thereof
CN106681725A (en) * 2016-12-29 2017-05-17 广州华多网络科技有限公司 Code quantity statistical method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120071817A (en) * 2010-12-23 2012-07-03 한국인터넷진흥원 Automatic management system for dna and meta-data of malicious code
CN103699637A (en) * 2013-12-23 2014-04-02 国云科技股份有限公司 Code productivity statistic method and system
CN104750469A (en) * 2013-12-30 2015-07-01 ***股份有限公司 Source code statistical analysis method and source code statistical analysis system
CN106293662A (en) * 2015-05-22 2017-01-04 中兴通讯股份有限公司 A kind of code change statistics of variables method and device thereof
CN104933101A (en) * 2015-05-29 2015-09-23 南车株洲电力机车研究所有限公司 SVN-based method for automatic statistics of configuration audit information
CN106681725A (en) * 2016-12-29 2017-05-17 广州华多网络科技有限公司 Code quantity statistical method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190974A (en) * 2018-08-30 2019-01-11 北京云族佳科技有限公司 Workload Account method and system
CN109918412A (en) * 2019-01-22 2019-06-21 新智云数据服务有限公司 Data processing method, device, equipment and storage medium
CN110716739A (en) * 2019-09-19 2020-01-21 平安科技(深圳)有限公司 Code change information statistical method, system and readable storage medium
CN110866492A (en) * 2019-11-13 2020-03-06 广州品唯软件有限公司 Baseline branch identification method and device and computer system
CN110866492B (en) * 2019-11-13 2022-12-13 广州品唯软件有限公司 Baseline branch identification method and device and computer system
CN112860261A (en) * 2019-11-28 2021-05-28 腾讯科技(深圳)有限公司 Static code checking method and device, computer equipment and readable storage medium
CN111367529A (en) * 2020-03-02 2020-07-03 浙江中控技术股份有限公司 Code contribution statistical method and device
CN111737126A (en) * 2020-06-19 2020-10-02 中国银行股份有限公司 Code quality automatic identification method and device based on configuration management tool

Similar Documents

Publication Publication Date Title
CN108446135A (en) A kind of lines of code statistical method and device
CN108536472A (en) A kind of normative inspection method and device of code
US11030071B2 (en) Continuous software deployment
US8667028B2 (en) System and method to determine database schema impact
US10380079B1 (en) Information technology configuration management
CN112395325A (en) Data management method, system, terminal equipment and storage medium
CN111767247A (en) File specification and synchronous forming control platform for real-time supervision of engineering data
CN104036365A (en) Method for constructing enterprise-level data service platform
CN102339420A (en) Information transmission device based on business management system and method thereof
Kolovos et al. Assessing the Use of Eclipse MDE Technologies in Open-Source Software Projects.
CN110163458A (en) Data assets management and monitoring method based on artificial intelligence technology
KR100903726B1 (en) System for Evaluating Data Quality Management Maturity
Bucchiarone et al. Quality analysis of NL requirements: an industrial case study
US20170039235A1 (en) Air quality metrology system
Consoli et al. An urban fault reporting and management platform for smart cities
CN1484180A (en) Work progress rate management method and system
CN106776290B (en) Intelligent continuous integration test method for incremental learning
KR100796906B1 (en) Method for Quality Control of DataBase
Schulz et al. Read Code quality assurance: from simple syntax to semantic stability
CN102143193B (en) Data synchronization method and system
Amies et al. Success factors for dam engineering industry: systematic literature review and conceptual classification
CN109345196A (en) A kind of early warning platform and method for early warning
KR101415528B1 (en) Apparatus and Method for processing data error for distributed system
KR100796905B1 (en) System for Quality Control of DataBase
KR100792322B1 (en) Framework for Quality Control of DataBase

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: 20180824