Calculate Lines of Code Metric For SVN Branches

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

問題

The value for the LOC (Lines of Code) metric is zero (0) for an SVN repository even though "Activity" shows current subversion commits.

原因

Fisheye only counts lines of code checked into the trunk.

ソリューション

In order for Fisheye to start counting the branches LOC, the Symbolic Links will need to be customized. This can be done under Administration > Repository Settings > Repositories, click on the repository name SCM Details > SVN Symbolic Rules. The screen has a placeholder for Trunk, for Branches and for Tags. Select "Custom" from the drop-down and click "Add" (the right-most link creates a new row) to have another line for Trunk. Populate it with the pattern of the branch to be included in the LOC metric. De-select the option "Use Built-in Symbolic Rules" before pressing "Save". For more details please refer to the following pages:

The following example shows a set up including a branch. Note that all branches could be included in the LOC count if the "a_branch_to_count_lines/" part is removed:

タイプ 正規表現 名前 Logical Path Prefix
Trunk trunk(/|$) trunk  
Trunk branches/a_branch_to_count_lines/([^/]+) ${1} N/A
ブランチ branches/([^/]+) ${1} N/A
Tags tags/([^/]+) ${1}

N/A

If the trunk and the branch have the exact same code, then the LOC count will be doubled. Separation of trunk LOC and branch LOC can be achieved by keeping two different repositories: one that uses trunk as its official trunk for LOC, and another that ignores trunk and uses the branch definition mapped at the trunk line.

最終更新日 2018 年 11 月 2 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.