cuke_sniffer 0.0.8 → 1.0.0
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.
- checksums.yaml +7 -0
- data/bin/cuke_sniffer +4 -1
- data/lib/cuke_sniffer/cli.rb +15 -4
- data/lib/cuke_sniffer/cuke_sniffer_helper.rb +4 -3
- data/lib/cuke_sniffer/dead_steps_helper.rb +53 -53
- data/lib/cuke_sniffer/formatter.rb +166 -125
- data/lib/cuke_sniffer/js/cuke_sniffer.js +184 -0
- data/lib/cuke_sniffer/report/css.html.erb +122 -132
- data/lib/cuke_sniffer/report/dead_steps.html.erb +61 -61
- data/lib/cuke_sniffer/report/dead_steps_min.html.erb +23 -0
- data/lib/cuke_sniffer/report/expand_and_collapse_buttons.html.erb +8 -0
- data/lib/cuke_sniffer/report/features.html.erb +124 -106
- data/lib/cuke_sniffer/report/hooks.html.erb +76 -76
- data/lib/cuke_sniffer/report/improvement_list.html.erb +34 -24
- data/lib/cuke_sniffer/report/information.html.erb +81 -0
- data/lib/cuke_sniffer/report/js.html.erb +9 -65
- data/lib/cuke_sniffer/report/min_template.html.erb +12 -7
- data/lib/cuke_sniffer/report/rules.html.erb +100 -68
- data/lib/cuke_sniffer/report/standard_template.html.erb +16 -12
- data/lib/cuke_sniffer/report/step_definitions.html.erb +69 -63
- data/lib/cuke_sniffer/report/summary.html.erb +131 -96
- data/lib/cuke_sniffer/report/title.html.erb +13 -9
- data/lib/cuke_sniffer/rule.rb +1 -0
- data/lib/cuke_sniffer/rule_config.rb +2 -2
- data/lib/cuke_sniffer/rules_evaluator.rb +1 -2
- data/lib/cuke_sniffer/scenario.rb +67 -23
- data/lib/cuke_sniffer/summary_helper.rb +90 -90
- metadata +31 -46
- data/lib/cuke_sniffer/report/legend.html.erb +0 -167
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="panel panel-default">
|
3
|
+
<div class="panel-heading panel-title" data-toggle="collapse" data-target="#deadSteps" >
|
4
|
+
Dead Steps <span class="glyphicon glyphicon-menu-down"></span>
|
5
|
+
</div>
|
6
|
+
<div id="deadSteps" class="panel-body collapse">
|
7
|
+
<div>
|
8
|
+
<% dead_steps = cuke_sniffer.get_dead_steps %>
|
9
|
+
<% dead_steps.delete(:total) %>
|
10
|
+
<% dead_step_count = dead_steps.values.flatten.count %>
|
11
|
+
<% if !cuke_sniffer.cataloged? %>
|
12
|
+
<div class="notes">Steps were not cataloged.</div>
|
13
|
+
<% elsif dead_step_count == 0 %>
|
14
|
+
<div class="notes">No dead steps found!</div>
|
15
|
+
<% elsif dead_step_count == 1 %>
|
16
|
+
<div class="notes"><%= dead_step_count %> Dead Step found.</div>
|
17
|
+
<% else %>
|
18
|
+
<div class="notes"><%= dead_step_count %> Dead Steps found.</div>
|
19
|
+
<% end %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -1,114 +1,132 @@
|
|
1
|
-
<div class="
|
2
|
-
|
3
|
-
|
1
|
+
<div class="row">
|
2
|
+
<div class="panel panel-default">
|
3
|
+
<div class="panel-heading panel-title" data-toggle="collapse" data-target="#features" >
|
4
|
+
Features <span class="glyphicon glyphicon-menu-down"></span>
|
5
|
+
</div>
|
6
|
+
<div id="features" class="panel-body collapse">
|
7
|
+
<span class="button-bar">
|
8
|
+
<%= build_page(cuke_sniffer, "expand_and_collapse_buttons.html.erb") %>
|
9
|
+
</span>
|
10
|
+
<% if cuke_sniffer.features.count == 0 %>
|
11
|
+
<div>
|
12
|
+
<div>There were no Features to sniff in '<%= cuke_sniffer.features_location %>'!</div>
|
13
|
+
</div>
|
14
|
+
<% 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 %>
|
15
|
+
<div>
|
16
|
+
<div>Excellent! No smells found for Features and Scenarios!</div>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
<% cuke_sniffer.features.each do |feature| %>
|
20
|
+
<% next if feature.total_score == 0 %>
|
21
|
+
<div class="feature">
|
22
|
+
<div class="row">
|
23
|
+
<div class="col-md-12 title">
|
24
|
+
<div class="col-md-1 red" title="Total Score from this Feature.">
|
25
|
+
<%= feature.total_score %>
|
26
|
+
</div>
|
27
|
+
<div class="col-md-11">
|
28
|
+
<% if feature.name.to_s.empty? %>
|
29
|
+
No Feature Description
|
30
|
+
<% else %>
|
31
|
+
<%= feature.name %>
|
32
|
+
<% end %>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
<div class="details col-md-12" style="display:none;">
|
36
|
+
<div class="well">
|
37
|
+
<div class="row">
|
38
|
+
<div class="col-md-12 filename">
|
39
|
+
File: <a target="_blank" href="file:///<%= feature.location.gsub(/:\d+$/, "") %>" title="Note: Links to file on system this report was generated.">
|
40
|
+
<%= feature.location.gsub(cuke_sniffer.features_location, '') %>
|
41
|
+
</a>
|
42
|
+
</div>
|
43
|
+
</div>
|
4
44
|
|
5
|
-
<div
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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 %>
|
45
|
+
<div class="row featureProblems">
|
46
|
+
<div class="col-md-12">
|
47
|
+
<h4>
|
48
|
+
Feature:
|
49
|
+
<span class="red" title="Points earned from just the feature. This updates based on what rules
|
50
|
+
are active." data-total-feature-score="<%=feature.score %>">
|
51
|
+
<%= feature.score %>
|
52
|
+
</span>
|
53
|
+
</h4>
|
54
|
+
</div>
|
55
|
+
<% SummaryHelper::sort_improvement_list(feature.rules_hash).each do |phrase, count| %>
|
56
|
+
<div data-improvement-row>
|
57
|
+
<div class="col-md-1 red" data-score>
|
58
|
+
<%= count %>
|
59
|
+
</div>
|
60
|
+
<div class="col-md-11" data-improvement="<%=phrase %>">
|
61
|
+
<%= phrase %>
|
62
|
+
</div>
|
51
63
|
</div>
|
52
|
-
|
53
|
-
|
64
|
+
<% end %>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div class="row backgroundProblems">
|
68
|
+
<% unless feature.background.nil? %>
|
69
|
+
<div class="col-md-12">
|
70
|
+
<h4>
|
71
|
+
Background:
|
72
|
+
<span class="red" title="Points earned from just the background. This updates based on what
|
73
|
+
rules are active." data-total-feature-score="<%=feature.background.score %>">
|
74
|
+
<%= feature.background.score %>
|
75
|
+
</span>
|
76
|
+
</h4>
|
54
77
|
</div>
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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 %>
|
78
|
+
<% SummaryHelper::sort_improvement_list(feature.background.rules_hash).each do |phrase, count| %>
|
79
|
+
<div data-improvement-row>
|
80
|
+
<div class="col-md-1 red" data-score>
|
81
|
+
<%= count %>
|
82
|
+
</div>
|
83
|
+
<div class="col-md-11" data-improvement="<%=phrase %>">
|
84
|
+
<%= phrase %>
|
85
|
+
</div>
|
76
86
|
</div>
|
77
|
-
|
78
|
-
|
87
|
+
<% end %>
|
88
|
+
<% end %>
|
89
|
+
</div>
|
90
|
+
<div class="row scenarios">
|
91
|
+
<div class="col-md-12">
|
92
|
+
<h4>Scenarios:
|
93
|
+
<span class="red" title="Total Points earned from all the scenarios in this feature. This updates
|
94
|
+
based on what rules are active." data-total-scenarios-score="<%=feature.scenarios_score%>">
|
95
|
+
<%= feature.scenarios_score %>
|
96
|
+
</span>
|
97
|
+
</h4>
|
98
|
+
</div>
|
99
|
+
<div class="col-md-12 scenarios">
|
100
|
+
<% feature.scenarios.each do |scenario| %>
|
101
|
+
<% next if scenario.score == 0 %>
|
102
|
+
<div class="col-md-12 scenario">
|
103
|
+
<div class="col-md-12 title">
|
104
|
+
<div class="btn btn-xs btn-default" style="display:none;"> <!--TODO enable this feature -->
|
105
|
+
View <span class="glyphicon glyphicon-eye-open"></span>
|
79
106
|
</div>
|
107
|
+
<%= scenario.type %>: <%=scenario.name %>
|
80
108
|
</div>
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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>
|
109
|
+
<div class="col-md-12 details well">
|
110
|
+
<% SummaryHelper::sort_improvement_list(scenario.rules_hash).each do |phrase, count| %>
|
111
|
+
<div class="row" data-improvement-row>
|
112
|
+
<div class="col-md-1 red" data-score>
|
113
|
+
<%= count %>
|
114
|
+
</div>
|
115
|
+
<div class="col-md-11" data-improvement="<%=phrase %>">
|
116
|
+
<%= phrase %>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
<% end %>
|
102
120
|
</div>
|
121
|
+
</div>
|
103
122
|
<% end %>
|
104
|
-
</
|
105
|
-
</
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
</
|
113
|
-
</div>
|
114
|
-
<br style="clear:both">
|
123
|
+
</div>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
<% end %>
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
</div>
|
@@ -1,79 +1,79 @@
|
|
1
|
-
<div class="
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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 %>
|
1
|
+
<div class="row">
|
2
|
+
<div class="panel panel-default">
|
3
|
+
<div class="panel-heading panel-title" data-toggle="collapse" data-target="#hooks" >
|
4
|
+
Hooks <span class="glyphicon glyphicon-menu-down"></span>
|
5
|
+
</div>
|
6
|
+
<div id="hooks" class="panel-body collapse">
|
7
|
+
<span class="button-bar">
|
8
|
+
<%= build_page(cuke_sniffer, "expand_and_collapse_buttons.html.erb") %>
|
9
|
+
</span>
|
10
|
+
<% if cuke_sniffer.hooks.count == 0 %>
|
11
|
+
<div>
|
12
|
+
<div>There were no Hooks to sniff in '<%= cuke_sniffer.hooks_location %>'!</div>
|
13
|
+
</div>
|
14
|
+
<% elsif cuke_sniffer.hooks.count >= 1 && cuke_sniffer.summary[:hooks][:total_score] ==0 %>
|
15
|
+
<div>
|
16
|
+
<div>Excellent! No smells found for Hooks!</div>
|
17
|
+
</div>
|
18
|
+
<% else %>
|
19
|
+
<% cuke_sniffer.hooks.each do |hook| %>
|
20
|
+
<% next if hook.score <= 0 %>
|
21
|
+
<div class="hook">
|
22
|
+
<div class="row">
|
23
|
+
<div class="title col-md-12">
|
24
|
+
<div class="col-md-1">
|
25
|
+
<span class="red" title="Total score for Hook file.">
|
26
|
+
<%= hook.score %>
|
27
|
+
</span>
|
28
|
+
</div>
|
29
|
+
<div class="col-md-11">
|
30
|
+
<% tags = "(" %>
|
31
|
+
<% hook.tags.each do |tag| %>
|
32
|
+
<% tags << tag %>
|
33
|
+
<% tags << ", " unless tag == hook.tags.last %>
|
34
|
+
<% end %>
|
35
|
+
<% tags += ")" %>
|
36
|
+
<% parameters = "| " %>
|
37
|
+
<% hook.parameters.each do |parameter| %>
|
38
|
+
<% parameters << parameter %>
|
39
|
+
<% parameters << ", " unless parameter == hook.parameters.last %>
|
40
|
+
<% end %>
|
41
|
+
<% parameters += " |" %>
|
42
|
+
<% name = hook.type %>
|
43
|
+
<% name += tags unless tags == "()" %>
|
44
|
+
<% name += " do " %>
|
45
|
+
<% name += parameters unless parameters == "| |" %>
|
46
|
+
<%= name %>
|
47
|
+
</div>
|
61
48
|
</div>
|
62
|
-
<div style="display:
|
63
|
-
|
49
|
+
<div class="details col-md-12" style="display:none;">
|
50
|
+
<div class="well">
|
51
|
+
<div class="row">
|
52
|
+
<div class="col-md-12 filename">
|
53
|
+
File:
|
54
|
+
<a target="_blank" href="file:///<%= hook.location.gsub(/:\d+$/, "") %>" title="Note: Links to file on system this report was generated.">
|
55
|
+
<%= hook.location.gsub(cuke_sniffer.hooks_location, '') %>
|
56
|
+
</a>
|
57
|
+
</div>
|
58
|
+
<div class="well col-md-12">
|
59
|
+
<% SummaryHelper::sort_improvement_list(hook.rules_hash).each do |phrase, count| %>
|
60
|
+
<div class="row" data-improvement-row>
|
61
|
+
<div class="col-md-1 red" data-score>
|
62
|
+
<%= count %>
|
63
|
+
</div>
|
64
|
+
<div class="col-md-11" data-improvement="<%=phrase %>">
|
65
|
+
<%= phrase %>
|
66
|
+
</div>
|
67
|
+
</div>
|
68
|
+
<% end %>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
</div>
|
64
72
|
</div>
|
65
73
|
</div>
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
</td>
|
73
|
-
</tr>
|
74
|
-
|
75
|
-
<% index += 1 %>
|
76
|
-
<% end %>
|
77
|
-
</table>
|
78
|
-
</div>
|
79
|
-
<br style="clear:both">
|
74
|
+
</div>
|
75
|
+
<% end %>
|
76
|
+
<% end %>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
</div>
|
@@ -1,24 +1,34 @@
|
|
1
|
-
<div class="
|
2
|
-
|
3
|
-
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
</div>
|
24
|
-
<
|
1
|
+
<div class="row">
|
2
|
+
<div class="panel panel-default">
|
3
|
+
<div class="panel-heading panel-title" data-toggle="collapse" data-target="#improvement_list_data">
|
4
|
+
Improvement List <span class="glyphicon glyphicon-menu-down"></span>
|
5
|
+
</div>
|
6
|
+
<% improvement_list = cuke_sniffer.summary[:improvement_list] %>
|
7
|
+
|
8
|
+
<div id="improvement_list_data" class="panel-body collapse">
|
9
|
+
<% if improvement_list.empty? %>
|
10
|
+
<div>
|
11
|
+
<div>
|
12
|
+
No Improvements to make!
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
<div>
|
17
|
+
<% improvement_list.each do |improvement, count| %>
|
18
|
+
<div class="improvement" data-improvement="<%=improvement%>">
|
19
|
+
<div class="row">
|
20
|
+
<div class="col-md-12 title">
|
21
|
+
<div class="col-md-1 red">
|
22
|
+
<%= count %>
|
23
|
+
</div>
|
24
|
+
<div class="col-md-11">
|
25
|
+
<%= improvement %>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|