solidstats 2.0.0 → 3.0.0.beta.1
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 +4 -4
- data/CHANGELOG.md +12 -63
- data/README.md +27 -33
- data/Rakefile +3 -3
- data/app/assets/stylesheets/solidstats/application.css +1 -6
- data/app/assets/stylesheets/solidstats/dashboard.css +48 -0
- data/app/controllers/solidstats/dashboard_controller.rb +81 -62
- data/app/controllers/solidstats/logs_controller.rb +72 -0
- data/app/controllers/solidstats/performance_controller.rb +25 -0
- data/app/controllers/solidstats/productivity_controller.rb +39 -0
- data/app/controllers/solidstats/quality_controller.rb +152 -0
- data/app/controllers/solidstats/securities_controller.rb +30 -0
- data/app/helpers/solidstats/application_helper.rb +124 -11
- data/app/helpers/solidstats/performance_helper.rb +87 -0
- data/app/helpers/solidstats/productivity_helper.rb +38 -0
- data/app/services/solidstats/bundler_audit_service.rb +206 -0
- data/app/services/solidstats/coverage_compass_service.rb +335 -0
- data/app/services/solidstats/load_lens_service.rb +454 -0
- data/app/services/solidstats/log_size_monitor_service.rb +207 -76
- data/app/services/solidstats/my_todo_service.rb +242 -0
- data/app/services/solidstats/style_patrol_service.rb +319 -0
- data/app/views/layouts/solidstats/application.html.erb +8 -2
- data/app/views/layouts/solidstats/dashboard.html.erb +84 -0
- data/app/views/solidstats/dashboard/dashboard.html.erb +39 -0
- data/app/views/solidstats/logs/logs_size.html.erb +409 -0
- data/app/views/solidstats/performance/load_lens.html.erb +158 -0
- data/app/views/solidstats/productivity/_todo_list.html.erb +49 -0
- data/app/views/solidstats/productivity/my_todos.html.erb +84 -0
- data/app/views/solidstats/quality/coverage_compass.html.erb +420 -0
- data/app/views/solidstats/quality/style_patrol.html.erb +463 -0
- data/app/views/solidstats/securities/bundler_audit.html.erb +345 -0
- data/app/views/solidstats/shared/_dashboard_card.html.erb +160 -0
- data/app/views/solidstats/shared/_quick_actions.html.erb +26 -0
- data/config/routes.rb +32 -7
- data/lib/generators/solidstats/install/install_generator.rb +28 -2
- data/lib/generators/solidstats/install/templates/README +7 -0
- data/lib/solidstats/engine.rb +9 -114
- data/lib/solidstats/version.rb +1 -1
- data/lib/solidstats.rb +2 -299
- data/lib/tasks/solidstats_install.rake +2 -122
- data/lib/tasks/solidstats_performance.rake +84 -0
- metadata +32 -103
- data/app/assets/javascripts/solidstats/application.js +0 -257
- data/app/assets/javascripts/solidstats/dashboard.js +0 -225
- data/app/assets/javascripts/solidstats/gem_metadata.js +0 -554
- data/app/assets/stylesheets/solidstats/components/action_button.css +0 -99
- data/app/assets/stylesheets/solidstats/components/dashboard.css +0 -151
- data/app/assets/stylesheets/solidstats/components/dashboard_header.css +0 -93
- data/app/assets/stylesheets/solidstats/components/dashboard_layout.css +0 -97
- data/app/assets/stylesheets/solidstats/components/gem_metadata.css +0 -1403
- data/app/assets/stylesheets/solidstats/components/navigation.css +0 -80
- data/app/assets/stylesheets/solidstats/components/quick_navigation.css +0 -54
- data/app/assets/stylesheets/solidstats/components/security.css +0 -332
- data/app/assets/stylesheets/solidstats/components/status_badge.css +0 -58
- data/app/assets/stylesheets/solidstats/components/summary_card.css +0 -66
- data/app/assets/stylesheets/solidstats/components/tab_navigation.css +0 -95
- data/app/components/solidstats/base_component.rb +0 -88
- data/app/components/solidstats/code_quality/code_quality_section_component.html.erb +0 -0
- data/app/components/solidstats/code_quality/code_quality_section_component.rb +0 -0
- data/app/components/solidstats/code_quality/section_component.html.erb +0 -45
- data/app/components/solidstats/code_quality/section_component.rb +0 -34
- data/app/components/solidstats/dashboard_header_component.html.erb +0 -39
- data/app/components/solidstats/dashboard_header_component.rb +0 -33
- data/app/components/solidstats/previews/action_button_component_preview/button_vs_link.html.erb +0 -6
- data/app/components/solidstats/previews/action_button_component_preview/sizes.html.erb +0 -6
- data/app/components/solidstats/previews/action_button_component_preview/variants.html.erb +0 -6
- data/app/components/solidstats/previews/action_button_component_preview/with_icons.html.erb +0 -6
- data/app/components/solidstats/previews/action_button_component_preview.rb +0 -64
- data/app/components/solidstats/previews/navigation_component_preview.rb +0 -74
- data/app/components/solidstats/previews/stats_overview_component_preview.rb +0 -100
- data/app/components/solidstats/previews/status_badge_component_preview/sizes.html.erb +0 -6
- data/app/components/solidstats/previews/status_badge_component_preview/statuses.html.erb +0 -6
- data/app/components/solidstats/previews/status_badge_component_preview/with_icons.html.erb +0 -6
- data/app/components/solidstats/previews/status_badge_component_preview.rb +0 -49
- data/app/components/solidstats/previews/summary_card_component_preview/clickable.html.erb +0 -9
- data/app/components/solidstats/previews/summary_card_component_preview/dashboard_layout.html.erb +0 -9
- data/app/components/solidstats/previews/summary_card_component_preview/statuses.html.erb +0 -6
- data/app/components/solidstats/previews/summary_card_component_preview/value_formats.html.erb +0 -6
- data/app/components/solidstats/previews/summary_card_component_preview.rb +0 -67
- data/app/components/solidstats/quick_navigation_component.html.erb +0 -8
- data/app/components/solidstats/quick_navigation_component.rb +0 -21
- data/app/components/solidstats/security/gem_impact_analysis_component.html.erb +0 -44
- data/app/components/solidstats/security/gem_impact_analysis_component.rb +0 -45
- data/app/components/solidstats/security/overview_component.html.erb +0 -21
- data/app/components/solidstats/security/overview_component.rb +0 -104
- data/app/components/solidstats/security/section_component.html.erb +0 -26
- data/app/components/solidstats/security/section_component.rb +0 -52
- data/app/components/solidstats/security/timeline_component.html.erb +0 -39
- data/app/components/solidstats/security/timeline_component.rb +0 -43
- data/app/components/solidstats/tasks_section_component.html.erb +0 -17
- data/app/components/solidstats/tasks_section_component.rb +0 -22
- data/app/components/solidstats/ui/action_button_component.html.erb +0 -6
- data/app/components/solidstats/ui/action_button_component.rb +0 -71
- data/app/components/solidstats/ui/dashboard_layout_component.html.erb +0 -19
- data/app/components/solidstats/ui/dashboard_layout_component.rb +0 -85
- data/app/components/solidstats/ui/navigation_component.html.erb +0 -34
- data/app/components/solidstats/ui/navigation_component.rb +0 -72
- data/app/components/solidstats/ui/stats_overview_component.html.erb +0 -14
- data/app/components/solidstats/ui/stats_overview_component.rb +0 -78
- data/app/components/solidstats/ui/status_badge_component.html.erb +0 -6
- data/app/components/solidstats/ui/status_badge_component.rb +0 -42
- data/app/components/solidstats/ui/summary_card_component.html.erb +0 -12
- data/app/components/solidstats/ui/summary_card_component.rb +0 -63
- data/app/components/solidstats/ui/tab_navigation_component.html.erb +0 -22
- data/app/components/solidstats/ui/tab_navigation_component.rb +0 -79
- data/app/controllers/solidstats/gem_metadata_controller.rb +0 -12
- data/app/services/solidstats/audit_service.rb +0 -56
- data/app/services/solidstats/data_collector_service.rb +0 -83
- data/app/services/solidstats/gem_metadata/fetcher_service.rb +0 -136
- data/app/services/solidstats/todo_service.rb +0 -114
- data/app/views/solidstats/dashboard/_log_monitor.html.erb +0 -759
- data/app/views/solidstats/dashboard/_todos.html.erb +0 -151
- data/app/views/solidstats/dashboard/audit/_additional_styles.css +0 -22
- data/app/views/solidstats/dashboard/audit/_audit_badge.html.erb +0 -5
- data/app/views/solidstats/dashboard/audit/_audit_details.html.erb +0 -495
- data/app/views/solidstats/dashboard/audit/_audit_summary.html.erb +0 -26
- data/app/views/solidstats/dashboard/audit/_no_vulnerabilities.html.erb +0 -3
- data/app/views/solidstats/dashboard/audit/_security_audit.html.erb +0 -14
- data/app/views/solidstats/dashboard/audit/_vulnerabilities_table.html.erb +0 -1120
- data/app/views/solidstats/dashboard/audit/_vulnerability_details.html.erb +0 -63
- data/app/views/solidstats/dashboard/index.html.erb +0 -81
- data/app/views/solidstats/gem_metadata/_panel.html.erb +0 -419
- data/lib/generators/solidstats/feature/feature_generator.rb +0 -170
- data/lib/generators/solidstats/feature/templates/component.html.erb +0 -84
- data/lib/generators/solidstats/feature/templates/component.rb.erb +0 -103
- data/lib/generators/solidstats/feature/templates/component.scss +0 -243
- data/lib/generators/solidstats/feature/templates/component_test.rb.erb +0 -183
- data/lib/generators/solidstats/feature/templates/controller.rb.erb +0 -44
- data/lib/generators/solidstats/feature/templates/controller_test.rb.erb +0 -111
- data/lib/generators/solidstats/feature/templates/detail_view.html.erb +0 -755
- data/lib/generators/solidstats/feature/templates/preview.rb.erb +0 -107
- data/lib/generators/solidstats/feature/templates/service.rb.erb +0 -132
- data/lib/generators/solidstats/feature/templates/service_test.rb.erb +0 -109
- data/lib/generators/solidstats/install_generator.rb +0 -109
- data/lib/generators/solidstats/templates/initializer.rb +0 -112
- data/lib/solidstats/asset_compatibility.rb +0 -238
- data/lib/solidstats/asset_manifest.rb +0 -205
- data/lib/tasks/solidstats_tasks.rake +0 -4
@@ -0,0 +1,463 @@
|
|
1
|
+
<div class="min-h-screen bg-gradient-to-br from-base-200 to-base-300 p-4 lg:p-8">
|
2
|
+
<!-- Breadcrumbs -->
|
3
|
+
<div class="breadcrumbs text-sm mb-6">
|
4
|
+
<ul>
|
5
|
+
<li><a class="text-primary hover:text-primary-focus">Dashboard</a></li>
|
6
|
+
<li><a class="text-primary hover:text-primary-focus">Quality</a></li>
|
7
|
+
<li class="text-base-content/70">Style Patrol</li>
|
8
|
+
</ul>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<!-- Hero Header -->
|
12
|
+
<div class="hero bg-gradient-to-r from-primary via-primary-focus to-secondary text-primary-content rounded-3xl mb-8 shadow-2xl overflow-hidden relative">
|
13
|
+
<!-- Background Pattern -->
|
14
|
+
<div class="absolute inset-0 opacity-10">
|
15
|
+
<svg class="w-full h-full" viewBox="0 0 100 100" fill="currentColor">
|
16
|
+
<pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse">
|
17
|
+
<circle cx="5" cy="5" r="1"/>
|
18
|
+
</pattern>
|
19
|
+
<rect width="100" height="100" fill="url(#grid)"/>
|
20
|
+
</svg>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="hero-content text-center py-16 relative z-10">
|
24
|
+
<div class="max-w-md">
|
25
|
+
<div class="text-7xl mb-6 animate-bounce">🚨</div>
|
26
|
+
<h1 class="text-6xl font-black mb-4 bg-gradient-to-r from-white to-primary-content bg-clip-text">
|
27
|
+
StylePatrol
|
28
|
+
</h1>
|
29
|
+
<p class="text-xl opacity-90 mb-8 leading-relaxed">
|
30
|
+
Ruby Standard gem code quality enforcement
|
31
|
+
</p>
|
32
|
+
|
33
|
+
<%= form_with url: refresh_quality_style_patrol_path, method: :post, local: true,
|
34
|
+
data: { turbo_submits_with: "Analyzing..." }, class: "inline-block" do |form| %>
|
35
|
+
<%= form.button type: "submit",
|
36
|
+
class: "btn btn-accent btn-lg gap-3 shadow-xl hover:shadow-2xl hover:scale-105 transition-all duration-300 group" do %>
|
37
|
+
<svg class="w-5 h-5 group-hover:rotate-180 transition-transform duration-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
38
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
|
39
|
+
</svg>
|
40
|
+
Refresh Analysis
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<!-- Status Overview -->
|
48
|
+
<div class="mb-8">
|
49
|
+
<% case @summary[:status] %>
|
50
|
+
<% when "clean" %>
|
51
|
+
<div class="alert alert-success shadow-lg">
|
52
|
+
<div>
|
53
|
+
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
54
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
55
|
+
</svg>
|
56
|
+
<div>
|
57
|
+
<h3 class="font-bold text-lg">All Clear!</h3>
|
58
|
+
<div class="text-sm opacity-80">Your code meets all standards</div>
|
59
|
+
</div>
|
60
|
+
</div>
|
61
|
+
<div class="flex-none">
|
62
|
+
<div class="badge badge-success badge-lg font-mono"><%= @summary[:health_score] %>/100</div>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
<% when "issues_found" %>
|
66
|
+
<div class="alert alert-warning shadow-lg">
|
67
|
+
<div>
|
68
|
+
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
69
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 14.5c-.77.833.192 2.5 1.732 2.5z"></path>
|
70
|
+
</svg>
|
71
|
+
<div>
|
72
|
+
<h3 class="font-bold text-lg">Issues Detected</h3>
|
73
|
+
<div class="text-sm opacity-80"><%= @summary[:total_offenses] %> violations found</div>
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
<div class="flex-none">
|
77
|
+
<div class="badge badge-warning badge-lg font-mono"><%= @summary[:health_score] %>/100</div>
|
78
|
+
</div>
|
79
|
+
</div>
|
80
|
+
<% when "error" %>
|
81
|
+
<div class="alert alert-error shadow-lg">
|
82
|
+
<div>
|
83
|
+
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
84
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
85
|
+
</svg>
|
86
|
+
<div>
|
87
|
+
<h3 class="font-bold text-lg">Analysis Error</h3>
|
88
|
+
<div class="text-sm opacity-80">Could not complete analysis</div>
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
<div class="flex-none">
|
92
|
+
<div class="badge badge-error badge-lg">Error</div>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
<% end %>
|
96
|
+
|
97
|
+
<!-- Analysis Metadata -->
|
98
|
+
<div class="stats stats-horizontal shadow-lg bg-base-100 mt-4 w-full">
|
99
|
+
<div class="stat">
|
100
|
+
<div class="stat-figure text-secondary">
|
101
|
+
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
102
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
103
|
+
</svg>
|
104
|
+
</div>
|
105
|
+
<div class="stat-title">Last Analyzed</div>
|
106
|
+
<div class="stat-value text-2xl"><%= time_ago_in_words(Time.parse(@summary[:last_analyzed])) %></div>
|
107
|
+
<div class="stat-desc">ago</div>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
<div class="stat">
|
111
|
+
<div class="stat-figure text-primary">
|
112
|
+
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
113
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path>
|
114
|
+
</svg>
|
115
|
+
</div>
|
116
|
+
<div class="stat-title">Health Score</div>
|
117
|
+
<div class="stat-value text-3xl text-primary"><%= @summary[:health_score] %></div>
|
118
|
+
<div class="stat-desc text-primary">out of 100</div>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<!-- Summary Statistics -->
|
124
|
+
<% if @summary[:status] == "issues_found" %>
|
125
|
+
<div class="stats stats-vertical lg:stats-horizontal shadow-xl bg-gradient-to-r from-base-100 to-base-200 mb-8">
|
126
|
+
<div class="stat place-items-center">
|
127
|
+
<div class="stat-figure text-info">
|
128
|
+
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
129
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
|
130
|
+
</svg>
|
131
|
+
</div>
|
132
|
+
<div class="stat-title">Files Inspected</div>
|
133
|
+
<div class="stat-value text-info"><%= @analysis_data.dig(:summary, :inspected_file_count) || @summary[:total_files] %></div>
|
134
|
+
<div class="stat-desc">Source files analyzed</div>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="stat place-items-center">
|
138
|
+
<div class="stat-figure text-error">
|
139
|
+
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
140
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 14.5c-.77.833.192 2.5 1.732 2.5z"></path>
|
141
|
+
</svg>
|
142
|
+
</div>
|
143
|
+
<div class="stat-title">Total Violations</div>
|
144
|
+
<div class="stat-value text-error"><%= @summary[:total_offenses] %></div>
|
145
|
+
<div class="stat-desc">Issues found</div>
|
146
|
+
</div>
|
147
|
+
|
148
|
+
<div class="stat place-items-center">
|
149
|
+
<div class="stat-figure text-success">
|
150
|
+
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
151
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
|
152
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
153
|
+
</svg>
|
154
|
+
</div>
|
155
|
+
<div class="stat-title">Auto-Fixable</div>
|
156
|
+
<div class="stat-value text-success"><%= @summary[:correctable_count] %></div>
|
157
|
+
<div class="stat-desc">Can be auto-fixed</div>
|
158
|
+
</div>
|
159
|
+
|
160
|
+
<div class="stat place-items-center">
|
161
|
+
<div class="stat-figure text-primary">
|
162
|
+
<div class="radial-progress text-primary border-primary border-4" style="--value:<%= @summary[:health_score] %>;" role="progressbar"><%= @summary[:health_score] %>%</div>
|
163
|
+
</div>
|
164
|
+
<div class="stat-title">Health Score</div>
|
165
|
+
<div class="stat-value text-primary"><%= @summary[:health_score] %>%</div>
|
166
|
+
<div class="stat-desc">Code quality</div>
|
167
|
+
</div>
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<!-- Ruby Environment Info -->
|
171
|
+
<% if @analysis_data.dig(:raw_data, "metadata").present? %>
|
172
|
+
<div class="card bg-base-100 shadow-xl mb-8">
|
173
|
+
<div class="card-body">
|
174
|
+
<h2 class="card-title text-2xl">
|
175
|
+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
176
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
|
177
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
178
|
+
</svg>
|
179
|
+
Environment Information
|
180
|
+
</h2>
|
181
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
182
|
+
<% metadata = @analysis_data.dig(:raw_data, "metadata") %>
|
183
|
+
<div class="flex items-center justify-between p-4 bg-base-200 rounded-lg">
|
184
|
+
<span class="font-semibold text-base-content">Ruby Version:</span>
|
185
|
+
<div class="badge badge-primary badge-lg font-mono"><%= metadata["ruby_version"] %> (<%= metadata["ruby_patchlevel"] %>)</div>
|
186
|
+
</div>
|
187
|
+
<div class="flex items-center justify-between p-4 bg-base-200 rounded-lg">
|
188
|
+
<span class="font-semibold text-base-content">Ruby Engine:</span>
|
189
|
+
<div class="badge badge-secondary badge-lg font-mono"><%= metadata["ruby_engine"] %></div>
|
190
|
+
</div>
|
191
|
+
<div class="flex items-center justify-between p-4 bg-base-200 rounded-lg">
|
192
|
+
<span class="font-semibold text-base-content">Platform:</span>
|
193
|
+
<div class="badge badge-accent badge-lg font-mono"><%= metadata["ruby_platform"] %></div>
|
194
|
+
</div>
|
195
|
+
<div class="flex items-center justify-between p-4 bg-base-200 rounded-lg">
|
196
|
+
<span class="font-semibold text-base-content">RuboCop Version:</span>
|
197
|
+
<div class="badge badge-info badge-lg font-mono"><%= metadata["rubocop_version"] %></div>
|
198
|
+
</div>
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
<% end %>
|
203
|
+
|
204
|
+
<!-- Violations by Severity -->
|
205
|
+
<% if @issues_by_severity.any? %>
|
206
|
+
<div class="card bg-base-100 shadow-xl mb-8">
|
207
|
+
<div class="card-body">
|
208
|
+
<h2 class="card-title text-2xl">
|
209
|
+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
210
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path>
|
211
|
+
</svg>
|
212
|
+
Violations by Severity
|
213
|
+
</h2>
|
214
|
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
215
|
+
<% @issues_by_severity.each do |severity, issues| %>
|
216
|
+
<div class="stat bg-base-200 rounded-xl p-6 border-l-4
|
217
|
+
<%= case severity
|
218
|
+
when 'error'
|
219
|
+
'border-error'
|
220
|
+
when 'warning'
|
221
|
+
'border-warning'
|
222
|
+
else
|
223
|
+
'border-info'
|
224
|
+
end %>">
|
225
|
+
<div class="stat-figure <%= case severity
|
226
|
+
when 'error'
|
227
|
+
'text-error'
|
228
|
+
when 'warning'
|
229
|
+
'text-warning'
|
230
|
+
else
|
231
|
+
'text-info'
|
232
|
+
end %>">
|
233
|
+
<%= case severity
|
234
|
+
when 'error'
|
235
|
+
'🔴'
|
236
|
+
when 'warning'
|
237
|
+
'🟡'
|
238
|
+
else
|
239
|
+
'🔵'
|
240
|
+
end %>
|
241
|
+
</div>
|
242
|
+
<div class="stat-value <%= case severity
|
243
|
+
when 'error'
|
244
|
+
'text-error'
|
245
|
+
when 'warning'
|
246
|
+
'text-warning'
|
247
|
+
else
|
248
|
+
'text-info'
|
249
|
+
end %>"><%= issues.count %></div>
|
250
|
+
<div class="stat-title"><%= severity.capitalize %></div>
|
251
|
+
<div class="stat-desc">violations</div>
|
252
|
+
</div>
|
253
|
+
<% end %>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
</div>
|
257
|
+
<% end %>
|
258
|
+
|
259
|
+
<!-- Detailed Violations -->
|
260
|
+
<div class="card bg-base-100 shadow-xl mb-8">
|
261
|
+
<div class="card-body">
|
262
|
+
<h2 class="card-title text-2xl mb-6">
|
263
|
+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
264
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
|
265
|
+
</svg>
|
266
|
+
Detailed Violations
|
267
|
+
</h2>
|
268
|
+
|
269
|
+
<div class="space-y-6">
|
270
|
+
<% @issues_by_file.each do |file, file_issues| %>
|
271
|
+
<div class="collapse collapse-arrow bg-base-200">
|
272
|
+
<input type="checkbox" />
|
273
|
+
<div class="collapse-title text-lg font-medium flex items-center justify-between">
|
274
|
+
<div class="flex items-center gap-3">
|
275
|
+
<svg class="w-5 h-5 text-primary" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
276
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
|
277
|
+
</svg>
|
278
|
+
<span class="font-mono text-sm text-base-content/70 break-all"><%= file %></span>
|
279
|
+
</div>
|
280
|
+
<div class="badge badge-error"><%= pluralize(file_issues.count, 'issue') %></div>
|
281
|
+
</div>
|
282
|
+
|
283
|
+
<div class="collapse-content">
|
284
|
+
<div class="space-y-3 pt-4">
|
285
|
+
<% file_issues.each do |issue| %>
|
286
|
+
<div class="alert
|
287
|
+
<%= case issue[:severity]
|
288
|
+
when 'error'
|
289
|
+
'alert-error'
|
290
|
+
when 'warning'
|
291
|
+
'alert-warning'
|
292
|
+
else
|
293
|
+
'alert-info'
|
294
|
+
end %>
|
295
|
+
shadow-sm">
|
296
|
+
<div class="flex-1">
|
297
|
+
<div class="flex items-start justify-between mb-2">
|
298
|
+
<div class="flex items-center gap-2">
|
299
|
+
<div class="badge badge-neutral font-mono text-xs">L<%= issue[:line] %>:<%= issue[:column] %></div>
|
300
|
+
<div class="badge badge-outline"><%= issue[:cop_name] %></div>
|
301
|
+
<% if issue[:correctable] %>
|
302
|
+
<div class="badge badge-success gap-1">
|
303
|
+
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
304
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
|
305
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
306
|
+
</svg>
|
307
|
+
Auto-fixable
|
308
|
+
</div>
|
309
|
+
<% end %>
|
310
|
+
</div>
|
311
|
+
</div>
|
312
|
+
<p class="text-sm leading-relaxed"><%= issue[:message] %></p>
|
313
|
+
</div>
|
314
|
+
</div>
|
315
|
+
<% end %>
|
316
|
+
</div>
|
317
|
+
</div>
|
318
|
+
</div>
|
319
|
+
<% end %>
|
320
|
+
</div>
|
321
|
+
</div>
|
322
|
+
</div>
|
323
|
+
|
324
|
+
<% elsif @summary[:status] == "error" %>
|
325
|
+
<!-- Error Display -->
|
326
|
+
<div class="card bg-error text-error-content shadow-xl mb-8">
|
327
|
+
<div class="card-body">
|
328
|
+
<h2 class="card-title text-2xl">
|
329
|
+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
330
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
331
|
+
</svg>
|
332
|
+
Analysis Error
|
333
|
+
</h2>
|
334
|
+
|
335
|
+
<div class="bg-error-content/10 p-6 rounded-lg">
|
336
|
+
<p class="mb-4 text-lg">StylePatrol encountered an error while analyzing your code:</p>
|
337
|
+
<div class="mockup-code bg-base-300 text-base-content mb-6">
|
338
|
+
<pre class="px-4"><code><%= @analysis_data[:error_message] %></code></pre>
|
339
|
+
</div>
|
340
|
+
|
341
|
+
<div class="divider"></div>
|
342
|
+
|
343
|
+
<h3 class="text-lg font-bold mb-3">💡 Possible solutions:</h3>
|
344
|
+
<div class="space-y-2">
|
345
|
+
<div class="flex items-center gap-3 p-3 bg-base-100 text-base-content rounded-lg">
|
346
|
+
<svg class="w-5 h-5 text-info" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
347
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
348
|
+
</svg>
|
349
|
+
<span>Ensure the Standard gem is installed: <code class="bg-base-200 px-2 py-1 rounded">gem install standard</code></span>
|
350
|
+
</div>
|
351
|
+
<div class="flex items-center gap-3 p-3 bg-base-100 text-base-content rounded-lg">
|
352
|
+
<svg class="w-5 h-5 text-info" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
353
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
354
|
+
</svg>
|
355
|
+
<span>Check that your project has Ruby files to analyze</span>
|
356
|
+
</div>
|
357
|
+
<div class="flex items-center gap-3 p-3 bg-base-100 text-base-content rounded-lg">
|
358
|
+
<svg class="w-5 h-5 text-info" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
359
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
360
|
+
</svg>
|
361
|
+
<span>Verify that <code class="bg-base-200 px-2 py-1 rounded">standardrb</code> command is available in your PATH</span>
|
362
|
+
</div>
|
363
|
+
</div>
|
364
|
+
</div>
|
365
|
+
</div>
|
366
|
+
</div>
|
367
|
+
|
368
|
+
<% else %>
|
369
|
+
<!-- Clean Code Display -->
|
370
|
+
<div class="card bg-gradient-to-r from-success to-success/80 text-success-content shadow-xl mb-8">
|
371
|
+
<div class="card-body text-center">
|
372
|
+
<div class="text-6xl mb-4">🎉</div>
|
373
|
+
<h2 class="card-title text-3xl justify-center mb-4">Excellent Code Quality!</h2>
|
374
|
+
<p class="text-xl opacity-90 mb-6">Your code passes all Standard gem checks. Keep up the great work!</p>
|
375
|
+
|
376
|
+
<div class="stats stats-horizontal bg-success-content/10 text-success-content shadow-lg">
|
377
|
+
<div class="stat">
|
378
|
+
<div class="stat-title text-success-content/70">Files Inspected</div>
|
379
|
+
<div class="stat-value text-2xl"><%= @analysis_data.dig(:summary, :inspected_file_count) || @summary[:total_files] %></div>
|
380
|
+
<div class="stat-desc text-success-content/70">Source files</div>
|
381
|
+
</div>
|
382
|
+
|
383
|
+
<div class="stat">
|
384
|
+
<div class="stat-title text-success-content/70">Health Score</div>
|
385
|
+
<div class="stat-value text-3xl"><%= @summary[:health_score] %>/100</div>
|
386
|
+
<div class="stat-desc text-success-content/70">Perfect score</div>
|
387
|
+
</div>
|
388
|
+
|
389
|
+
<div class="stat">
|
390
|
+
<div class="stat-title text-success-content/70">Last Check</div>
|
391
|
+
<div class="stat-value text-2xl"><%= time_ago_in_words(Time.parse(@summary[:last_analyzed])) %></div>
|
392
|
+
<div class="stat-desc text-success-content/70">ago</div>
|
393
|
+
</div>
|
394
|
+
</div>
|
395
|
+
</div>
|
396
|
+
</div>
|
397
|
+
|
398
|
+
<!-- Ruby Environment Info for Clean Code -->
|
399
|
+
<% if @analysis_data.dig(:raw_data, "metadata").present? %>
|
400
|
+
<div class="card bg-base-100 shadow-xl mb-8">
|
401
|
+
<div class="card-body">
|
402
|
+
<h2 class="card-title text-2xl">
|
403
|
+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
404
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
|
405
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
|
406
|
+
</svg>
|
407
|
+
Environment Information
|
408
|
+
</h2>
|
409
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
410
|
+
<% metadata = @analysis_data.dig(:raw_data, "metadata") %>
|
411
|
+
<div class="flex items-center justify-between p-4 bg-base-200 rounded-lg">
|
412
|
+
<span class="font-semibold text-base-content">Ruby Version:</span>
|
413
|
+
<div class="badge badge-primary badge-lg font-mono"><%= metadata["ruby_version"] %> (<%= metadata["ruby_patchlevel"] %>)</div>
|
414
|
+
</div>
|
415
|
+
<div class="flex items-center justify-between p-4 bg-base-200 rounded-lg">
|
416
|
+
<span class="font-semibold text-base-content">Ruby Engine:</span>
|
417
|
+
<div class="badge badge-secondary badge-lg font-mono"><%= metadata["ruby_engine"] %></div>
|
418
|
+
</div>
|
419
|
+
<div class="flex items-center justify-between p-4 bg-base-200 rounded-lg">
|
420
|
+
<span class="font-semibold text-base-content">Platform:</span>
|
421
|
+
<div class="badge badge-accent badge-lg font-mono"><%= metadata["ruby_platform"] %></div>
|
422
|
+
</div>
|
423
|
+
<div class="flex items-center justify-between p-4 bg-base-200 rounded-lg">
|
424
|
+
<span class="font-semibold text-base-content">RuboCop Version:</span>
|
425
|
+
<div class="badge badge-info badge-lg font-mono"><%= metadata["rubocop_version"] %></div>
|
426
|
+
</div>
|
427
|
+
</div>
|
428
|
+
</div>
|
429
|
+
</div>
|
430
|
+
<% end %>
|
431
|
+
<% end %>
|
432
|
+
|
433
|
+
<!-- Floating Action Button for mobile -->
|
434
|
+
<div class="fixed bottom-6 right-6 lg:hidden">
|
435
|
+
<div class="dropdown dropdown-top dropdown-end">
|
436
|
+
<div tabindex="0" role="button" class="btn btn-circle btn-primary btn-lg shadow-2xl">
|
437
|
+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
438
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"></path>
|
439
|
+
</svg>
|
440
|
+
</div>
|
441
|
+
<ul tabindex="0" class="dropdown-content z-[1] menu p-2 shadow-2xl bg-base-100 rounded-box w-52 mb-2">
|
442
|
+
<li>
|
443
|
+
<%= form_with url: refresh_quality_style_patrol_path, method: :post, local: true, class: "contents" do |form| %>
|
444
|
+
<%= form.button type: "submit", class: "gap-3 w-full justify-start bg-transparent border-none hover:bg-base-200 text-base-content p-3 rounded-lg" do %>
|
445
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
446
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
|
447
|
+
</svg>
|
448
|
+
Refresh Analysis
|
449
|
+
<% end %>
|
450
|
+
<% end %>
|
451
|
+
</li>
|
452
|
+
<li>
|
453
|
+
<a href="#top" class="gap-3">
|
454
|
+
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
455
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 11l5-5m0 0l5 5m-5-5v12"></path>
|
456
|
+
</svg>
|
457
|
+
Back to Top
|
458
|
+
</a>
|
459
|
+
</li>
|
460
|
+
</ul>
|
461
|
+
</div>
|
462
|
+
</div>
|
463
|
+
</div>
|