Svn 乌龟统计中作者的百分比是多少?

Svn 乌龟统计中作者的百分比是多少?,svn,tortoisesvn,Svn,Tortoisesvn,在《乌龟》的统计部分,有一种叫做“作者百分比”的东西。这是什么?这是如何计算的?它又有什么用处呢?作者的百分比是一个衡量标准 理论上,它确实应该是线条变化,但通过 文件的整个历史记录,权重逐渐减小。 此外,可以应用某种启发式方法来减少 空白的权重仅会更改,例如缩进修复。粗略地 说起来,这个指标应该回答“谁应该 如果我想理解/修复/改进这部分代码,我会与您交谈” 实际上,这是: void CStatGraphDlg::GatherData() { //健康检查 if((m_parAuthors==

在《乌龟》的统计部分,有一种叫做“作者百分比”的东西。这是什么?这是如何计算的?它又有什么用处呢?

作者的百分比是一个衡量标准

理论上,它确实应该是线条变化,但通过 文件的整个历史记录,权重逐渐减小。 此外,可以应用某种启发式方法来减少 空白的权重仅会更改,例如缩进修复。粗略地 说起来,这个指标应该回答“谁应该 如果我想理解/修复/改进这部分代码,我会与您交谈”

实际上,这是:

void CStatGraphDlg::GatherData()
{
//健康检查
if((m_parAuthors==NULL)| |(m_parDates==NULL)| |(m_parFileChanges==NULL))
返回;
m_nTotalCommits=m_paraauthors->GetCount();
m_nTotalFileChanges=0;
//更新m_nWeeks和m_minDate
updateWekCount();
//现在创建一个每周保存信息的映射。
m_commitsPerUnitAndAuthor.clear();
m_filechangesperunitandautor.clear();
m_commitsPerAuthor.clear();
整数区间=0;
__time64\u t d=(\u\u time64\u t)m\u parDates->GetAt(0);
int nLastUnit=GetUnit(d);
double AllContributionAuthor=0;
//现在循环所有周并收集信息
for(长i=0;iGetAt(i);
int u=获取单位(提交日期);
如果(nLastUnit!=u)
区间++;
nLastUnit=u;
//查找作者姓名
CString sAuth=m_助理作者->GetAt(i);
如果(!m_Bauthorsca敏感)
sAuth=sAuth.MakeLower();
tstring author=tstring(sAuth);
//增加此作者的提交总数
m_commitsPerAuthor[作者]+;
//增加本周此作者的提交计数
m_commitsPerUnitAndAuthor[间隔][作者]++;
CTime t=m_parDates->GetAt(i);
m_unitNames[interval]=GetUnitLabel(nLastUnit,t);
//增加本周此作者的文件更改计数
int fileChanges=m_parFileChanges->GetAt(i);
m_filechangesperunitandautor[interval][author]+=fileChanges;
m_nTotalFileChanges+=文件更改;
//计算贡献作者
double contributionAuthor=coefffcontribution((int)m_nTotalCommits-i-1)*文件更改;
AllContributionAuthor+=contributionAuthor;
作者的m_百分比[作者]+=贡献作者;
}
//查找第一个和最后一个间隔数。
如果(!m_commitsPerUnitAndAuthor.empty())
{
IntervalDataMap::迭代器interval_it=m_commitsPerUnitAndAuthor.begin();
m_firstInterval=间隔\u it->first;
interval_it=m_commitsPerUnitAndAuthor.end();
--间隔时间;
m_lastInterval=间隔\u it->first;
//健全性检查-如果m_lastInterval太大,可能会冻结TSVN并占用所有内存!!!
断言(m_lastInterval>=0&&m_lastInterval<10000);
}
其他的
{
m_firstInterval=0;
m_lastInterval=-1;
}
//获取作者姓名列表
作者名单(m_commitsPerAuthor);
//计算贡献作者的百分比
对于(std::list::iterator it=m_authorNames.begin();it!=m_authorNames.end();+it)
{
作者的m_百分比[*it]=(作者的m_百分比[*it]*100)/所有贡献作者;
}
//所有这些都完成了,现在统计页面可以检索数据和
//提取要显示的信息。
}
该指标的灵感来自(我在这里复制它们,因为我发现它们很有趣,但链接很容易断开):

术语
有四种类型的用户:维护者、开发者、Bug修复者、,
前三位都是贡献者。
姓名:维护者(贡献者)
描述:维护人员审查来自其他部门的提交和分支
并决定将哪些参与者集成到“主”分支中。
姓名:开发者(贡献者)
描述:开发人员为项目提供增强功能,
e、 g.他们添加新内容或改进现有内容。
名称:Bug修复者(贡献者)
描述:Bug修复程序定位“Bug”(作为不需要的东西)
需要更正)并“修复”它们。
姓名:用户
说明:用户使用内容,无论是在日常工作中还是
偶尔为了一个特定的目的。
用例
在所有使用中都假定有其他贡献者审核提交的模型
案例。当被引用时,被引用到另一个参与者
贡献者根据挖掘的数据调整他们的行为
应该记住,贡献者应该是最重要的
使用这些信息,比如说,花更多的时间检查
在处理程序的特定部分时,自己提交错误
主动提供内容往往比实际行动更有效
所以只有在被问到之后
名称:查找在特定内容位中处于活动状态的参与者。
说明:
当一个贡献者需要了解其他贡献者时
在他们查询git的内容的特定部分中处于活动状态的
此信息。此信息可用于确定向谁发送副本
指提交(最近从事提交内容工作的人)
Modifiers可能对这样的提交感兴趣)
信息可能很容易收集,比如说git。聚合
它的输出(如果需要保持快速响应,则在后台)
确定一个贡献者是否拥有更多的
提交/更改行数超过预定义的数量。主要区别是
git的错误在于它的输出是在
内容,针对特定的贡献者,而git只显示
最新的变化。
名称:查找哪些提交涉及
提交接触。
说明:
有几个原因导致一个m
void CStatGraphDlg::GatherData()
{
    // Sanity check
    if ((m_parAuthors==NULL)||(m_parDates==NULL)||(m_parFileChanges==NULL))
        return;
    m_nTotalCommits = m_parAuthors->GetCount();
    m_nTotalFileChanges = 0;

    // Update m_nWeeks and m_minDate
    UpdateWeekCount();

    // Now create a mapping that holds the information per week.
    m_commitsPerUnitAndAuthor.clear();
    m_filechangesPerUnitAndAuthor.clear();
    m_commitsPerAuthor.clear();

    int interval = 0;
    __time64_t d = (__time64_t)m_parDates->GetAt(0);
    int nLastUnit = GetUnit(d);
    double AllContributionAuthor = 0;

    // Now loop over all weeks and gather the info
    for (LONG i=0; i<m_nTotalCommits; ++i)
    {
        // Find the interval number
        __time64_t commitDate = (__time64_t)m_parDates->GetAt(i);
        int u = GetUnit(commitDate);
        if (nLastUnit != u)
            interval++;
        nLastUnit = u;
        // Find the authors name
        CString sAuth = m_parAuthors->GetAt(i);
        if (!m_bAuthorsCaseSensitive)
            sAuth = sAuth.MakeLower();
        tstring author = tstring(sAuth);
        // Increase total commit count for this author
        m_commitsPerAuthor[author]++;
        // Increase the commit count for this author in this week
        m_commitsPerUnitAndAuthor[interval][author]++;
        CTime t = m_parDates->GetAt(i);
        m_unitNames[interval] = GetUnitLabel(nLastUnit, t);
        // Increase the file change count for this author in this week
        int fileChanges = m_parFileChanges->GetAt(i);
        m_filechangesPerUnitAndAuthor[interval][author] += fileChanges;
        m_nTotalFileChanges += fileChanges;

        //calculate Contribution Author
        double  contributionAuthor = CoeffContribution((int)m_nTotalCommits - i -1) * fileChanges;
        AllContributionAuthor += contributionAuthor;
        m_PercentageOfAuthorship[author] += contributionAuthor;
    }

    // Find first and last interval number.
    if (!m_commitsPerUnitAndAuthor.empty())
    {
        IntervalDataMap::iterator interval_it = m_commitsPerUnitAndAuthor.begin();
        m_firstInterval = interval_it->first;
        interval_it = m_commitsPerUnitAndAuthor.end();
        --interval_it;
        m_lastInterval = interval_it->first;
        // Sanity check - if m_lastInterval is too large it could freeze TSVN and take up all memory!!!
        assert(m_lastInterval >= 0 && m_lastInterval < 10000);
    }
    else
    {
        m_firstInterval = 0;
        m_lastInterval = -1;
    }

    // Get a list of authors names
    LoadListOfAuthors(m_commitsPerAuthor);

    // Calculate percent of Contribution Authors
    for (std::list<tstring>::iterator it = m_authorNames.begin(); it != m_authorNames.end(); ++it)
    {
        m_PercentageOfAuthorship[*it] =  (m_PercentageOfAuthorship[*it] *100)/ AllContributionAuthor;
    }

    // All done, now the statistics pages can retrieve the data and
    // extract the information to be shown.

}
Terminology
 There are four types of users: Maintainers, Developers, Bug-fixers, 
 and regular Users. The first three are all Contributors.

Name: Maintainer (Contributor)
Description: The Maintainer reviews commits and branches from other 
Contributors and decided which ones to integrate into a 'master' branch.

Name: Developer (Contributor)
Description: The Developer contributes enhancements to the project, 
e.g. they add new content or improve existing content.

Name: Bug-fixer (Contributor)
Description: The Bug-fixer locates 'bugs' (as something unwanted that 
needs to be corrected) in the content and 'fixes' them.

Name: User
Description: The User uses the content, be it in their daily work or 
every now and then for a specific purpose. 


Use cases

A model where other Contributors review commits is assumed in all use 
cases. When referenced are made to a Contributor addressing another 
Contributor to adjust their behavior as the result of data mined, it
should be kept in mind that the Contributor should foremost be the one 
to do this. Using this information to, say, spend more time checking 
ones own commits for bugs when working on a specific part of the
content on ones own accord is is often more effective then doing
so only after being asked. </disclaimer>? :P

Name: Finding a Contributor that is active in a specific bit of content.
Description:
      Whenever a Contributor needs to know about other Contributors 
that are active in a specific part of the content they query git for
this information. This could be used to figure out whom to send a copy 
of a commit (someone who has recently worked on the content a commit 
modifies is likely to be interested in such a commit). This 
information may be easily gathered with, say, git blame. Aggregating 
it's output (in the background if need be to maintain speedy response
times), it is trivial to determine whether a Contributor has more 
commits/lines of change than a predefined amount. The main difference 
with git blame is that it's output is aggregated over the history of 
the content, for a specific Contributor, whereas git blame only shows 
the latest changes.

Name: Finding which commits touches the parts of the content that a 
      commit touches.
Description:
      There are several reasons that one might want to know which 
commit touches the parts of the content that a commit touches. This 
may be implemented similar to how git blame works only instead of 
'stopping' after having found the author of a line, the search 
continues up to a certain date in the past.

Name: Integrating the found 'bug introducing' commit with the git 
      commit message system.
Description:
      When a Bug-fixer sends out a commit to fix a bug it might be 
useful for them to find out where exactly the bug was introduced. 
Using the 'which commit touched the content this commit touches' 
technique optional candidates may be retrieved. After picking which of
the found commits caused the bug, this information may then 
automatically added to the commit's description. This does not only 
allow the Bug-fixer to make clear the origin of their commit, but also 
make it possible to later unambiguously determine a bug/fix pair. Note 
that this is automated, no user input is required to determine which 
commit caused the bug, only the picking of 'cause' commits requires 
input from the user.

Name: Finding the Author that introduce a lot of/almost no bugs to 
      the content.
Description:
      Contributors might be interested to know which of the Developers 
introduce a lot of bugs, or the contrary, which introduce almost no 
bugs to the content. This information is highly relevant to the 
Maintainer as they may now focus the time they spend on reviewing 
commits on those that stem from Developers that turn out to often
introduce bugs. On the other hand, Developers that usually do not 
introduce bugs need less reviewing time. While such information is 
usually known to the experienced Maintainer (as they know their main 
contributors well), it can be helpful to new maintainers, or as a 
pointer that the opinion of the Maintainer about a specific Developer 
needs to be adjusted. Bug-fixers on the other hand can use this 
information to address the Developer that introduces most of the bugs 
they fix, perhaps with advice on how to prevent future bugs from being
introduced.

Name: Finding the Contributor that accepted a lot of/almost no bugs 
      into the content.
Description:
      Similar to the finding Authors that write the bugs, there are 
other Contributors that 'accept' the commit. Either passively, by not
commenting when the commit is sent out for review, or actively, by 
'acknowledging' (acked-by), 'signing off' (signed-off-by) or 'testing' 
(tested-by) a commit. When actively doing so, this can later be traced
and then be used in the same ways as for Authors.

Name: Finding parts of the content in which a lot of bugs are 
      introduced and fixed
Description:
      When a Developer decides to change part of the content, it would 
be interesting for them to know that many before them introduced bugs 
when working on that part of the content. Knowing this the Developer 
might ask for all such buggy commits to try and learn from the 
mistakes made by others and prevent making the same mistake. A 
Maintainer might use this information to spend extra time reviewing a
commit from a 'bug prone' part of the content. 

Name: Finding parts of the content a particular Contributor introduces
      a lot of/almost no bugs to.
Description:
      When trying to decide whether to ask a specific Contributor to 
work on part of the content it might be useful to not only know how 
active they work on that part of the content, but also if they 
introduced a lot of bugs to that part, or perhaps fixed many. Similar 
to the more general case, this can be split out between modifying 
content and 'accepting' modifications. This information may be used to 
decide to ask a Contributor to spend more time on a specific part of 
the content before sending in a commit for review.

Name: Finding how many bugs were introduced/fixed in a period of time
Description:
      As bugs are recognized by their fixes, it is always possible to 
match a bug to it's fix. Both commits have a time stamp and with those 
the time between bug and fix can be calculated. Aggregating this data 
over all known bug(fixes) the amount of unfixed bugs may be found over 
a specified period of time. For example, finding the amount of fixed 
bugs between two releases, or how many bugs were not fixed within one 
release cycle. This number might then be calculated over several time
frames (say, each release), after which it is possible to track 
'content quality' throughout releases. If this information is then 
graphed one can find extremes in this figure (for example, a release 
cycle in which a lot of bugs were fixed, or one that introduced many). 
Knowing this the Contributors may then determine the cause of such and 
learn from that.

Name: Finding how much work a contributor has done over a period of 
      time.
Description:
      When working in a team in which everybody is expected to do 
approximately the same amount of work it is interesting to see how 
much work each Contributor actually does. This allows the team to 
discuss any extremes and attempt to handle these as to distribute the 
work more evenly. 
      When work is being done by a large group of people it is 
interesting to know the most active Contributors since these usually 
are the ones with most knowledge on the content. The other way around, 
it is possible to determine if a specific Contributor is 'active 
enough' for a specific task (such as mentoring).

Name: Finding whether a Contributor is mostly a Developer or a
      Bug-fixer.
Description:
      To all Contributors it is interesting to know if they spend most
of their time fixing bugs, or contributing enhancements to the content.
This information could also be queried over a specific time frame, for
example 'weekends vs. workdays' or 'holidays vs. non-holidays'.