cuke_sniffer 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/cuke_sniffer +6 -1
- data/lib/cuke_sniffer/cli.rb +35 -14
- data/lib/cuke_sniffer/cuke_sniffer_helper.rb +165 -164
- data/lib/cuke_sniffer/formatter.rb +2 -19
- data/lib/cuke_sniffer/report/css.html.erb +133 -0
- data/lib/cuke_sniffer/report/dead_steps.html.erb +62 -35
- data/lib/cuke_sniffer/report/features.html.erb +104 -50
- data/lib/cuke_sniffer/report/hooks.html.erb +78 -48
- data/lib/cuke_sniffer/report/improvement_list.html.erb +12 -6
- data/lib/cuke_sniffer/report/js.html.erb +65 -0
- data/lib/cuke_sniffer/report/min_template.html.erb +16 -125
- data/lib/cuke_sniffer/report/rules.html.erb +75 -8
- data/lib/cuke_sniffer/report/standard_template.html.erb +14 -127
- data/lib/cuke_sniffer/report/step_definitions.html.erb +68 -49
- data/lib/cuke_sniffer/report/summary.html.erb +40 -15
- data/lib/cuke_sniffer/report/title.html.erb +9 -0
- data/lib/cuke_sniffer/rule_config.rb +508 -483
- metadata +5 -3
- data/lib/cuke_sniffer/report/sub_rules.html.erb +0 -24
@@ -32,8 +32,8 @@ module CukeSniffer
|
|
32
32
|
# Formats the section data for a summary object
|
33
33
|
def self.console_summary(name, summary)
|
34
34
|
" #{name}\n" +
|
35
|
-
" Min: #{summary[:min]}
|
36
|
-
" Max: #{summary[:max]}
|
35
|
+
" Min: #{summary[:min]}\n" +
|
36
|
+
" Max: #{summary[:max]}\n" +
|
37
37
|
" Average: #{summary[:average]}\n"
|
38
38
|
end
|
39
39
|
|
@@ -84,16 +84,9 @@ module CukeSniffer
|
|
84
84
|
|
85
85
|
# Returns the Rules erb page that utilizes sub page sections of enabled and disabled rules
|
86
86
|
def self.rules_template(cuke_sniffer)
|
87
|
-
enabled_rules = sub_rules_template(cuke_sniffer, true, "Enabled Rules")
|
88
|
-
disabled_rules = sub_rules_template(cuke_sniffer, false, "Disabled Rules")
|
89
87
|
ERB.new(extract_markup("rules.html.erb")).result(binding)
|
90
88
|
end
|
91
89
|
|
92
|
-
# Returns the sub rules erb page for enabled status of a rule
|
93
|
-
def self.sub_rules_template(cuke_sniffer, state, heading)
|
94
|
-
ERB.new(extract_markup("sub_rules.html.erb")).result(binding)
|
95
|
-
end
|
96
|
-
|
97
90
|
# Creates a xml file with the collected project details
|
98
91
|
# file_name defaults to "cuke_sniffer.xml" unless specified
|
99
92
|
# cuke_sniffer.output_xml
|
@@ -109,16 +102,6 @@ module CukeSniffer
|
|
109
102
|
end
|
110
103
|
end
|
111
104
|
|
112
|
-
# Formats a list of rule conditions into a compact string of 5 or less elements per row.
|
113
|
-
def self.convert_array_condition_into_list_of_strings(condition_list)
|
114
|
-
result = []
|
115
|
-
while condition_list.size > 0
|
116
|
-
five_words = condition_list.slice!(0, 5)
|
117
|
-
result << five_words.join(", ")
|
118
|
-
end
|
119
|
-
result
|
120
|
-
end
|
121
|
-
|
122
105
|
# Sorts all of the lists on a cuke_sniffer object to be in descending order for each objects score.
|
123
106
|
def self.sort_cuke_sniffer_lists(cuke_sniffer)
|
124
107
|
cuke_sniffer.features = cuke_sniffer.features.sort_by { |feature| feature.total_score }.reverse
|
@@ -0,0 +1,133 @@
|
|
1
|
+
<link rel="stylesheet" type="text/css">
|
2
|
+
|
3
|
+
<style>
|
4
|
+
.new_sub_section {
|
5
|
+
border: 2px solid #509f50;
|
6
|
+
padding: 2px;
|
7
|
+
display: none;
|
8
|
+
overflow:auto;
|
9
|
+
}
|
10
|
+
|
11
|
+
.title {
|
12
|
+
padding-left: 1%;
|
13
|
+
width: 25%;
|
14
|
+
background-color: #509f50;
|
15
|
+
color: white;
|
16
|
+
border-top: 0;
|
17
|
+
border-bottom: 0;
|
18
|
+
font-weight: bold;
|
19
|
+
font-size: 21pt;
|
20
|
+
cursor: pointer;
|
21
|
+
font-family: Arial;
|
22
|
+
border-top-left-radius: 15px;
|
23
|
+
border-top-right-radius: 15px;
|
24
|
+
}
|
25
|
+
|
26
|
+
.function_bar {
|
27
|
+
background-color: #509f50;
|
28
|
+
display: none;
|
29
|
+
}
|
30
|
+
|
31
|
+
.help {
|
32
|
+
cursor: hand;
|
33
|
+
}
|
34
|
+
|
35
|
+
.disabled_title_row {
|
36
|
+
background-color:#aca8a5;
|
37
|
+
cursor: hand;
|
38
|
+
padding-left: 2px;
|
39
|
+
}
|
40
|
+
|
41
|
+
.white_title_row {
|
42
|
+
cursor: hand;
|
43
|
+
padding-left: 2px;
|
44
|
+
}
|
45
|
+
|
46
|
+
.blue_title_row {
|
47
|
+
background-color:#ccffff;
|
48
|
+
cursor: hand;
|
49
|
+
padding-left: 2px;
|
50
|
+
}
|
51
|
+
|
52
|
+
.white_row {
|
53
|
+
padding-left: 2px;
|
54
|
+
}
|
55
|
+
|
56
|
+
.blue_row {
|
57
|
+
background-color:#ccffff;
|
58
|
+
padding-left: 2px;
|
59
|
+
}
|
60
|
+
|
61
|
+
.colored_subsection {
|
62
|
+
width:100%;
|
63
|
+
padding-left: 8px;
|
64
|
+
}
|
65
|
+
|
66
|
+
.shrink_section {
|
67
|
+
border: 2px solid #509f50;
|
68
|
+
display: none;
|
69
|
+
}
|
70
|
+
|
71
|
+
.table_top {
|
72
|
+
width: 20%;
|
73
|
+
font-size: 14pt;
|
74
|
+
padding: 0;
|
75
|
+
}
|
76
|
+
|
77
|
+
.divide_row {
|
78
|
+
border-bottom: 1px solid black;
|
79
|
+
}
|
80
|
+
|
81
|
+
.red_number {
|
82
|
+
color: red;
|
83
|
+
font-weight: bold;
|
84
|
+
display: inline;
|
85
|
+
}
|
86
|
+
|
87
|
+
.notes {
|
88
|
+
font-weight: bold;
|
89
|
+
}
|
90
|
+
|
91
|
+
.sub_section {
|
92
|
+
display: none;
|
93
|
+
margin-left: 1%;
|
94
|
+
margin-right: 1%;
|
95
|
+
border-top: 2px solid #509f50;
|
96
|
+
}
|
97
|
+
|
98
|
+
.empty_set_message {
|
99
|
+
font-weight: bold;
|
100
|
+
margin-left: 1%;
|
101
|
+
}
|
102
|
+
|
103
|
+
.rule_notes {
|
104
|
+
margin-left: 1%;
|
105
|
+
border-left: 2px solid #90ee90;
|
106
|
+
border-top: 2px solid #90ee90;
|
107
|
+
display: block;
|
108
|
+
clear: left;
|
109
|
+
padding-bottom: 0%;
|
110
|
+
text-indent: 0%;
|
111
|
+
padding-left: 0.5%;
|
112
|
+
margin-bottom: 0.5%;
|
113
|
+
}
|
114
|
+
|
115
|
+
.rule_style {
|
116
|
+
margin: 0;
|
117
|
+
text_indent: 3%;
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
.rule_heading {
|
122
|
+
font-weight: bold;
|
123
|
+
margin: 0.25%;
|
124
|
+
}
|
125
|
+
|
126
|
+
ol {
|
127
|
+
list-style-type: none;
|
128
|
+
display: block;
|
129
|
+
padding-left: 1%
|
130
|
+
|
131
|
+
}
|
132
|
+
|
133
|
+
</style>
|
@@ -1,36 +1,63 @@
|
|
1
|
-
<div class="title" onclick="toggleById('dead_steps_data', this)">
|
2
|
-
Dead Steps +
|
3
|
-
</div>
|
4
|
-
<div
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
<%
|
11
|
-
|
12
|
-
<%
|
13
|
-
<div class="
|
14
|
-
<%
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
1
|
+
<div class="title" onclick="toggleById('dead_steps_data', this); updateDisplayStatus(document.getElementById('dead_steps_function_bar'));updateDivScroll('dead_steps_data', 'dead_steps_table');">
|
2
|
+
Dead Steps +
|
3
|
+
</div>
|
4
|
+
<div id="dead_steps_function_bar" class="function_bar">
|
5
|
+
<input type="button" class="function_button" value="Collapse All" onclick="collapseAll('dead_step_detail')" />
|
6
|
+
<input type="button" class="function_button" value="Expand All" onclick="expandAllShiftingRows('dead_step_detail')" />
|
7
|
+
</div>
|
8
|
+
<div class="new_sub_section" id="dead_steps_data">
|
9
|
+
<% dead_steps = cuke_sniffer.get_dead_steps %>
|
10
|
+
<% dead_steps.delete(:total) %>
|
11
|
+
<% dead_step_count = dead_steps.values.flatten.count %>
|
12
|
+
<% if !cuke_sniffer.cataloged? %>
|
13
|
+
<div class="notes">Steps were not cataloged.</div>
|
14
|
+
<% elsif dead_step_count == 0 %>
|
15
|
+
<div class="notes">No dead steps found!</div>
|
16
|
+
<% elsif dead_step_count == 1 %>
|
17
|
+
<div class="notes"><%= dead_step_count %> Dead Step found.</div>
|
18
|
+
<% else %>
|
19
|
+
<div class="notes"><%= dead_step_count %> Dead Steps found.</div>
|
20
|
+
<% end %>
|
21
|
+
<% unless dead_steps.empty? or !cuke_sniffer.cataloged? %>
|
22
|
+
<table id="dead_steps_table" style="width:100%; border-top: 2px solid #509f50" border="0" cellspacing="0">
|
23
|
+
<% index = 0 %>
|
24
|
+
<% dead_steps.each_key do |file_name| %>
|
25
|
+
<% if index.odd? %>
|
26
|
+
<tr class="notes blue_title_row" onclick="updateDisplayStatus(document.getElementById('dead_step_file_detail_<%=index%>')); updateDivScroll('dead_steps_data', 'dead_steps_table');">
|
27
|
+
<% else %>
|
28
|
+
<tr class="notes white_title_row" onclick="updateDisplayStatus(document.getElementById('dead_step_file_detail_<%=index%>')); updateDivScroll('dead_steps_data', 'dead_steps_table');">
|
29
|
+
<% end %>
|
30
|
+
<td class="red_number" style="width: 1%"><%= dead_steps[file_name].size %></td>
|
31
|
+
<td id="dead_step_file_<%= index %>">
|
32
|
+
<%= file_name.gsub(cuke_sniffer.step_definitions_location, "") %>
|
33
|
+
</td>
|
34
|
+
<td style="text-align: right; width:5%" valign="top">
|
35
|
+
<a href="file:///<%= file_name.gsub(/:\d+$/, "") %>.rb" title="Note: Links to file on system this report was generated.">
|
36
|
+
(open file)
|
37
|
+
</a>
|
38
|
+
</td>
|
39
|
+
</tr>
|
40
|
+
|
41
|
+
<% if index.odd? %>
|
42
|
+
<tr class="blue_row dead_step_detail" id="dead_step_file_detail_<%= index %>" style="display: none;">
|
43
|
+
<% else %>
|
44
|
+
<tr class="white_row dead_step_detail" id="dead_step_file_detail_<%= index %>" style="display: none;">
|
45
|
+
<% end %>
|
46
|
+
<td colspan="3">
|
47
|
+
<table id="sub_detail_table_<%= index %>" style="width:100%;">
|
48
|
+
<% dead_steps[file_name].each do |regex| %>
|
49
|
+
<tr>
|
50
|
+
<td style="text-indent: 8px;"><%= regex.match(/:(?<regex>.*)/)[:regex] %></td>
|
51
|
+
<td style="text-align: right;">Line: <%= regex.match(/(?<line>\d+):/)[:line] %></td>
|
52
|
+
</tr>
|
53
|
+
<% end %>
|
54
|
+
</table>
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
|
58
|
+
<% index += 1 %>
|
59
|
+
<% end %>
|
60
|
+
</table>
|
61
|
+
<% end %>
|
62
|
+
</div>
|
36
63
|
<br style="clear:both">
|
@@ -1,60 +1,114 @@
|
|
1
|
-
<div class="title" onclick="toggleById('features_data', this)">
|
1
|
+
<div class="title" onclick="toggleById('features_data', this);updateDisplayStatus(document.getElementById('feature_function_bar'));updateDivScroll('features_data', 'features_table');">
|
2
2
|
Features +
|
3
3
|
</div>
|
4
|
-
|
4
|
+
|
5
|
+
<div id="feature_function_bar" class="function_bar">
|
6
|
+
<input type="button" class="function_button" value="Collapse All" onclick="collapseAll('feature_detail')" />
|
7
|
+
<input type="button" class="function_button" value="Expand All" onclick="expandAllShiftingRows('feature_detail')" />
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="new_sub_section" id="features_data">
|
5
11
|
<% if cuke_sniffer.features.count == 0 %>
|
6
12
|
<div class="empty_set_message">There were no Features to sniff in '<%= cuke_sniffer.features_location %>'!</div>
|
7
13
|
<% elsif cuke_sniffer.features.count >= 1 && cuke_sniffer.scenarios.count >=1 && cuke_sniffer.summary[:features][:total_score] ==0 && cuke_sniffer.summary[:scenarios][:total_score] ==0 %>
|
8
14
|
<div class="empty_set_message">Excellent! No smells found for Features and Scenarios!</div>
|
9
15
|
<% end %>
|
10
|
-
<% index = 0 %>
|
11
|
-
<% cuke_sniffer.features.each do |feature| %>
|
12
|
-
<% next if feature.total_score <= 0 %>
|
13
|
-
<div style="cursor: pointer; padding-top: 3px" onclick="updateDisplayStatus(document.getElementById('feature_<%=index%>'))">
|
14
|
-
<div class="red_number" style="float:left"><%= feature.total_score + feature.scenarios_score %></div>
|
15
|
-
<div class="notes"><%= feature.name %></div>
|
16
|
-
</div>
|
17
|
-
<div id="feature_<%= index %>" class="sub_section">
|
18
|
-
<div style="text-indent: 4%; float: left; width: 45%; border-right: 2px solid #add8e6; padding-bottom: 4px">
|
19
|
-
<% if feature.rules_hash.empty? %>
|
20
|
-
<pre style="margin: 0;"> </pre>
|
21
|
-
<% end %>
|
22
|
-
<% feature.rules_hash.each_key do |rule| %>
|
23
|
-
<pre style="margin: 0;"><%= rule %></pre>
|
24
|
-
<% end %>
|
25
|
-
</div>
|
26
|
-
<div style="text-indent: 1%; padding-bottom: 4px">
|
27
|
-
<%= feature.location.gsub(cuke_sniffer.features_location, "") %>
|
28
|
-
</div>
|
29
|
-
<br style="clear:both">
|
30
16
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
17
|
+
<table id="features_table" border="0" cellspacing="0" style="width:100%;padding-left: 2px">
|
18
|
+
<% index = 0 %>
|
19
|
+
<% cuke_sniffer.features.each do |feature| %>
|
20
|
+
<% next if feature.total_score == 0 %>
|
21
|
+
<% if index.odd? %>
|
22
|
+
<tr class="notes blue_title_row" style="cursor: hand;" onclick="updateDisplayStatus(document.getElementById('feature_detail_<%=index%>'));updateDivScroll('features_data', 'features_table');">
|
23
|
+
<% else %>
|
24
|
+
<tr class="notes white_title_row" style="cursor: hand;" onclick="updateDisplayStatus(document.getElementById('feature_detail_<%=index%>'));updateDivScroll('features_data', 'features_table');">
|
25
|
+
<% end %>
|
26
|
+
<td valign="top" class="red_number" style="width:1%">
|
27
|
+
<%= feature.total_score %>
|
28
|
+
</td>
|
29
|
+
<td style="padding-left: 2px; width:100%;">
|
30
|
+
<% if feature.name.to_s.empty? %>
|
31
|
+
No Feature Description
|
32
|
+
<% else %>
|
33
|
+
<%= feature.name %>
|
34
|
+
<% end %>
|
35
|
+
</td>
|
36
|
+
</tr>
|
37
|
+
<% if index.odd? %>
|
38
|
+
<tr id="feature_detail_<%= index %>" class="blue_row feature_detail" style="display:none;">
|
39
|
+
<% else %>
|
40
|
+
<tr id="feature_detail_<%= index %>" class="white_row feature_detail" style="display:none;">
|
41
|
+
<% end %>
|
42
|
+
|
43
|
+
<td colspan="2">
|
44
|
+
<table border="0" cellspacing="0" class="colored_subsection">
|
45
|
+
<tr>
|
46
|
+
<td>
|
47
|
+
<% SummaryHelper::sort_improvement_list(feature.rules_hash).each do |phrase, count| %>
|
48
|
+
<div>
|
49
|
+
<div style="color:red; display:inline-block;">
|
50
|
+
<%= count %>
|
51
|
+
</div>
|
52
|
+
<div style="display:inline-block;">
|
53
|
+
<%= phrase %>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
<% end %>
|
57
|
+
</td>
|
58
|
+
<td style="text-align: right;">
|
59
|
+
<a href="file:///<%= feature.location.gsub(/:\d+$/, "") %>" title="Note: Links to file on system this report was generated.">
|
60
|
+
<%= feature.location.gsub(cuke_sniffer.features_location, '') %>
|
61
|
+
</a>
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
<% unless feature.background.nil? %>
|
65
|
+
<tr>
|
66
|
+
<td valign="top" style="border-top: 2px solid #509f50">
|
67
|
+
<div style="display:inline;" class="red_number"><%= feature.background.score %></div>
|
68
|
+
<div style="display:inline; padding-left: 2px; width:100%;"><%= feature.background.type %>
|
69
|
+
: <%= feature.background.name %></div>
|
70
|
+
</td>
|
71
|
+
<td valign="top" style="padding-left:2px;border-top: 2px solid #509f50;">
|
72
|
+
<% SummaryHelper::sort_improvement_list(feature.background.rules_hash).each do |phrase, count| %>
|
73
|
+
<div>
|
74
|
+
<div style="color:red; display:inline-block;">
|
75
|
+
<%= count %>
|
76
|
+
</div>
|
77
|
+
<div style="display:inline-block; padding-left:2px;">
|
78
|
+
<%= phrase %>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
<% end %>
|
82
|
+
</td>
|
83
|
+
</tr>
|
84
|
+
<% end %>
|
85
|
+
<% feature.scenarios.each do |scenario| %>
|
86
|
+
<% next if scenario.score == 0 %>
|
87
|
+
<tr>
|
88
|
+
<td valign="top" style="border-top: 2px solid #509f50">
|
89
|
+
<div style="display:inline;" class="red_number"><%= scenario.score %></div>
|
90
|
+
<div style="display:inline; padding-left: 2px; width:100%;"><%= scenario.type %>
|
91
|
+
: <%= scenario.name %></div>
|
92
|
+
</td>
|
93
|
+
<td valign="top" style="padding-left:2px;border-top: 2px solid #509f50">
|
94
|
+
<% SummaryHelper::sort_improvement_list(scenario.rules_hash).each do |phrase, count| %>
|
95
|
+
<div>
|
96
|
+
<div style="color:red; display:inline-block;">
|
97
|
+
<%= count %>
|
98
|
+
</div>
|
99
|
+
<div style="display:inline-block;">
|
100
|
+
<%= phrase %>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
<% end %>
|
104
|
+
</td>
|
105
|
+
</tr>
|
106
|
+
<% end %>
|
107
|
+
</table>
|
108
|
+
</td>
|
109
|
+
</tr>
|
110
|
+
<% index += 1 %>
|
111
|
+
<% end %>
|
112
|
+
</table>
|
59
113
|
</div>
|
60
114
|
<br style="clear:both">
|
@@ -1,49 +1,79 @@
|
|
1
|
-
<div class="title" onclick="toggleById('hooks_data', this)">
|
2
|
-
Hooks +
|
3
|
-
</div>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<% cuke_sniffer.hooks.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<%
|
20
|
-
<%
|
21
|
-
|
22
|
-
<%
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
<% hook.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
</
|
1
|
+
<div class="title" onclick="toggleById('hooks_data', this);updateDisplayStatus(document.getElementById('hooks_function_bar'));updateDivScroll('hooks_data', 'hooks_table');">
|
2
|
+
Hooks +
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div id="hooks_function_bar" class="function_bar">
|
6
|
+
<input type="button" class="function_button" value="Collapse All" onclick="collapseAll('hook_detail')" />
|
7
|
+
<input type="button" class="function_button" value="Expand All" onclick="expandAllShiftingRows('hook_detail')" />
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="new_sub_section" id="hooks_data">
|
11
|
+
<% if cuke_sniffer.hooks.count == 0 %>
|
12
|
+
<div class="empty_set_message">There were no Hooks to sniff in '<%= cuke_sniffer.hooks_location %>'!</div>
|
13
|
+
<% elsif cuke_sniffer.hooks.count >= 1 && cuke_sniffer.summary[:hooks][:total_score] ==0 %>
|
14
|
+
<div class="empty_set_message">Excellent! No smells found for Hooks!</div>
|
15
|
+
<% end %>
|
16
|
+
<table id="hooks_table" style="width:100%;" border="0" cellspacing="0">
|
17
|
+
<% index = 0 %>
|
18
|
+
<% cuke_sniffer.hooks.each do |hook| %>
|
19
|
+
<% next if hook.score <= 0 %>
|
20
|
+
<% if index.odd? %>
|
21
|
+
<tr class="notes blue_title_row" onclick="updateDisplayStatus(document.getElementById('hook_detail_<%=index%>'));updateDivScroll('hooks_data', 'hooks_table');">
|
22
|
+
<% else %>
|
23
|
+
<tr class="notes white_title_row" onclick="updateDisplayStatus(document.getElementById('hook_detail_<%=index%>'));updateDivScroll('hooks_data', 'hooks_table');">
|
24
|
+
<% end %>
|
25
|
+
<td id="hook_score_<%= index %>" valign="top" style="width:1%; color: red">
|
26
|
+
<%= hook.score %>
|
27
|
+
</td>
|
28
|
+
<td id="hook_name_<%= index %>" style="text-indent: 2px;">
|
29
|
+
<% tags = "(" %>
|
30
|
+
<% hook.tags.each do |tag| %>
|
31
|
+
<% tags << tag %>
|
32
|
+
<% tags << ", " unless tag == hook.tags.last %>
|
33
|
+
<% end %>
|
34
|
+
<% tags += ")" %>
|
35
|
+
<% parameters = "| " %>
|
36
|
+
<% hook.parameters.each do |parameter| %>
|
37
|
+
<% parameters << parameter %>
|
38
|
+
<% parameters << ", " unless parameter == hook.parameters.last %>
|
39
|
+
<% end %>
|
40
|
+
<% parameters += " |" %>
|
41
|
+
<% name = hook.type %>
|
42
|
+
<% name += tags unless tags == "()" %>
|
43
|
+
<% name += " do " %>
|
44
|
+
<% name += parameters unless parameters == "| |" %>
|
45
|
+
<%= name %>
|
46
|
+
</td>
|
47
|
+
</td>
|
48
|
+
</tr>
|
49
|
+
|
50
|
+
<% if index.odd? %>
|
51
|
+
<tr id="hook_detail_<%= index %>" class="blue_row hook_detail" style="display: none;">
|
52
|
+
<% else %>
|
53
|
+
<tr id="hook_detail_<%= index %>" class="white_row hook_detail" style="display: none;">
|
54
|
+
<% end %>
|
55
|
+
|
56
|
+
<td colspan="2">
|
57
|
+
<% SummaryHelper::sort_improvement_list(hook.rules_hash).each do |phrase, count| %>
|
58
|
+
<div style="text-indent: 10px;">
|
59
|
+
<div style="color:red; display:inline-block;">
|
60
|
+
<%= count %>
|
61
|
+
</div>
|
62
|
+
<div style="display:inline-block;">
|
63
|
+
<%= phrase %>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
<% end %>
|
67
|
+
</td>
|
68
|
+
<td valign="top" style="text-align: right">
|
69
|
+
<a href="file:///<%= hook.location.gsub(/:\d+$/, "") %>" title="Note: Links to file on system this report was generated.">
|
70
|
+
<%= hook.location.gsub(cuke_sniffer.hooks_location, '') %>
|
71
|
+
</a>
|
72
|
+
</td>
|
73
|
+
</tr>
|
74
|
+
|
75
|
+
<% index += 1 %>
|
76
|
+
<% end %>
|
77
|
+
</table>
|
78
|
+
</div>
|
49
79
|
<br style="clear:both">
|