16 |
|
def makeSummary(self): |
17 |
|
contents=self.contents |
18 |
|
writeflag = False |
19 |
+ |
cycleflag = False |
20 |
+ |
typeCycle = re.compile('^(Cycle \w*)') |
21 |
+ |
if len(contents)==0 : |
22 |
+ |
self.page.write(' * No data about summary\n') |
23 |
|
for line in contents : |
24 |
< |
print line |
21 |
< |
print |
24 |
> |
matchCycle = typeCycle.search(line) |
25 |
|
if line=='# Summary\n' : |
26 |
+ |
self.page.write(' * Summary\n') |
27 |
|
writeflag = True |
28 |
< |
continue |
25 |
< |
if line=='# Levels\n' : |
28 |
> |
elif line=='# Levels\n' : |
29 |
|
writeflag = False |
30 |
< |
return |
31 |
< |
if line=='\n' : |
30 |
> |
cycleflag = False |
31 |
> |
self.page.write('</div>\n') |
32 |
> |
self.page.write('''<br><pre> |
33 |
> |
* CCD: Cumulative Component Dependency measures the cumulative testing cost |
34 |
> |
across the system. |
35 |
> |
* ACD: Average Component Dependency indicates the number of other packages |
36 |
> |
an average package depends on. |
37 |
> |
* NCCD: Normalised Cumulative Component Dependency measures how the structure |
38 |
> |
differs from a balanced binary tree of comparable size. If NCCD is one, |
39 |
> |
the structure resembles a binary tree; if much less than one, the |
40 |
> |
packages are mostly independent; if much greater than one, the system |
41 |
> |
is fairly strongly coupled. The only universal NCCD target is to |
42 |
> |
minimise for any given software system--a high value indicates a |
43 |
> |
strongly coupled system and less coupling is better. |
44 |
> |
</pre> |
45 |
> |
''') |
46 |
> |
break |
47 |
> |
elif line=='\n' : |
48 |
|
continue |
49 |
< |
if writeflag : |
49 |
> |
elif line[0:5] =='* CCD' : |
50 |
> |
writeflag = False |
51 |
> |
elif line=='# Cycles\n' : |
52 |
> |
self.page.write(' * Cycles\n\n') |
53 |
> |
self.page.write('<div id="test">\n') |
54 |
> |
cycleflag=True |
55 |
> |
elif matchCycle and cycleflag : |
56 |
> |
self.page.write(' * '+matchCycle.group(1)+'\n') |
57 |
> |
elif cycleflag : |
58 |
> |
self.page.write(' * !'+line.strip()+'\n') |
59 |
> |
elif writeflag : |
60 |
|
self.page.write(' * '+line) |
61 |
+ |
else : |
62 |
+ |
continue |
63 |
|
|
64 |
|
|
65 |
|
def packlist(self): |
69 |
|
writeflag = False |
70 |
|
valueflag = False |
71 |
|
if len(contents)==0 : |
72 |
< |
self.page.write('---+++++No data about metrics information.\n') |
72 |
> |
self.page.write(' * No data about metrics information.\n') |
73 |
|
return pack |
74 |
|
for line in contents : |
75 |
|
if line =='# Levels\n' : |
76 |
|
writeflag = True |
46 |
– |
print line |
77 |
|
continue |
78 |
|
elif not writeflag : |
79 |
|
continue |
92 |
|
continue |
93 |
|
else : |
94 |
|
temp =line.strip() |
65 |
– |
print temp |
95 |
|
pack[j].append(temp) |
96 |
|
return pack |
97 |
|
# repack return list [[levels], [level1, [PACKEGE1,module1,module2,...], [PACKEGE2,module1,module2], ..],[level2,[],[],...] ...] |
98 |
|
def repack(self,pack): |
70 |
– |
#print pack |
99 |
|
listlen = len(pack) |
100 |
|
pack2 = [['Levels']] |
101 |
|
countpack = 0 |
113 |
|
temp.append(title) |
114 |
|
packname.append(temp) |
115 |
|
packname[check].append(module) |
88 |
– |
#print packname[0] |
116 |
|
else: |
117 |
|
if packname[check][0]==title: |
91 |
– |
#print 'it\'s work!' |
118 |
|
packname[check].append(module) |
119 |
|
else: |
120 |
|
check = check + 1 |