flog 3.2.2 → 3.2.3
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.
- data.tar.gz.sig +0 -0
- data/History.txt +6 -0
- data/lib/flog.rb +11 -5
- metadata +8 -8
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/lib/flog.rb
CHANGED
@@ -13,7 +13,7 @@ class File
|
|
13
13
|
end
|
14
14
|
|
15
15
|
class Flog < SexpProcessor
|
16
|
-
VERSION = "3.2.
|
16
|
+
VERSION = "3.2.3"
|
17
17
|
|
18
18
|
THRESHOLD = 0.60
|
19
19
|
SCORES = Hash.new 1
|
@@ -251,6 +251,8 @@ class Flog < SexpProcessor
|
|
251
251
|
files = Flog.expand_dirs_to_files(*files_or_dirs)
|
252
252
|
|
253
253
|
files.each do |file|
|
254
|
+
next unless file == '-' or File.readable? file
|
255
|
+
|
254
256
|
ruby = file == '-' ? $stdin.read : File.binread(file)
|
255
257
|
|
256
258
|
flog_ruby ruby, file
|
@@ -574,13 +576,17 @@ class Flog < SexpProcessor
|
|
574
576
|
add_to_score :block_pass
|
575
577
|
|
576
578
|
case arg.first
|
577
|
-
when :lvar, :dvar, :ivar, :cvar, :self, :const, :colon2, :nil then
|
579
|
+
when :lvar, :dvar, :ivar, :cvar, :self, :const, :colon2, :nil then # f(&b)
|
578
580
|
# do nothing
|
579
|
-
when :lit, :call then
|
581
|
+
when :lit, :call then # f(&:b)
|
580
582
|
add_to_score :to_proc_normal
|
581
|
-
when :lasgn then
|
583
|
+
when :lasgn then # f(&l=b)
|
582
584
|
add_to_score :to_proc_lasgn
|
583
|
-
when :iter, :dsym, :dstr, *BRANCHING then
|
585
|
+
when :iter, :dsym, :dstr, *BRANCHING then # below
|
586
|
+
# f(&proc { ... })
|
587
|
+
# f(&"#{...}")
|
588
|
+
# f(&:"#{...}")
|
589
|
+
# f(&if ... then ... end") and all other branching forms
|
584
590
|
add_to_score :to_proc_icky!
|
585
591
|
else
|
586
592
|
raise({:block_pass_even_ickier! => arg}.inspect)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 3.2.
|
9
|
+
- 3
|
10
|
+
version: 3.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2013-
|
39
|
+
date: 2013-03-21 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sexp_processor
|
@@ -84,11 +84,11 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
hash:
|
87
|
+
hash: 21
|
88
88
|
segments:
|
89
89
|
- 4
|
90
|
-
-
|
91
|
-
version: "4.
|
90
|
+
- 7
|
91
|
+
version: "4.7"
|
92
92
|
type: :development
|
93
93
|
version_requirements: *id003
|
94
94
|
- !ruby/object:Gem::Dependency
|
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
176
|
requirements: []
|
177
177
|
|
178
178
|
rubyforge_project: seattlerb
|
179
|
-
rubygems_version: 1.8.
|
179
|
+
rubygems_version: 1.8.25
|
180
180
|
signing_key:
|
181
181
|
specification_version: 3
|
182
182
|
summary: Flog reports the most tortured code in an easy to read pain report
|
metadata.gz.sig
CHANGED
Binary file
|