code_quality 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/code_quality/version.rb +1 -1
- data/lib/tasks/code_quality.rake +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a916f4bb0abada23ac50bc7f78503d1231e1ff16
|
4
|
+
data.tar.gz: 95c0516415e45d0333ff74a1bd33da22081f66ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70744748adc7192561d92fd62f97e6d376ef50ccc90d69690ef2c91bcfc5e21a5465dfcf9ce30161c511177ac2facdafa74e6a16b59917a07e3c0044d80c08e1
|
7
|
+
data.tar.gz: cf39d87aa7210edfb5ca1e8a60eb8975f50fda21c9b14deaa9c57ebaa9d20cfb8ae9b94bd2556f26dff9983b134d9bc650d335e545b3751c0c40e484e1490377
|
data/lib/code_quality/version.rb
CHANGED
data/lib/tasks/code_quality.rake
CHANGED
@@ -184,8 +184,10 @@ namespace :code_quality do
|
|
184
184
|
if options[option_key]
|
185
185
|
detected_offenses = report_result[metric.to_sym][:total].to_s.match(pattern)[1].to_i rescue 0
|
186
186
|
max_offenses = options[option_key].to_i
|
187
|
-
|
188
|
-
|
187
|
+
if detected_offenses > max_offenses
|
188
|
+
puts "Metric #{colorize(metric, :green)} detected offenses #{colorize(detected_offenses, :yellow)} is more then #{colorize(max_offenses, :yellow)}, must improve your code quality or set a lower #{colorize(option_key, :black, :white)}"
|
189
|
+
audit_failures << {metric: metric, detected_offenses: detected_offenses, max_offenses: max_offenses}
|
190
|
+
end
|
189
191
|
end
|
190
192
|
end
|
191
193
|
audit_faild "#{audit_failures.size} of #{selected_metrics.size} metrics audit failed" if audit_failures.any?
|