flog 4.7.0 → 4.8.0
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
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +11 -0
- data/Rakefile +3 -1
- data/lib/flog.rb +9 -8
- data/lib/flog_cli.rb +11 -4
- data/lib/flog_task.rb +4 -0
- data.tar.gz.sig +1 -1
- metadata +2 -2
- metadata.gz.sig +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad09cd2ae98738c0d08e2e366636604774c3ae81a38c15e1feec23220b392243
|
4
|
+
data.tar.gz: b5e85e4f01c0d0297a3c929c93bab48bf393d813a048e34a6808353c1f56cfaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51a2c880e819dc4e31e62a94b990176f2d83fb755b78c5e0c84dcefa95ee1a87b5f4a2e610ad5af2e0e9986921c01b5e528f0e452c788e3c940c579e1b6a0273
|
7
|
+
data.tar.gz: b01ab52f28fcf8ee2c57927586abfc8e7c36bbb982e1e4c0ab2a8a8c1c367c00a48b0bd81c1f1ba96425c39f57bca5923e8a5a0d365af2453fec8cc93e24f8bf
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/History.rdoc
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
=== 4.8.0 / 2023-09-28
|
2
|
+
|
3
|
+
* 2 minor enhancements:
|
4
|
+
|
5
|
+
* Added ability to pass down option overrides through Flog.run.
|
6
|
+
* Removed ancient File.binread alias.
|
7
|
+
|
8
|
+
* 1 bug fix:
|
9
|
+
|
10
|
+
* Added missing rdoc.
|
11
|
+
|
1
12
|
=== 4.7.0 / 2023-07-18
|
2
13
|
|
3
14
|
* 3 minor enhancements:
|
data/Rakefile
CHANGED
@@ -40,17 +40,19 @@ task :debug do
|
|
40
40
|
file = ENV["F"]
|
41
41
|
ruby = ENV["R"]
|
42
42
|
details = ENV["D"]
|
43
|
+
continue = ENV["C"]
|
43
44
|
|
44
45
|
flog = FlogCLI.new :parser => RubyParser
|
45
46
|
|
46
47
|
flog.option[:details] = true if details
|
48
|
+
flog.option[:continue] = true if continue
|
47
49
|
|
48
50
|
if file then
|
49
51
|
if File.directory? file then # quick hack to get directory scanning going
|
50
52
|
argv = [file]
|
51
53
|
argv.unshift "-v" if ENV["V"]
|
52
54
|
|
53
|
-
FlogCLI.run argv
|
55
|
+
FlogCLI.run argv, flog.option
|
54
56
|
exit 0
|
55
57
|
end
|
56
58
|
flog.flog file
|
data/lib/flog.rb
CHANGED
@@ -2,16 +2,17 @@ require "sexp_processor"
|
|
2
2
|
require "ruby_parser"
|
3
3
|
require "timeout"
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
##
|
6
|
+
# Flog is a SexpProcessor that calculates a ABC (assignments,
|
7
|
+
# branches, conditionals) complexity metric with some ruby-aware
|
8
|
+
# enhancements and a compounding penalty for increasing depth.
|
9
|
+
#
|
10
|
+
# In essence, this calculates the most tortured code. The higher the
|
11
|
+
# score, the more pain the code is in and the harder it is to
|
12
|
+
# thoroughly test.
|
12
13
|
|
13
14
|
class Flog < MethodBasedSexpProcessor
|
14
|
-
VERSION = "4.
|
15
|
+
VERSION = "4.8.0" # :nodoc:
|
15
16
|
|
16
17
|
##
|
17
18
|
# Cut off point where the report should stop unless --all given.
|
data/lib/flog_cli.rb
CHANGED
@@ -5,6 +5,10 @@ require "forwardable"
|
|
5
5
|
require "path_expander"
|
6
6
|
require "flog"
|
7
7
|
|
8
|
+
##
|
9
|
+
# This is the CLI interface for Flog, responsible for processing
|
10
|
+
# options, finding files, loading plugins, and reporting results.
|
11
|
+
|
8
12
|
class FlogCLI
|
9
13
|
extend Forwardable
|
10
14
|
|
@@ -13,13 +17,16 @@ class FlogCLI
|
|
13
17
|
def_delegators :@flog, :threshold, :total_score, :no_method, :calculate_total_scores
|
14
18
|
def_delegators :@flog, :max_method
|
15
19
|
|
16
|
-
|
20
|
+
##
|
21
|
+
# This kicks off the whole thing.
|
22
|
+
|
23
|
+
def self.run args = ARGV, extra = {}
|
17
24
|
load_plugins
|
18
25
|
|
19
26
|
expander = PathExpander.new args, "**/*.{rb,rake}"
|
20
27
|
files = expander.process
|
21
28
|
|
22
|
-
options = parse_options args
|
29
|
+
options = parse_options args, extra
|
23
30
|
|
24
31
|
abort "no files or stdin (-) to process, aborting." if
|
25
32
|
files.empty? and args.empty?
|
@@ -66,12 +73,12 @@ class FlogCLI
|
|
66
73
|
##
|
67
74
|
# Parse options in +args+ (defaults to ARGV).
|
68
75
|
|
69
|
-
def self.parse_options args = ARGV
|
76
|
+
def self.parse_options args = ARGV, extra_options = {}
|
70
77
|
option = {
|
71
78
|
:quiet => false,
|
72
79
|
:continue => false,
|
73
80
|
:parser => RubyParser,
|
74
|
-
}
|
81
|
+
}.merge extra_options
|
75
82
|
|
76
83
|
OptionParser.new do |opts|
|
77
84
|
opts.separator "Standard options:"
|
data/lib/flog_task.rb
CHANGED
data.tar.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
9Pe��:�:���2s:cd[&+:��u^j��:�r*��1���(nF�p�ϭW�_ ���GJ=>�b�"ٙ���Q�Fϙ��-�<g�"zXfx�I�UDϦ�h�]��2n0��p<�c�O�/�Y�IP�rhD�u-�I�W��4�"y%�Q,r��S��U;��bW>��K�>��M��/ص)�O$zC�m�����i-x8���(�*sS�ƫ!����ʈ8ؾk�sJ^���tއ�oxb�\al�iz��
|
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.
|
4
|
+
version: 4.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
ROfWo9Uyp8ba/j9eVG14KkYRaLydAY1MNQk2yd3R5CGfeOpD1kttxjoypoUJ2dOG
|
30
30
|
nsNBRuQJ1UfiCG97a6DNm+Fr
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2023-
|
32
|
+
date: 2023-09-28 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: sexp_processor
|
metadata.gz.sig
CHANGED