CN110413733B - Code statistical method and device - Google Patents

Code statistical method and device Download PDF

Info

Publication number
CN110413733B
CN110413733B CN201910670640.6A CN201910670640A CN110413733B CN 110413733 B CN110413733 B CN 110413733B CN 201910670640 A CN201910670640 A CN 201910670640A CN 110413733 B CN110413733 B CN 110413733B
Authority
CN
China
Prior art keywords
data
code
engineering
user
statistical
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.)
Active
Application number
CN201910670640.6A
Other languages
Chinese (zh)
Other versions
CN110413733A (en
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.)
Wheel Interconnection Technology Shanghai Co ltd
Original Assignee
Shanghai Yidianshikong Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Yidianshikong Network Co Ltd filed Critical Shanghai Yidianshikong Network Co Ltd
Priority to CN201910670640.6A priority Critical patent/CN110413733B/en
Publication of CN110413733A publication Critical patent/CN110413733A/en
Application granted granted Critical
Publication of CN110413733B publication Critical patent/CN110413733B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing

Abstract

The application discloses a code statistical method and a device. The method comprises the steps of carrying out engineering data statistics in a code base; sending the engineering data statistical results of a plurality of groups or a plurality of users to a centralized statistical module according to different dimensions; comparing the statistical results of the engineering data of the groups or the users with the stored engineering data to judge whether the corresponding engineering data exists; if yes, updating the corresponding engineering data; and if the judgment result does not exist, adding the corresponding engineering data. The method and the device solve the technical problem that the code statistical method is poor in effect. The data of all code projects are summarized through the method, and data analysis can be performed on multiple dimensions such as group dimensions, user individual dimensions and user project dimensions on the summarized data result.

Description

Code statistical method and device
Technical Field
The present application relates to the field of code management, and in particular, to a code statistics method and apparatus.
Background
Common code managers have vss, cc, svn, git and the like, and provide functions of pulling codes by a client and storing the codes by a server.
The inventors have discovered that existing code management tools are unable to support statistics for all codes within the same group, the same user, and the entire library.
Aiming at the problem of poor effect of a code statistical method in the related technology, an effective solution is not provided at present.
Disclosure of Invention
The present application mainly aims to provide a code statistical method and a device thereof to solve the problem of poor effect of the code statistical method.
To achieve the above object, according to one aspect of the present application, there is provided a code statistical method.
The code statistical method comprises the following steps: carrying out project data statistics in a code base, wherein the data statistics refer to statistical data of projects in a single group and projects under a single user; sending the project data statistical results of a plurality of groups or a plurality of users to a centralized statistical module according to different dimensions, wherein the centralized statistical module is used for merging and storing the data with different dimensions in the whole code base; comparing the statistical results of the engineering data of the groups or the users with the stored engineering data to judge whether the corresponding engineering data exists; if yes, updating the corresponding engineering data; if the judgment result does not exist, adding corresponding engineering data; the adding or updating of the corresponding engineering data refers to updating or adding the engineering data into the statistical data of the user personal dimension and the statistical data of the user engineering dimension.
Further, after comparing the statistical results of the engineering data of the plurality of groups or the plurality of users with the stored engineering data and judging whether corresponding engineering data exists, the method further includes:
and returning group dimension query data with different dimensions from the group data of the centralized statistical module according to group information to be queried carried in the query request, wherein the group dimension query data refers to the contribution degree of code data of all projects of the whole group and developers in the whole group.
Further, after comparing the statistical results of the engineering data of the plurality of groups or the plurality of users with the stored engineering data and judging whether corresponding engineering data exists, the method further includes:
and returning user personal dimension data in the project where the user is currently located from the user personal dimension of the centralized statistical module according to all project information, carried in the query request, where the user personal dimension data refers to the contribution degree to code data in all project data where the user is currently located and developers in the whole project.
Further, after comparing the statistical results of the engineering data of the plurality of groups or the plurality of users with the stored engineering data and judging whether corresponding engineering data exists, the method further includes:
and returning user engineering dimension data for all projects from the user engineering dimensions of the centralized statistics module according to all the project information under the user name to be queried, which is carried in the query request, wherein the user engineering dimension data refers to the contribution degree to code data in all the project data under the user name and developers in the whole project.
Further, sending the statistical results of the engineering data of a plurality of groups or a plurality of users to the centralized statistical module according to different dimensions comprises:
and after the engineering data statistics is completed in the code base, transmitting the engineering data statistical results of a plurality of groups or a plurality of users to a centralized statistical module according to different dimensions in a hook callback mode.
Further, the statistics in the single codebase include one or more of the following dimensions:
the total amount of code is,
the total number of code files,
the number of lines of the code file,
the code reports the time interval of the reporting,
the number of the submitting persons is determined,
hourly, daily, monthly, yearly, and monday to sunday code submissions,
the number of submissions, and the percentage of submissions, corresponding first and last submission times, the number of lines of additions and deletions,
the files of various types and the occupied proportion under the current project, and the line numbers and the occupied proportion of the files of various types under the current project.
In order to achieve the above object, according to another aspect of the present application, there is provided a code statistic apparatus.
The code statistic device comprises: the statistical module is used for carrying out engineering data statistics in the code base, wherein the data statistics refers to the statistical data of the engineering in a single group and the engineering under a single user; the system comprises a gathering module, a centralized statistics module and a code library, wherein the gathering module is used for sending the statistical results of the engineering data of a plurality of groups or a plurality of users to the centralized statistics module according to different dimensions, and the centralized statistics module is used for merging and storing the data of different dimensions in the whole code library; the judging module is used for judging whether corresponding engineering data exist or not by comparing the statistical results of the engineering data of the groups or the users with the stored engineering data; the updating module is used for updating the corresponding engineering data when judging that the engineering data exists; the increasing module is used for increasing the corresponding engineering data when judging that the corresponding engineering data do not exist; the adding or updating of the corresponding engineering data refers to updating or adding the engineering data into the statistical data of the user personal dimension and the statistical data of the user engineering dimension.
Further, still include: a first query module for
And returning group dimension query data of different dimensions from the group data of the centralized statistical module according to the group information to be queried carried in the query request, wherein the group dimension query data refers to the code data of all projects in the whole group and the contribution degree of developers in the whole group.
Further, still include: a second query module for
And returning user personal dimension data in the project where the user is currently located from the user personal dimension of the centralized statistical module according to all project information, carried in the query request, where the user personal dimension data refers to the contribution degree to code data in all project data where the user is currently located and developers in the whole project.
Further, still include: a third query module for
Returning user engineering dimension data for all projects from the user engineering dimensions of the centralized statistics module according to all project information under the user name to be queried, which is carried in the query request, wherein the user engineering dimension data refers to the contribution degree of code data in all project data under the user name and developers in the whole project
In the code statistical method and device in the embodiment of the application, a mode of carrying out engineering data statistics in a code base is adopted, and the engineering data statistical results under a plurality of groups or a plurality of users are sent to the centralized statistical module according to different dimensions, so that the purpose of judging whether corresponding engineering data exist or not by comparing the engineering data statistical results under the groups or the users with stored engineering data is achieved, the technical effect of updating or increasing the corresponding engineering data is achieved, and the technical problem of poor effect of the code statistical method is solved.
By adopting the code statistical method in the embodiment of the application, the data is not a single engineering dimension any more, and the data of all code engineering is summarized. Preferably, data analysis can be carried out on the summarized data result in multiple dimensions such as a group dimension, a user individual dimension, a user engineering dimension and the like.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, serve to provide a further understanding of the application and to enable other features, objects, and advantages of the application to be more apparent. The drawings and their description illustrate the embodiments of the invention and do not limit it. In the drawings:
FIG. 1 is a schematic flow chart of a code statistical method according to a first embodiment of the present application;
FIG. 2 is a flowchart illustrating a code statistics method according to a second embodiment of the present application;
FIG. 3 is a flowchart illustrating a code statistics method according to a third embodiment of the present application;
FIG. 4 is a flowchart illustrating a code statistics method according to a fourth embodiment of the present application;
FIG. 5 is a schematic flow chart of a code statistics method according to a fifth embodiment of the present application;
FIG. 6 is a block diagram of a code statistics apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a code statistics apparatus according to a preferred embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In this application, the terms "upper", "lower", "left", "right", "front", "rear", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal", and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings. These terms are used primarily to better describe the present application and its embodiments, and are not used to limit the indicated devices, elements or components to a particular orientation or to be constructed and operated in a particular orientation.
Moreover, some of the above terms may be used to indicate other meanings besides the orientation or positional relationship, for example, the term "on" may also be used to indicate some kind of attachment or connection relationship in some cases. The specific meaning of these terms in this application will be understood by those of ordinary skill in the art as appropriate.
Furthermore, the terms "mounted," "disposed," "provided," "connected," and "sleeved" are to be construed broadly. For example, it may be a fixed connection, a removable connection, or a unitary construction; can be a mechanical connection, or an electrical connection; may be directly connected, or indirectly connected through intervening media, or may be in internal communication between two devices, elements or components. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art as appropriate.
According to the method, after data statistics of a single project is completed, various data such as code line number, code storage amount, code file number, file classification information and code submission user information of the corresponding project are gathered into a single module.
The terms in this application are explained as follows:
code base: a repository that holds all company codes.
Code engineering: a project can have 1-N user members by a single associated code set, and the corresponding members can carry out operations such as file, code submission, deletion and the like.
Group (2): a group is a collection of users, and a group may contain 1-N users that have the user's rights in the group for all projects belonging to the group. For example, user A is the owner of the group, then user A is the owner of all projects within the group.
User personal dimension: the statistical dimensions for a single user include the total amount of code, number of files, number of lines of code, and various percentage related data.
The user engineering dimension is as follows: aiming at the statistical dimension of a single user project, the data of the existing project of the user are included, and the existing data can be aggregated or split to be displayed.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
As shown in fig. 1, the method includes steps S102 to S108 as follows:
step S102, carrying out project data statistics in a code base, wherein the data statistics refers to the statistical data of projects in a single group and projects under a single user;
step S104, sending the project data statistical results of a plurality of groups or a plurality of users to a centralized statistical module according to different dimensions, wherein the centralized statistical module is used for merging and storing the data of different dimensions in the whole code base;
step S106, comparing the statistical results of the engineering data of the plurality of groups or the plurality of users with the stored engineering data, and judging whether corresponding engineering data exists or not;
step S108, if the judgment result is yes, updating the corresponding engineering data;
step S110, if the data do not exist, adding corresponding engineering data;
the adding or updating of the corresponding engineering data refers to updating or adding the engineering data into the statistical data of the user personal dimension and the statistical data of the user engineering dimension.
When the steps are implemented, various single data such as the number of code files, the number of code lines, the code storage amount, the number of submissions and the like of all kinds of projects are summarized, the corresponding user submission data and the group data are merged and calculated, after the calculation is completed, the data storage is carried out, and when the data of a corresponding user or all projects in a certain group need to be pulled, the data extraction is carried out from the module.
Specifically, there are multiple groups group _ a/group _ B/group _ c.. group _ Z, etc. in the code library, there are 1-n projects under each group:
a plurality of projects, such as group _ pro _ a1, group _ pro _ a2.. group _ pro _ An, group _ pro _ B1, group _ pro _ B2.. group _ pro _ Bn, etc., are provided, while a plurality of users, such as user _1, user _2.. etc., are provided in the code library, and each user also has 1-n projects, such as user1_ pro1, user1_ pro2.. user1_ pro2, user2_ pro1, user2_ pro2.. etc.
When a project starts from group _ pro _ a1, firstly, each dimension data is counted, then, each dimension data is sent to a centralized counting module through a hook (callback), the counting module compares the data in the group _ pro _ a1, such as the total amount of codes in the project, the total number of code files, the number of rows of code files, and the like with the existing stored data, if the corresponding data of the project group _ pro _ a1 is not stored, a new adding operation is performed, and if the corresponding data of the group _ pro _ a1 is stored, new data is compared and updated. Updating the latest submission to the code reporting time interval;
and if a new user submits the project in the statistics, updating the total number of the developers. And meanwhile, summarizing and merging all the user and file information collected this time, for example, the user1 submits 3 times, 4 files are added, 1 file is deleted, 144 lines of codes are added, and at this time, the data are stored in corresponding project data, and the data also need to be updated into the statistical data of the individual dimension and the statistical data of the group dimension of the user. For the user engineering user1_ pro1, when performing data statistics, similar to group-related statistics, if there is corresponding engineering data, corresponding data update is performed, and if there is no corresponding data, data increase is performed, and these data need to be updated into the statistical data of the user individual dimension and the statistical data of the user engineering dimension.
From the above description, it can be seen that the following technical effects are achieved by the present application:
in the embodiment of the application, the mode of carrying out engineering data statistics in the code base is adopted, and the engineering data statistics results under a plurality of groups or a plurality of users are sent to the centralized statistics module according to different dimensions, so that the purpose of judging whether corresponding engineering data exist or not by comparing the engineering data statistics results under the plurality of groups or the plurality of users with the stored engineering data is achieved, the technical effect of updating or increasing the corresponding engineering data is realized, and the technical problem of poor effect of the code statistics method is solved.
According to the embodiment of the present application, as shown in fig. 2, after comparing the statistical results of the engineering data under the plurality of groups or the plurality of users with the stored engineering data to determine whether corresponding engineering data exists, the method further includes:
step S202, according to the group information to be inquired carried in the inquiry request, returning the group dimension inquiry data with different dimensions from the group data of the centralized statistical module, wherein the group dimension inquiry data refers to the code data of all projects of the whole group and the contribution degree of developers in the whole group.
Specifically, if the detailed information of a certain group needs to be queried, the data display of each dimension can be performed from the group data of the statistical module, including the data of the total code amount, the total code file amount, the number of code file lines, and the like of all projects of the whole group, and also including how many developers the whole group includes, the number of submitted code lines, the number of files of corresponding developers, and the occupation ratio in all projects of the whole group. The contribution degree is data such as the total amount of codes, the total number of code files, the line number of the code files and the like.
According to the embodiment of the present application, as shown in fig. 3, after comparing the statistical results of the engineering data under the plurality of groups or the plurality of users with the stored engineering data to determine whether corresponding engineering data exists, the method further includes:
step S302, according to all project information of the user needing to be inquired carried in the inquiry request, returning user personal dimension data in the project where the user is currently located from the user personal dimension of the centralized statistical module, wherein the user personal dimension data refers to the contribution degree of code data in all project data where the user is currently located and developers in the whole project.
Specifically, if all the project data of a certain user in the project data are required to be queried, data query can be performed through the personal dimension of the user, and at this time, how many lines of codes are submitted by the user in all the project data of the user in the project data, how many files are increased, and the storage amount occupied by the corresponding files can be queried. Meanwhile, the data can be split, and the number of line codes submitted by the user in the corresponding project can be checked in a project, so that the number of files, the occupied storage amount, the submission records, the relevant ratio and other data are increased. The contribution degree is the number of lines of codes submitted in all the engineering data, and the number of files is increased, which corresponds to the storage amount occupied by the files.
According to the embodiment of the present application, as shown in fig. 4, after comparing the statistical results of the engineering data under the plurality of groups or the plurality of users with the stored engineering data to determine whether corresponding engineering data exists, the method further includes:
step S402, according to all the project information under the user name to be inquired carried in the inquiry request, returning the user project dimension data for all the projects from the user project dimension of the centralized statistical module, wherein the user project dimension data refers to the contribution degree to the code data in all the project data under the user name and the developer in the whole project.
Specifically, if all project data under the name of a certain user needs to be queried, data display can be performed through the user project dimension, including how many projects under the name of the user and how many line codes are submitted by all the projects, and data such as file number, occupied storage amount, submitted records submitted by how many developers, relevant occupation ratios and the like are increased. Meanwhile, data splitting can be carried out, and data of a single project under the user name is inquired and contains all dimension data of the project. The contribution degree is the number of projects under the user name, and the number of codes submitted by all the projects increases the number of files and occupies the memory space.
According to the embodiment of the present application, as shown in fig. 5, as a preferred option in the embodiment, sending the statistical results of the engineering data under a plurality of groups or a plurality of users to the centralized statistical module according to different dimensions includes:
step S502, after the project data statistics is completed in the code base, the project data statistics results of a plurality of groups or a plurality of users are sent to a centralized statistics module according to different dimensions in a hook callback mode.
Specifically, when the code statistics of a single project is completed, the corresponding tool is modified, the data is reported to the centralized statistics module, the statistics module performs data merging and storage, and the corresponding group project aggregated data, the user project aggregated data and the aggregated data under the whole code base can be checked through a network request subsequently. The method mainly provides a method for automatically aggregating code engineering statistical data, and the data to be reported is called back to a data centralized statistical module through a hook (callback) after the current engineering statistical data is finished.
According to the embodiment of the present application, as a preference in the embodiment, the statistical data in the single code base includes one or more of the following dimensions:
the total amount of code is,
the total number of code files,
the number of lines of the code file,
the code reports the time interval of the reporting,
the number of the submitting persons is determined,
hourly, daily, monthly, yearly, and monday to sunday code submissions,
the number of submissions, and the percentage of submissions, corresponding first and last submission times, the number of lines of additions and deletions,
the files of various types and the occupied proportion under the current project, and the line numbers and the occupied proportion of the files of various types under the current project.
Specifically, the statistics of the individual codebases include the following dimensions: the total amount of code, i.e. the memory space occupied by the code. The total number of code files, i.e., how many files are in common within the current project. The number of code file lines, i.e., the total number of lines of all files in the current project. The code reporting time interval is the time interval from the first submission to the last submission of the current project. The number of submitters, i.e., how many developers of the project have made submissions. Hourly, daily, monthly, yearly, and monday through sunday code submissions. The number of submissions of each developer in the current project, the percentage of submissions, the corresponding first and last submission times, and the number of lines to be added and deleted. The files of various types and the occupied proportion under the current project, and the line numbers and the occupied proportion of the files of various types under the current project.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
According to an embodiment of the present application, there is also provided a code statistics apparatus for implementing the above method, as shown in fig. 6, the apparatus includes: a statistics module 100, configured to perform engineering data statistics in a code base, where the data statistics refers to statistical data of engineering in a single group and engineering under a single user; the system comprises a summarizing module 200, a centralized counting module and a code library, wherein the summarizing module 200 is used for sending the project data counting results of a plurality of groups or a plurality of users to the centralized counting module according to different dimensions, and the centralized counting module is used for merging and storing the data with different dimensions in the whole code library; the judging module 300 is configured to judge whether corresponding engineering data exists by comparing the statistical results of the engineering data of the plurality of groups or the plurality of users with the stored engineering data; an update module 400, configured to update the corresponding engineering data when the existence is determined; an adding module 500, configured to add corresponding engineering data when it is determined that the corresponding engineering data does not exist; the adding or updating of the corresponding engineering data refers to updating or adding the engineering data into the statistical data of the user personal dimension and the statistical data of the user engineering dimension.
When the steps are implemented, various single data such as the number of code files, the number of code lines, the code storage amount, the number of submissions and the like of all kinds of projects are summarized, the corresponding user submission data and the group data are merged and calculated, after the calculation is completed, the data storage is carried out, and when the data of a corresponding user or all projects in a certain group need to be pulled, the data extraction is carried out from the module.
Specifically, there are multiple groups group _ a/group _ B/group _ c.. group _ Z in the code library, and there are 1-n projects under each group:
a plurality of projects, such as group _ pro _ a1, group _ pro _ a2.. a.
When a project starts from group _ pro _ a1, firstly, each dimension data is counted, then, each dimension data is sent to a centralized counting module through a hook (callback), the counting module compares the data in the group _ pro _ a1, such as the total amount of codes in the project, the total number of code files, the number of rows of code files, and the like with the existing stored data, if the corresponding data of the project group _ pro _ a1 is not stored, a new adding operation is performed, and if the corresponding data of the group _ pro _ a1 is stored, new data is compared and updated. Updating the latest submission to the code reporting time interval;
and if a new user submits the project in the statistics, updating the total number of the developers. And meanwhile, summarizing and merging all the user and file information collected this time, for example, the user1 submits 3 times, 4 files are added, 1 file is deleted, 144 lines of codes are added, and at this time, the data are stored in corresponding project data, and the data also need to be updated into the statistical data of the individual dimension and the statistical data of the group dimension of the user. For the user engineering user1_ pro1, when performing data statistics, similar to group-related statistics, if corresponding engineering data exist, corresponding data update is performed, and if corresponding engineering data do not exist, data increase is performed, and meanwhile, the data need to be updated into statistical data of user individual dimensions and statistical data of user engineering dimensions.
According to the embodiment of the present application, as shown in fig. 7, it is preferable that: a first query module 600 for
And returning group dimension query data with different dimensions from the group data of the centralized statistical module according to group information to be queried carried in the query request, wherein the group dimension query data refers to the contribution degree of code data of all projects of the whole group and developers in the whole group.
Specifically, if all the project data of a certain user in the project data of the user need to be queried, the data can be queried through the personal dimension of the user, and at this time, how many lines of codes are submitted by the user in all the project data of the user in the project data of the user, how many files are added, and the storage amount occupied by the corresponding files can be obtained. Meanwhile, the data can be split, and the number of line codes submitted by the user in the corresponding project can be checked in a project, so that the number of files, the occupied storage amount, the submission records, the relevant ratio and other data are increased. The contribution degree is the number of lines of codes submitted in all the engineering data, and the number of files is increased, which corresponds to the storage amount occupied by the files.
According to the embodiment of the present application, as shown in fig. 7, it is preferable that: a second query module 700 for
And returning user personal dimension data in the project where the user is currently located from the user personal dimension of the centralized statistical module according to all project information, carried in the query request, where the user personal dimension data refers to the contribution degree to code data in all project data where the user is currently located and developers in the whole project.
Specifically, if all project data under the name of a certain user needs to be queried, data display can be performed through the user project dimension, including how many projects under the name of the user and how many line codes are submitted by all the projects, and data such as file number, occupied storage amount, submitted records submitted by how many developers, relevant occupation ratios and the like are increased. Meanwhile, data splitting can be carried out, and data of a single project under the user name is inquired and contains all dimension data of the project. The contribution degree is the number of projects under the user name, and the number of codes submitted by all the projects increases the number of files and the occupied storage amount.
According to the embodiment of the present application, as shown in fig. 7, it is preferable that: a third query module 800 for
And returning user engineering dimension data for all projects from the user engineering dimensions of the centralized statistics module according to all the project information under the user name to be queried, which is carried in the query request, wherein the user engineering dimension data refers to the contribution degree to code data in all the project data under the user name and developers in the whole project.
Specifically, when the code statistics of a single project is completed, the corresponding tool is modified, the data is reported to the centralized statistics module, the statistics module performs data merging and storage, and the corresponding group project aggregated data, the user project aggregated data and the aggregated data under the whole code base can be checked through a network request subsequently. The method mainly provides a method for automatically aggregating code engineering statistical data, and the data to be reported is called back to a data centralized statistical module through a hook (callback) after the current engineering statistical data is finished.
It should be obvious to those skilled in the art that the modules or steps of the present application described above can be implemented by a general-purpose computing device, they can be centralized on a single computing device or distributed on a network composed of a plurality of computing devices, and they can alternatively be implemented by program code executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be separately manufactured as integrated circuit modules, or a plurality of modules or steps in them can be manufactured as a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (9)

1. A code statistics method, comprising:
carrying out project data statistics in a code base, wherein the data statistics refer to statistical data of projects in a single group and projects under a single user;
sending the project data statistical results of a plurality of groups or a plurality of users to a centralized statistical module according to different dimensions, wherein the centralized statistical module is used for merging and storing the data with different dimensions in the whole code base;
comparing the statistical results of the engineering data of the groups or the users with the stored engineering data to judge whether the corresponding engineering data exists;
if yes, updating the corresponding engineering data;
if the judgment result does not exist, adding corresponding engineering data;
wherein the adding or updating of the corresponding engineering data means that the engineering data is updated or added to the statistical data of the user personal dimension and the statistical data of the user engineering dimension;
the statistics in the single codebase include one or more of the following dimensions:
the total amount of code is,
the total number of code files,
the number of lines of the code file,
the code reports the time interval of the reporting,
the number of the submitting persons is determined,
hourly, daily, monthly, yearly, and monday to sunday code submissions,
the number of submissions, and the percentage of submissions, corresponding first and last submission times, the number of lines of additions and deletions,
the files of various types and the occupied proportion under the current project, and the line numbers and the occupied proportion of the files of various types under the current project.
2. The code statistical method according to claim 1, wherein after comparing the statistical results of the engineering data of the plurality of groups or the plurality of users with the stored engineering data to determine whether corresponding engineering data exists, the method further comprises:
and returning group dimension query data of different dimensions from the group data of the centralized statistical module according to the group information to be queried carried in the query request, wherein the group dimension query data refers to the code data of all projects in the whole group and the contribution degree of developers in the whole group.
3. The code statistical method according to claim 1, wherein after comparing the statistical results of the engineering data of the plurality of groups or the plurality of users with the stored engineering data to determine whether corresponding engineering data exists, the method further comprises:
and returning user personal dimension data in the project where the user is currently located from the user personal dimension of the centralized statistical module according to all project information, carried in the query request, where the user personal dimension data refers to the contribution degree to code data in all project data where the user is currently located and developers in the whole project.
4. The code statistical method according to claim 1, wherein after comparing the statistical results of the engineering data of the plurality of groups or the plurality of users with the stored engineering data to determine whether corresponding engineering data exists, the method further comprises:
and returning user engineering dimension data for all projects from the user engineering dimensions of the centralized statistics module according to all the project information under the user name to be queried, which is carried in the query request, wherein the user engineering dimension data refers to the contribution degree to code data in all the project data under the user name and developers in the whole project.
5. The code statistical method according to claim 1, wherein sending the statistical results of the engineering data under a plurality of groups or a plurality of users to the centralized statistical module according to different dimensions comprises:
and after the engineering data statistics is completed in the code base, transmitting the engineering data statistical results of a plurality of groups or a plurality of users to a centralized statistical module according to different dimensions in a hook callback mode.
6. A code statistics apparatus, comprising:
the statistical module is used for carrying out engineering data statistics in the code base, wherein the data statistics refers to the statistical data of the engineering in a single group and the engineering under a single user;
the system comprises a gathering module, a centralized statistics module and a code library, wherein the gathering module is used for sending the statistical results of the engineering data of a plurality of groups or a plurality of users to the centralized statistics module according to different dimensions, and the centralized statistics module is used for merging and storing the data of different dimensions in the whole code library;
the judging module is used for judging whether corresponding engineering data exist or not by comparing the statistical results of the engineering data of the groups or the users with the stored engineering data;
the updating module is used for updating the corresponding engineering data when judging that the corresponding engineering data exists;
the increasing module is used for increasing the corresponding engineering data when judging that the corresponding engineering data do not exist;
wherein the adding or updating of the corresponding engineering data means that the engineering data is updated or added to the statistical data of the user personal dimension and the statistical data of the user engineering dimension;
the statistics in the single codebase include one or more of the following dimensions:
the total amount of code is,
the total number of code files,
the number of lines of the code file,
the code reports the time interval for which it is time to transmit,
the number of the submitting persons is increased,
hourly, daily, monthly, yearly, and monday to sunday code submissions,
the number of submissions, and the percentage of submissions, corresponding first and last submission times, the number of lines of additions and deletions,
the files of various types and the occupied proportion under the current project, and the line numbers and the occupied proportion of the files of various types under the current project.
7. The code statistics apparatus of claim 6, further comprising: a first query module for
And returning group dimension query data with different dimensions from the group data of the centralized statistical module according to group information to be queried carried in the query request, wherein the group dimension query data refers to the contribution degree of code data of all projects of the whole group and developers in the whole group.
8. The code statistics apparatus of claim 6, further comprising: a second query module for
And returning user personal dimension data in the project where the user is currently located from the user personal dimension of the centralized statistical module according to all project information, carried in the query request, where the user personal dimension data refers to the contribution degree to code data in all project data where the user is currently located and developers in the whole project.
9. The code statistics apparatus of claim 6, further comprising: a third query module for
And returning user engineering dimension data for all projects from the user engineering dimensions of the centralized statistics module according to all the project information under the user name to be queried, which is carried in the query request, wherein the user engineering dimension data refers to the contribution degree to code data in all the project data under the user name and developers in the whole project.
CN201910670640.6A 2019-07-23 2019-07-23 Code statistical method and device Active CN110413733B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910670640.6A CN110413733B (en) 2019-07-23 2019-07-23 Code statistical method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910670640.6A CN110413733B (en) 2019-07-23 2019-07-23 Code statistical method and device

Publications (2)

Publication Number Publication Date
CN110413733A CN110413733A (en) 2019-11-05
CN110413733B true CN110413733B (en) 2022-05-06

Family

ID=68362758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910670640.6A Active CN110413733B (en) 2019-07-23 2019-07-23 Code statistical method and device

Country Status (1)

Country Link
CN (1) CN110413733B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8078481B2 (en) * 2003-12-05 2011-12-13 John Steinbarth Benefits administration system and methods of use and doing business
CN101582072A (en) * 2008-05-16 2009-11-18 鸿富锦精密工业(深圳)有限公司 System and method for counting codes
US20120187185A1 (en) * 2011-01-20 2012-07-26 Eugene Sayan System and method for detecting counterfeit products and documents, and tracking and authenticating documents
CN103699637B (en) * 2013-12-23 2017-02-08 国云科技股份有限公司 Code productivity statistic method and system
CN107203370A (en) * 2016-03-16 2017-09-26 阿里巴巴集团控股有限公司 Quantify the method and apparatus of developer's code quality
CN109002395B (en) * 2018-07-06 2020-11-24 京东数字科技控股有限公司 Code coverage rate management method and device
CN109271321B (en) * 2018-09-20 2021-08-20 杭州安恒信息技术股份有限公司 Method and device for counting contribution code number
CN109753286A (en) * 2018-12-28 2019-05-14 四川新网银行股份有限公司 A method of the code method based on functional label counts its call number

Also Published As

Publication number Publication date
CN110413733A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
US8655923B2 (en) Simple aggregate mode for transactional data
US11163735B2 (en) Database capacity estimation for database sizing
CN109299157B (en) Data export method and device for distributed big single table
CN111666326B (en) ETL scheduling method and device
CN104903894A (en) System and method for distributed database query engines
US20080208880A1 (en) Extended cell information in multidimensional data models
CN111506559A (en) Data storage method and device, electronic equipment and storage medium
US20040249691A1 (en) Method, system and computer product for strategic priority order tracking
CN109740129B (en) Report generation method, device and equipment based on blockchain and readable storage medium
CN110457371A (en) Data managing method, device, storage medium and system
CN109063066A (en) Data query method and device, data management system
CN110637292B (en) System and method for querying a resource cache
CN111666344A (en) Heterogeneous data synchronization method and device
CN109547931B (en) Server for determining location of mobile terminal
CN110609839A (en) Method, device and equipment for processing block chain data and readable storage medium
CN106844497A (en) The check device and method of a kind of database code
CN110413733B (en) Code statistical method and device
CN112631879A (en) Data acquisition method and device, computer readable medium and electronic equipment
WO2013140412A1 (en) A method and system for distributed computing of jobs
EP2830289A1 (en) Adaptable reporting in a multi-client telecommunication network
CN115481026A (en) Test case generation method and device, computer equipment and storage medium
CN109377391A (en) A kind of tracking of information method, storage medium and server
CN113377604B (en) Data processing method, device, equipment and storage medium
CN113778286A (en) Application control display method and device, storage medium and electronic equipment
CN114022188A (en) Target crowd circling method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 200125, Room 325, 3rd Floor, Unit 2, No. 231, Shibocun Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai

Patentee after: Wheel interconnection technology (Shanghai) Co.,Ltd.

Address before: 200125 Room 501, 5 / F, building 3, 3601 Dongfang Road, Pudong New Area, Shanghai

Patentee before: SHANGHAI YIDIAN SPACE NETWORK Co.,Ltd.

CP03 Change of name, title or address