Sfoglia il codice sorgente

Measure the number of lines for each file in --couples

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
Vadim Markovtsev 6 anni fa
parent
commit
e77579a41a

+ 91 - 81
internal/pb/pb.pb.go

@@ -344,6 +344,8 @@ type CouplesAnalysisResults struct {
 	PeopleCouples *Couples `protobuf:"bytes,7,opt,name=people_couples,json=peopleCouples" json:"people_couples,omitempty"`
 	// order corresponds to `people_couples::index`
 	PeopleFiles []*TouchedFiles `protobuf:"bytes,8,rep,name=people_files,json=peopleFiles" json:"people_files,omitempty"`
+	// order corresponds to `files_couples::index`
+	FilesLines []int32 `protobuf:"varint,9,rep,packed,name=files_lines,json=filesLines" json:"files_lines,omitempty"`
 }
 
 func (m *CouplesAnalysisResults) Reset()                    { *m = CouplesAnalysisResults{} }
@@ -372,6 +374,13 @@ func (m *CouplesAnalysisResults) GetPeopleFiles() []*TouchedFiles {
 	return nil
 }
 
+func (m *CouplesAnalysisResults) GetFilesLines() []int32 {
+	if m != nil {
+		return m.FilesLines
+	}
+	return nil
+}
+
 type UASTChange struct {
 	FileName   string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
 	SrcBefore  string `protobuf:"bytes,2,opt,name=src_before,json=srcBefore,proto3" json:"src_before,omitempty"`
@@ -728,85 +737,86 @@ func init() {
 func init() { proto.RegisterFile("pb.proto", fileDescriptorPb) }
 
 var fileDescriptorPb = []byte{
-	// 1272 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x5d, 0x6f, 0x1b, 0x45,
-	0x17, 0xd6, 0xfa, 0xdb, 0x67, 0xf3, 0xd1, 0x4e, 0xfb, 0x36, 0xae, 0x5f, 0xa5, 0x98, 0x55, 0x29,
-	0x81, 0x96, 0x2d, 0x72, 0xb9, 0x80, 0x72, 0xd3, 0x34, 0xa1, 0x6a, 0xa4, 0x06, 0xd0, 0xb8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 0xb7, 0x17, 0x93, 0xab, 0x5b, 0xa7, 0x16, 0x69, 0x58, 0x98, 0x7a, 0xf2, 0x55,
-	0xc1, 0x29, 0xd3, 0x85, 0xd6, 0x0c, 0x9c, 0x5d, 0xed, 0x8d, 0xe6, 0xfa, 0xc5, 0xf9, 0xc3, 0x83,
-	0xbd, 0x23, 0x03, 0x2b, 0x37, 0x70, 0x42, 0x7c, 0x03, 0x37, 0x84, 0xf3, 0x4d, 0xcf, 0x8a, 0x69,
-	0x44, 0x0a, 0x2b, 0xca, 0xa3, 0xf0, 0x9a, 0x9c, 0xb0, 0x74, 0x3c, 0x2f, 0x8e, 0x49, 0x61, 0x7f,
-	0xff, 0x89, 0x35, 0xe7, 0xf0, 0x14, 0x6e, 0xd5, 0xc0, 0x6a, 0x94, 0xf9, 0x47, 0xf3, 0xac, 0xb6,
-	0xab, 0x68, 0xf3, 0xab, 0x07, 0xbb, 0x9b, 0x35, 0x7c, 0x17, 0x3a, 0x73, 0x4a, 0x22, 0xca, 0xf5,
-	0x72, 0xfe, 0xb8, 0x5f, 0xfe, 0x42, 0xc5, 0x36, 0x80, 0x9e, 0x2a, 0xbd, 0x98, 0x2c, 0xf5, 0x52,
-	0xa5, 0xde, 0x2c, 0xf3, 0x91, 0x05, 0x94, 0xa3, 0xd1, 0x98, 0x66, 0x34, 0x56, 0x42, 0xff, 0xf6,
-	0xdb, 0x75, 0xab, 0xc2, 0xf7, 0xac, 0xa3, 0xff, 0x2b, 0x3c, 0xf9, 0x3b, 0x00, 0x00, 0xff, 0xff,
-	0x7c, 0xd1, 0x8f, 0x8d, 0x37, 0x0c, 0x00, 0x00,
+	// 1289 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x57, 0x4d, 0x73, 0xdc, 0x44,
+	0x13, 0x2e, 0xed, 0xf7, 0xf6, 0xfa, 0x23, 0x99, 0xe4, 0x8d, 0x95, 0x7d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x00, 0x00,
 }

+ 2 - 0
internal/pb/pb.proto

@@ -73,6 +73,8 @@ message CouplesAnalysisResults {
     Couples people_couples = 7;
     // order corresponds to `people_couples::index`
     repeated TouchedFiles people_files = 8;
+    // order corresponds to `files_couples::index`
+    repeated int32 files_lines = 9;
 }
 
 message UASTChange {

File diff suppressed because it is too large
+ 50 - 43
internal/pb/pb_pb2.py


+ 1 - 0
internal/plumbing/identity/identity.go

@@ -266,6 +266,7 @@ func (detector *Detector) GeneratePeopleDict(commits []*object.Commit) {
 }
 
 // MergeReversedDicts joins two identity lists together, excluding duplicates, in-order.
+// The returned mapping's values are: final index, index in first, index in second (-1 for a miss).
 func (detector Detector) MergeReversedDicts(rd1, rd2 []string) (map[string][3]int, []string) {
 	people := map[string][3]int{}
 	for i, pid := range rd1 {

BIN
internal/test_data/couples.pb


+ 49 - 3
leaves/couples.go

@@ -3,6 +3,7 @@ package leaves
 import (
 	"fmt"
 	"io"
+	"log"
 	"sort"
 
 	"github.com/gogo/protobuf/proto"
@@ -42,10 +43,19 @@ type CouplesAnalysis struct {
 // CouplesResult is returned by CouplesAnalysis.Finalize() and carries couples matrices from
 // authors and files.
 type CouplesResult struct {
+	// PeopleMatrix is how many times developers changed files which were also changed by other developers.
+	// The mapping's key is the other developer, and the value is the sum over all the files both developers changed.
+	// Each element of that sum is min(C1, C2) where Ci is the number of commits developer i made which touched the file.
 	PeopleMatrix []map[int]int64
-	PeopleFiles  [][]int
-	FilesMatrix  []map[int]int64
-	Files        []string
+	// PeopleFiles is how many times developers changed files. The first dimension (left []) is developers,
+	// and the second dimension (right []) is file indexes.
+	PeopleFiles [][]int
+	// FilesMatrix is how many times file pairs occurred in the same commit.
+	FilesMatrix []map[int]int64
+	// FilesLines is the number of lines contained in each file from the last analyzed commit.
+	FilesLines []int
+	// Files is the names of the files. The order matches PeopleFiles' indexes and FilesMatrix.
+	Files []string
 
 	// reversedPeopleDict references IdentityDetector.ReversedPeopleDict
 	reversedPeopleDict []string
@@ -198,6 +208,21 @@ func (couples *CouplesAnalysis) Finalize() interface{} {
 	for i, file := range filesSequence {
 		filesIndex[file] = i
 	}
+	filesLines := make([]int, len(filesSequence))
+	for i, name := range filesSequence {
+		file, err := couples.lastCommit.File(name)
+		if err != nil {
+			log.Panicf("cannot find file %s in commit %s: %v",
+				name, couples.lastCommit.Hash.String(), err)
+		}
+		blob := items.CachedBlob{Blob: file.Blob}
+		err = blob.Cache()
+		if err != nil {
+			log.Panicf("cannot read blob %s of file %s: %v",
+				blob.Hash.String(), name, err)
+		}
+		filesLines[i], _ = blob.CountLines()
+	}
 
 	peopleMatrix := make([]map[int]int64, couples.PeopleNumber+1)
 	peopleFiles := make([][]int, couples.PeopleNumber+1)
@@ -232,6 +257,7 @@ func (couples *CouplesAnalysis) Finalize() interface{} {
 		PeopleMatrix:       peopleMatrix,
 		PeopleFiles:        peopleFiles,
 		Files:              filesSequence,
+		FilesLines:         filesLines,
 		FilesMatrix:        filesMatrix,
 		reversedPeopleDict: couples.reversedPeopleDict,
 	}
@@ -262,12 +288,14 @@ func (couples *CouplesAnalysis) Deserialize(pbmessage []byte) (interface{}, erro
 	}
 	result := CouplesResult{
 		Files:              message.FileCouples.Index,
+		FilesLines:         make([]int, len(message.FileCouples.Index)),
 		FilesMatrix:        make([]map[int]int64, message.FileCouples.Matrix.NumberOfRows),
 		PeopleFiles:        make([][]int, len(message.PeopleCouples.Index)),
 		PeopleMatrix:       make([]map[int]int64, message.PeopleCouples.Matrix.NumberOfRows),
 		reversedPeopleDict: message.PeopleCouples.Index,
 	}
 	for i, files := range message.PeopleFiles {
+		result.FilesLines[i] = int(message.FilesLines[i])
 		result.PeopleFiles[i] = make([]int, len(files.Files))
 		for j, val := range files.Files {
 			result.PeopleFiles[i][j] = int(val)
@@ -298,6 +326,16 @@ func (couples *CouplesAnalysis) MergeResults(r1, r2 interface{}, c1, c2 *core.Co
 	people, merged.reversedPeopleDict = identity.Detector{}.MergeReversedDicts(
 		cr1.reversedPeopleDict, cr2.reversedPeopleDict)
 	files, merged.Files = identity.Detector{}.MergeReversedDicts(cr1.Files, cr2.Files)
+	merged.FilesLines = make([]int, len(merged.Files))
+	for i, name := range merged.Files {
+		idxs := files[name]
+		if idxs[1] >= 0 {
+			merged.FilesLines[i] += cr1.FilesLines[idxs[1]]
+		}
+		if idxs[2] >= 0 {
+			merged.FilesLines[i] += cr2.FilesLines[idxs[2]]
+		}
+	}
 	merged.PeopleFiles = make([][]int, len(merged.reversedPeopleDict))
 	peopleFilesDicts := make([]map[int]bool, len(merged.reversedPeopleDict))
 	addPeopleFiles := func(peopleFiles [][]int, reversedPeopleDict []string,
@@ -372,6 +410,10 @@ func (couples *CouplesAnalysis) serializeText(result *CouplesResult, writer io.W
 	for _, file := range result.Files {
 		fmt.Fprintf(writer, "      - %s\n", yaml.SafeString(file))
 	}
+	fmt.Fprintln(writer, "    lines:")
+	for _, l := range result.FilesLines {
+		fmt.Fprintf(writer, "      - %d\n", l)
+	}
 
 	fmt.Fprintln(writer, "    matrix:")
 	for _, files := range result.FilesMatrix {
@@ -479,6 +521,10 @@ func (couples *CouplesAnalysis) serializeBinary(result *CouplesResult, writer io
 			Files: int32Files,
 		}
 	}
+	message.FilesLines = make([]int32, len(result.FilesLines))
+	for i, l := range result.FilesLines {
+		message.FilesLines[i] = int32(l)
+	}
 
 	serialized, err := proto.Marshal(&message)
 	if err != nil {

+ 20 - 5
leaves/couples_test.go

@@ -155,6 +155,10 @@ func TestCouplesConsumeFinalize(t *testing.T) {
 	assert.Equal(t, cr.Files[0], "README.md")
 	assert.Equal(t, cr.Files[1], "analyser.go")
 	assert.Equal(t, cr.Files[2], "file_test.go")
+	assert.Equal(t, len(cr.FilesLines), 3)
+	assert.Equal(t, cr.FilesLines[0], 15)
+	assert.Equal(t, cr.FilesLines[1], 252)
+	assert.Equal(t, cr.FilesLines[2], 238)
 	assert.Equal(t, len(cr.PeopleFiles[0]), 3)
 	assert.Equal(t, cr.PeopleFiles[0][0], 0)
 	assert.Equal(t, cr.PeopleFiles[0][1], 1)
@@ -288,6 +292,10 @@ func TestCouplesConsumeFinalizeAuthorMissing(t *testing.T) {
 	assert.Equal(t, cr.Files[0], "README.md")
 	assert.Equal(t, cr.Files[1], "analyser.go")
 	assert.Equal(t, cr.Files[2], "file_test.go")
+	assert.Equal(t, len(cr.FilesLines), 3)
+	assert.Equal(t, cr.FilesLines[0], 15)
+	assert.Equal(t, cr.FilesLines[1], 252)
+	assert.Equal(t, cr.FilesLines[2], 238)
 	assert.Equal(t, len(cr.PeopleFiles[0]), 3)
 	assert.Equal(t, cr.PeopleFiles[0][0], 0)
 	assert.Equal(t, cr.PeopleFiles[0][1], 1)
@@ -363,6 +371,7 @@ func TestCouplesSerialize(t *testing.T) {
 			{1: 1, 2: 1, 0: 3}, {1: 2, 2: 2, 0: 1}, {2: 2, 0: 1, 1: 2},
 		},
 		Files:              []string{"five", "one", "three"},
+		FilesLines:         []int{9, 8, 7},
 		reversedPeopleDict: []string{"p1", "p2", "p3"},
 	}
 	buffer := &bytes.Buffer{}
@@ -372,6 +381,10 @@ func TestCouplesSerialize(t *testing.T) {
       - "five"
       - "one"
       - "three"
+    lines:
+      - 9
+      - 8
+      - 7
     matrix:
       - {0: 3, 1: 1, 2: 1}
       - {0: 1, 1: 2, 2: 2}
@@ -401,6 +414,7 @@ func TestCouplesSerialize(t *testing.T) {
 	assert.Nil(t, c.Serialize(result, true, buffer))
 	msg := pb.CouplesAnalysisResults{}
 	assert.Nil(t, proto.Unmarshal(buffer.Bytes(), &msg))
+	assert.Equal(t, msg.FilesLines, []int32{9, 8, 7})
 	assert.Len(t, msg.PeopleFiles, 3)
 	tmp1 := [...]int32{0, 1, 2}
 	assert.Equal(t, msg.PeopleFiles[0].Files, tmp1[:])
@@ -430,19 +444,17 @@ func TestCouplesSerialize(t *testing.T) {
 }
 
 func TestCouplesDeserialize(t *testing.T) {
-	allBuffer, err := ioutil.ReadFile(path.Join("..", "internal", "test_data", "couples.pb"))
-	assert.Nil(t, err)
-	message := pb.AnalysisResults{}
-	err = proto.Unmarshal(allBuffer, &message)
+	message, err := ioutil.ReadFile(path.Join("..", "internal", "test_data", "couples.pb"))
 	assert.Nil(t, err)
 	couples := CouplesAnalysis{}
-	iresult, err := couples.Deserialize(message.Contents[couples.Name()])
+	iresult, err := couples.Deserialize(message)
 	assert.Nil(t, err)
 	result := iresult.(CouplesResult)
 	assert.Len(t, result.reversedPeopleDict, 2)
 	assert.Len(t, result.PeopleFiles, 2)
 	assert.Len(t, result.PeopleMatrix, 3)
 	assert.Len(t, result.Files, 74)
+	assert.Len(t, result.FilesLines, 74)
 	assert.Len(t, result.FilesMatrix, 74)
 }
 
@@ -454,6 +466,8 @@ func TestCouplesMerge(t *testing.T) {
 	r2.reversedPeopleDict = people2[:]
 	r1.Files = people1[:]
 	r2.Files = people2[:]
+	r1.FilesLines = []int{1, 2}
+	r2.FilesLines = []int{2, 3}
 	r1.PeopleFiles = make([][]int, 2)
 	r1.PeopleFiles[0] = make([]int, 2)
 	r1.PeopleFiles[0][0] = 0
@@ -497,6 +511,7 @@ func TestCouplesMerge(t *testing.T) {
 	mergedPeople := [...]string{"one", "two", "three"}
 	assert.Equal(t, merged.reversedPeopleDict, mergedPeople[:])
 	assert.Equal(t, merged.Files, mergedPeople[:])
+	assert.Equal(t, merged.FilesLines, []int{1, 4, 3})
 	assert.Len(t, merged.PeopleFiles, 3)
 	assert.Equal(t, merged.PeopleFiles[0], getSlice(0, 1))
 	assert.Equal(t, merged.PeopleFiles[1], getSlice(0, 2))