-
Notifications
You must be signed in to change notification settings - Fork 3
/
view_template.erb
129 lines (129 loc) · 3.78 KB
/
view_template.erb
1
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE HTML>
<html lang="ja-JP">
<head>
<meta charset="UTF-8">
<title>reek viewer</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
<style type="text/css">
span#nomal{
display: inline-block;
width: 7em;
color:midnightblue;
}
span#caution{
display: inline-block;
width: 7em;
color:chocolate;
}
span#danger{
display: inline-block;
width: 7em;
color:firebrick;
}
span.aside{
margin-right:1em;
font-size: small;
color:gray;
}
h3#total{
margin-top:10px;
margin-bottom:5px;
}
.slim{
margin-top:5px;
margin-bottom:20px;
}
.strong{
font-size:large;
}
.hidden{
display: none;
}
</style>
</head>
<body>
<div data-role="page">
<div data-role="content">
<h1>Reek Viewer</h1>
<div class="ui-body ui-body-b">
<%= @input_file_path %>
</div>
<div class="ui-body ui-body-b">
<h3 id="total">Total</h3>
<p class="strong slim">
<%= @keys.size %><span class="aside">Class</span>
<%= @sum_of_waning_num %><span class="aside">Wanings</span>
</p>
<hr />
<h3 class="hidden">Content</h3>
<% @reeks_list.each do |reeks| %>
<div data-role="collapsible" data-collapsed="true" data-theme="c" data-content-theme="d">
<h4>
<div class="ui-grid-a">
<div class="ui-block-a">
<span><%= reeks.first.context_class %></span>
</div>
<div class="ui-block-b">
<% if reeks.size < 5 %>
<span id="nomal"><%= reeks.size %>warnings</span>
<% elsif reeks.size < 10 %>
<span id="caution"><%= reeks.size %>warnings</span>
<% else %>
<span id="danger"><%= reeks.size %>warnings</span>
<% end %>
</div>
</div>
</h4>
<div>
<ul data-role="listview" data-inset="true" data-divider-theme="c">
<li data-role="list-divider">
File Path
</li>
<li>
<h4><span class="aside">File:</span><%= reeks.first.location["source"].split("/").last %></h4><br>
<span class="aside">Path:</span><%= reeks.first.location["source"] %>
</li>
</ul>
<ul data-role="listview" data-inset="true" data-divider-theme="c">
<li data-role="list-divider">
<div class="ui-grid-a">
<div class="ui-block-a">Location</div>
<div class="ui-block-b">Warnings</div>
</div>
</li>
<% reeks.each do |smell| %>
<li>
<div class="ui-grid-a">
<div class="ui-block-a">
<h4><%= smell.location["context"] %></h4>
<span>
<% location = smell.location["source"].split("/") %>
</span>
</div>
<div class="ui-block-b">
<span class="aside">line:
<% if smell.location["lines"].size == 2 %>
<%= smell.location["lines"].first.to_s %>
<%= " - " + smell.location["lines"].last.to_s unless smell.location["lines"].first == smell.location["lines"].last %>
<% else %>
<%= smell.location["lines"].first %>
<% end %>
</span>
<h4><%= smell.smell["class"] %><%= if smell.smell["class"] != smell.smell["subclass"] then "::"+smell.smell["subclass"] end %></h4>
<%= smell.smell["message"] %>
</div>
</div>
</li>
<% end %>
</ul>
</div>
</div>
<% end %>
</div>
</div>
</div>
</body>
</html>