martignoni / codeswarm

Automatically exported from code.google.com/p/codeswarm
GNU General Public License v3.0
1 stars 0 forks source link

Adding Weight information in Event object... for enabling other type of weight computation and enabling the output of this attribute #57

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Please attach your config file to help us reproduce the problem.

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Adding Weight information in Event object will be interesting for enabling
other type of weight computation and enabling the output of this attribute.
The weight may be computed based on the lines changed or commit number or
other information.
I added the functionality to enable the use of lines changed as:

    weight = "100" 

    def __init__(self, filename, date, author, weight):
        self.filename = filename
        self.date = date
        self.author = author
        self.weight = weight

and in the CVS part: (the computation for weight as example: 5* added lines
+ number of removed lines) if the lines is present else 1.

                        if (len(rev_parts)>3 and
rev_parts[3].find("lines:") == 0):
                            lines = rev_parts[3].split(';');
                            #print "rev_parts[3]=%s" % (rev_parts[3])
                            lines = lines[0].split(' ');
                            #print "lines[1]=%s, lines[2]=%s" % (lines[1],
lines[2])
                            weight = 5*int(lines[1])-int(lines[2])
                            if (weight != 0):
                                #print "weight=%s" % (weight)
                                event_list.append(Event(filename, date, author,
weight))
                        else:
                            event_list.append(Event(filename, date, author, "1"))

Original issue reported on code.google.com by bodh...@gmail.com on 16 Apr 2009 at 8:59