flog 4.6.3 → 4.6.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71073335bad47948fc2c595a09ae883aeb2fbc119056c9ddd9922c374d278199
4
- data.tar.gz: 5c224d4e435702cd05363f78a5103139f43aed18a6e257c50f6917215bdd2ffa
3
+ metadata.gz: e8f844d48c5a305a1d8faf442235c38c9a90c38fa75a877358f6b510aaab4283
4
+ data.tar.gz: 88823e4811831f69f7b1a6d4b4a863a9e07c3646ceb2037329d6f367c85e3bce
5
5
  SHA512:
6
- metadata.gz: da67084a75b7bbff54bb536abaeaac2b63be971cd1d11b74cafd340175b70a2a0d149d840300cd920100c2e691d5e68ed95a72f8fe1c80602def3647f761c0d3
7
- data.tar.gz: 2b2b77800a343ae038ebe6499720bc7fcc18f3fff899c07c5d14c011f1456d4d2d8bceab33da9ce6ceff8d7c96d907942842696812081d0d1bd7293ff9357bd7
6
+ metadata.gz: aa7e986e752d38e6cb1f23752d777fdae88c9092c1c8068bc162ad1708a5bad54f394972fee904ce24faa1ed84bcb41104307546956742e444e7631c9115b2d0
7
+ data.tar.gz: 329c9e9d94b6a7df410e40fd3f013a32f6e22908819f4c8c66ce22ed2b3c98699163d8d636290df2ec46ca9a345bdeeef97ef33cafcee81187df4dfb0edca81d
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,10 @@
1
+ === 4.6.4 / 2019-12-14
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Added basic support for safe_call (nic-potter).
6
+ * Added extra complexity penalty to safe_call processing.
7
+
1
8
  === 4.6.3 / 2019-09-14
2
9
 
3
10
  * 1 minor enhancement:
@@ -11,7 +11,7 @@ class File
11
11
  end
12
12
 
13
13
  class Flog < MethodBasedSexpProcessor
14
- VERSION = "4.6.3" # :nodoc:
14
+ VERSION = "4.6.4" # :nodoc:
15
15
 
16
16
  ##
17
17
  # Cut off point where the report should stop unless --all given.
@@ -402,6 +402,22 @@ class Flog < MethodBasedSexpProcessor
402
402
  s()
403
403
  end
404
404
 
405
+ def process_safe_call(exp)
406
+ penalize_by 0.3 do
407
+ process exp.shift # recv
408
+ end
409
+
410
+ name = exp.shift
411
+
412
+ penalize_by 0.2 do
413
+ process_until_empty exp
414
+ end
415
+
416
+ add_to_score name, SCORES[name]
417
+
418
+ s()
419
+ end
420
+
405
421
  def process_case(exp)
406
422
  add_to_score :branch
407
423
  process exp.shift # recv
@@ -186,10 +186,31 @@ class TestFlog < FlogTest
186
186
  end
187
187
 
188
188
  def test_process_call
189
- sexp = s(:call, nil, :a)
189
+ sexp = s(:call, nil, :a) # a
190
190
  assert_process sexp, 1.0, :a => 1.0
191
191
  end
192
192
 
193
+ def test_process_call2
194
+ sexp = s(:call, s(:call, nil, :a), :b) # a.b
195
+ assert_process sexp, 2.2, :a => 1.2, :b => 1.0
196
+ end
197
+
198
+ def test_process_call3
199
+ sexp = s(:call, s(:call, s(:call, nil, :a), :b), :c) # a.b.c
200
+ assert_process sexp, 3.6, :a => 1.4, :b => 1.2, :c => 1.0
201
+ end
202
+
203
+ def test_process_safe_call2
204
+ sexp = s(:safe_call, s(:call, nil, :a), :b) # a&.b
205
+ assert_process sexp, 2.3, :a => 1.3, :b => 1.0
206
+ end
207
+
208
+ def test_process_safe_call3
209
+ sexp = s(:safe_call, s(:safe_call, s(:call, nil, :a), :b), :c) # a&.b&.c
210
+
211
+ assert_process sexp, 3.9, :a => 1.6, :b => 1.3, :c => 1.0
212
+ end
213
+
193
214
  def test_process_case
194
215
  case :a
195
216
  when :a
@@ -351,6 +372,19 @@ class TestFlog < FlogTest
351
372
  assert_process sexp, 2.3, :something => 1.0, :task => 1.0, :lit_fixnum => 0.3
352
373
  end
353
374
 
375
+ def test_process_iter_dsl_hash_when_hash_empty
376
+ # task({}) do
377
+ # something
378
+ # end
379
+
380
+ sexp = s(:iter,
381
+ s(:call, nil, :task, s(:hash)),
382
+ nil,
383
+ s(:call, nil, :something))
384
+
385
+ assert_process sexp, 2.326, :something => 1.1, :task => 1.0, :branch => 1
386
+ end
387
+
354
388
  def test_process_iter_dsl_namespaced
355
389
  # namespace :blah do
356
390
  # task :woot => 42 do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flog
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.3
4
+ version: 4.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDPjCCAiagAwIBAgIBAzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBBDANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
14
14
  ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
15
- GRYDY29tMB4XDTE4MTIwNDIxMzAxNFoXDTE5MTIwNDIxMzAxNFowRTETMBEGA1UE
15
+ GRYDY29tMB4XDTE5MTIxMzAwMDIwNFoXDTIwMTIxMjAwMDIwNFowRTETMBEGA1UE
16
16
  AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
17
17
  JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
18
18
  b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
@@ -22,14 +22,14 @@ cert_chain:
22
22
  qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
23
23
  gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
24
24
  HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBCwUAA4IB
25
- AQCbJwLmpJR2PomLU+Zzw3KRzH/hbyUWc/ftru71AopZ1fy4iY9J/BW5QYKVYwbP
26
- V0FSBWtvfI/RdwfKGtuGhPKECZgmLieGuZ3XCc09qPu1bdg7i/tu1p0t0c6163ku
27
- nDMDIC/t/DAFK0TY9I3HswuyZGbLW7rgF0DmiuZdN/RPhHq2pOLMLXJmFclCb/im
28
- 9yToml/06TJdUJ5p64mkBs0TzaK66DIB1Smd3PdtfZqoRV+EwaXMdx0Hb3zdR1JR
29
- Em82dBUFsipwMLCYj39kcyHWAxyl6Ae1Cn9r/ItVBCxoeFdrHjfavnrIEoXUt4bU
30
- UfBugfLD19bu3nvL+zTAGx/U
25
+ AQCkkcHqAa6IKLYGl93rn78J3L+LnqyxaA059n4IGMHWN5bv9KBQnIjOrpLadtYZ
26
+ vhWkunWDKdfVapBEq5+T4HzqnsEXC3aCv6JEKJY6Zw7iSzl0M8hozuzRr+w46wvT
27
+ fV2yTN6QTVxqbMsJJyjosks4ZdQYov2zdvQpt1HsLi+Qmckmg8SPZsd+T8uiiBCf
28
+ b+1ORSM5eEfBQenPXy83LZcoQz8i6zVB4aAfTGGdhxjoMGUEmSZ6xpkOzmnGa9QK
29
+ m5x9IDiApM+vCELNwDXXGNFEnQBBK+wAe4Pek8o1V1TTOxL1kGPewVOitX1p3xoN
30
+ h7iEjga8iM1LbZUfiISZ+WrB
31
31
  -----END CERTIFICATE-----
32
- date: 2019-09-15 00:00:00.000000000 Z
32
+ date: 2019-12-15 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: sexp_processor
@@ -105,14 +105,14 @@ dependencies:
105
105
  requirements:
106
106
  - - "~>"
107
107
  - !ruby/object:Gem::Version
108
- version: '3.18'
108
+ version: '3.20'
109
109
  type: :development
110
110
  prerelease: false
111
111
  version_requirements: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: '3.18'
115
+ version: '3.20'
116
116
  description: |-
117
117
  Flog reports the most tortured code in an easy to read pain
118
118
  report. The higher the score, the more pain the code is in.
@@ -141,7 +141,9 @@ files:
141
141
  homepage: http://ruby.sadi.st/
142
142
  licenses:
143
143
  - MIT
144
- metadata: {}
144
+ metadata:
145
+ homepage_uri: http://ruby.sadi.st/
146
+ source_code_uri: https://github.com/seattlerb/flog
145
147
  post_install_message:
146
148
  rdoc_options:
147
149
  - "--main"
@@ -159,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
161
  - !ruby/object:Gem::Version
160
162
  version: '0'
161
163
  requirements: []
162
- rubygems_version: 3.0.6
164
+ rubygems_version: 3.0.3
163
165
  signing_key:
164
166
  specification_version: 4
165
167
  summary: Flog reports the most tortured code in an easy to read pain report
metadata.gz.sig CHANGED
Binary file