File tree Expand file tree Collapse file tree 4 files changed +29
-7
lines changed
Expand file tree Collapse file tree 4 files changed +29
-7
lines changed Original file line number Diff line number Diff line change 11# main ([ unreleased] ( https://github.com/fastruby/rails_stats/compare/v1.0.2...main ) )
22
3- *
3+ * [ BUGFIX: Fix JSON output missing Code and Tests total count ] ( https://github.com/fastruby/rails_stats/pull/40 )
44
55# v2.0.1 ([ commits] ( https://github.com/fastruby/rails_stats/compare/v2.0.0...v2.0.1 ) )
66
Original file line number Diff line number Diff line change @@ -5,9 +5,9 @@ class JSONFormatter < StatsFormatter
55 def result
66 @result = @statistics . map { |key , stats | stat_hash ( key , stats ) }
77
8- if @grand_total
9- @result << stat_hash ( "Total " , @grand_total ) . merge ( code_test_hash )
10- end
8+ @result << stat_hash ( "Code" , @code_total ) . merge ( code_test_hash ) if @code_total
9+ @result << stat_hash ( "Tests " , @tests_total ) . merge ( code_test_hash ) if @tests_total
10+ @result << stat_hash ( "Total" , @grand_total ) . merge ( code_test_hash ) if @grand_total
1111
1212 @result
1313 end
Original file line number Diff line number Diff line change 11+-----------------------|------------|----------------+
22| Name | Total Deps | 1st Level Deps |
33+-----------------------|------------|----------------+
4- | simplecov-console | 7 | 3 |
5- | codecov | 5 | 2 |
4+ | simplecov-console | 8 | 3 |
5+ | codecov | 4 | 1 |
66| rails_stats | 4 | 2 |
77| simplecov | 3 | 3 |
88| minitest-around | 1 | 1 |
2121| Name | Files | Lines | LOC | Classes | Methods | M/C | LOC/M |
2222+----------------------+---------+---------+---------+---------+---------+-----+-------+
2323| Channels | 2 | 8 | 8 | 2 | 0 | 0 | 0 |
24- | Configuration | 19 | 417 | 111 | 1 | 0 | 0 | 0 |
24+ | Configuration | 19 | 417 | 111 | 1 | 0 | 0 | 0 |
2525| Controllers | 1 | 7 | 6 | 1 | 1 | 1 | 4 |
2626| Helpers | 1 | 3 | 3 | 0 | 0 | 0 | 0 |
2727| Javascripts | 3 | 27 | 7 | 0 | 0 | 0 | 0 |
Original file line number Diff line number Diff line change 113113 "methods": "0",
114114 "m_over_c": "0",
115115 "loc_over_m": "0"
116+ },{
117+ "name": "Code",
118+ "files": "30",
119+ "lines": "477",
120+ "loc": "145",
121+ "classes": "7",
122+ "methods": "1",
123+ "m_over_c": "0",
124+ "loc_over_m": "143",
125+ "code_to_test_ratio": "0.0",
126+ "total": true
127+ },{
128+ "name": "Tests",
129+ "files": "4",
130+ "lines": "7",
131+ "loc": "6",
132+ "classes": "2",
133+ "methods": "0",
134+ "m_over_c": "0",
135+ "loc_over_m": "0",
136+ "code_to_test_ratio": "0.0",
137+ "total": true
116138 }, {
117139 "name": "Total",
118140 "files": "34",
You can’t perform that action at this time.
0 commit comments