rubycritic 4.4.1 → 4.6.1
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
- data/CHANGELOG.md +33 -1
- data/CONTRIBUTING.md +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +8 -8
- data/ROADMAP.md +0 -0
- data/Rakefile +0 -0
- data/lib/rubycritic.rb +0 -0
- data/lib/rubycritic/analysers/attributes.rb +0 -0
- data/lib/rubycritic/analysers/churn.rb +0 -0
- data/lib/rubycritic/analysers/complexity.rb +0 -0
- data/lib/rubycritic/analysers/coverage.rb +34 -28
- data/lib/rubycritic/analysers/helpers/ast_node.rb +0 -0
- data/lib/rubycritic/analysers/helpers/flay.rb +0 -0
- data/lib/rubycritic/analysers/helpers/flog.rb +0 -0
- data/lib/rubycritic/analysers/helpers/methods_counter.rb +0 -0
- data/lib/rubycritic/analysers/helpers/modules_locator.rb +0 -0
- data/lib/rubycritic/analysers/helpers/parser.rb +0 -0
- data/lib/rubycritic/analysers/helpers/reek.rb +0 -0
- data/lib/rubycritic/analysers/smells/flay.rb +0 -0
- data/lib/rubycritic/analysers/smells/flog.rb +0 -0
- data/lib/rubycritic/analysers/smells/reek.rb +0 -0
- data/lib/rubycritic/analysers_runner.rb +0 -0
- data/lib/rubycritic/analysis_summary.rb +0 -0
- data/lib/rubycritic/browser.rb +0 -0
- data/lib/rubycritic/cli/application.rb +0 -0
- data/lib/rubycritic/cli/options.rb +0 -0
- data/lib/rubycritic/cli/options/argv.rb +8 -1
- data/lib/rubycritic/cli/options/file.rb +0 -0
- data/lib/rubycritic/colorize.rb +0 -0
- data/lib/rubycritic/command_factory.rb +0 -0
- data/lib/rubycritic/commands/base.rb +0 -0
- data/lib/rubycritic/commands/ci.rb +0 -0
- data/lib/rubycritic/commands/compare.rb +3 -2
- data/lib/rubycritic/commands/default.rb +0 -0
- data/lib/rubycritic/commands/help.rb +0 -0
- data/lib/rubycritic/commands/status_reporter.rb +0 -0
- data/lib/rubycritic/commands/utils/build_number_file.rb +0 -0
- data/lib/rubycritic/commands/version.rb +0 -0
- data/lib/rubycritic/configuration.rb +14 -5
- data/lib/rubycritic/core/analysed_module.rb +0 -0
- data/lib/rubycritic/core/analysed_modules_collection.rb +0 -0
- data/lib/rubycritic/core/location.rb +0 -0
- data/lib/rubycritic/core/rating.rb +0 -0
- data/lib/rubycritic/core/smell.rb +0 -0
- data/lib/rubycritic/generators/console_report.rb +0 -0
- data/lib/rubycritic/generators/html/assets/javascripts/application.js +0 -0
- data/lib/rubycritic/generators/html/assets/stylesheets/application.css +1 -1
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/FontAwesome.otf +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.eot +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.svg +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.ttf +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.woff +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.woff2 +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.eot +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.svg +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.ttf +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.woff +0 -0
- data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.woff2 +0 -0
- data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/bootstrap.min.js +0 -0
- data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/highcharts.src-4.0.1.js +0 -0
- data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.filtertable.min.js +0 -0
- data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.min.js +0 -0
- data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.scrollTo.min.js +0 -0
- data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.tablesorter.js +0 -0
- data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.tablesorter.min.js +0 -0
- data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.timeago.js +0 -0
- data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/prettify.js +0 -0
- data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/bootstrap.min.css +0 -0
- data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/font-awesome.min.css +0 -0
- data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/prettify.css +0 -0
- data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/prettify.custom_theme.css +0 -0
- data/lib/rubycritic/generators/html/base.rb +0 -0
- data/lib/rubycritic/generators/html/code_file.rb +0 -0
- data/lib/rubycritic/generators/html/code_index.rb +0 -0
- data/lib/rubycritic/generators/html/line.rb +0 -0
- data/lib/rubycritic/generators/html/overview.rb +0 -0
- data/lib/rubycritic/generators/html/simple_cov_index.rb +0 -0
- data/lib/rubycritic/generators/html/smells_index.rb +0 -0
- data/lib/rubycritic/generators/html/templates/code_file.html.erb +0 -0
- data/lib/rubycritic/generators/html/templates/code_index.html.erb +0 -0
- data/lib/rubycritic/generators/html/templates/layouts/application.html.erb +14 -14
- data/lib/rubycritic/generators/html/templates/line.html.erb +0 -0
- data/lib/rubycritic/generators/html/templates/overview.html.erb +0 -0
- data/lib/rubycritic/generators/html/templates/simple_cov_index.html.erb +0 -0
- data/lib/rubycritic/generators/html/templates/smells_index.html.erb +0 -0
- data/lib/rubycritic/generators/html/templates/smelly_line.html.erb +0 -0
- data/lib/rubycritic/generators/html/turbulence.rb +0 -0
- data/lib/rubycritic/generators/html/view_helpers.rb +0 -12
- data/lib/rubycritic/generators/html_report.rb +0 -0
- data/lib/rubycritic/generators/json/simple.rb +0 -0
- data/lib/rubycritic/generators/json_report.rb +0 -0
- data/lib/rubycritic/generators/lint_report.rb +0 -0
- data/lib/rubycritic/generators/text/lint.rb +0 -0
- data/lib/rubycritic/generators/text/list.rb +0 -0
- data/lib/rubycritic/generators/text/templates/lint.erb +0 -0
- data/lib/rubycritic/generators/text/templates/list.erb +0 -0
- data/lib/rubycritic/rake_task.rb +0 -0
- data/lib/rubycritic/reporter.rb +0 -0
- data/lib/rubycritic/revision_comparator.rb +0 -0
- data/lib/rubycritic/serializer.rb +0 -0
- data/lib/rubycritic/smells_status_setter.rb +0 -0
- data/lib/rubycritic/source_control_systems/base.rb +1 -1
- data/lib/rubycritic/source_control_systems/double.rb +0 -0
- data/lib/rubycritic/source_control_systems/git.rb +1 -1
- data/lib/rubycritic/source_control_systems/git/churn.rb +9 -3
- data/lib/rubycritic/source_control_systems/mercurial.rb +0 -0
- data/lib/rubycritic/source_control_systems/perforce.rb +0 -0
- data/lib/rubycritic/source_locator.rb +0 -0
- data/lib/rubycritic/version.rb +1 -1
- metadata +114 -92
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4cdf1485043408cdfbf9a8a0a468f7b20163c2bd982314547d733aca7d185d88
|
|
4
|
+
data.tar.gz: 365505ba0aedce90a370be8a8ccdc8277f33c2b637c8e1e22f350530240d9889
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e5718fea056a233dcaab942dfe0529230d371ff1ef6fb71711283535c9aa85aab5cd07be697ec97d605574fbce7329e60f69aa608ca0504b54df094c5b65c46
|
|
7
|
+
data.tar.gz: 301500666e876676cc4caeaa2be96ed33b863dd7cad8b47b8f35461f665b7bc3ae66aa3fe3522466d5f42be679b525625bbe8c3b381da4c9015556c8b2bed348
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.6.1...main)
|
|
2
|
+
|
|
3
|
+
# v4.6.0 / 2021-01-28 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.6.0...v4.6.1)
|
|
4
|
+
|
|
5
|
+
* [CHANGE] CI: Drop rbx-3 from matrix, does not install (by [@olleolleolle][])
|
|
6
|
+
* [CHANGE] Add support for Ruby 3.0 (by [@etagwerker][])
|
|
7
|
+
* [BUGFIX] Fix images on readme (by [@borisrorsvort][])
|
|
8
|
+
|
|
9
|
+
# v4.6.0 / 2021-01-28 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.5.2...v4.6.0)
|
|
10
|
+
|
|
11
|
+
* [CHANGE] Fix rubocop offenses (by [@sl4vr][])
|
|
12
|
+
* [CHANGE] Make Github Linguist ignore vendored files (by [@sl4vr][])
|
|
13
|
+
* [BUGFIX] Fix directory structure of reports when comparing branches (by [@denny][])
|
|
14
|
+
* [BUGFIX] Restrict simplecov to versions before data format changed (by [@denny][])
|
|
15
|
+
|
|
16
|
+
# v4.5.2 / 2020-08-20 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.5.1...v4.5.2)
|
|
17
|
+
|
|
18
|
+
* [BUGFIX] Handle simplecov v0.19 and install appraisal (by [@MZiserman][])
|
|
19
|
+
|
|
20
|
+
# v4.5.1 / 2020-06-29 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.5.0...v4.5.1)
|
|
21
|
+
|
|
22
|
+
* [BUGFIX] Handle git --name-status Copied (C) operation (by [@rizalmuthi][])
|
|
23
|
+
|
|
24
|
+
* [FEATURE] Add --churn-after (only supports git) to limit churn analysis to recent history (by [@jackcasey][])
|
|
25
|
+
|
|
26
|
+
# v4.5.0 / 2020-05-14 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.4.1...v4.5.0)
|
|
27
|
+
|
|
28
|
+
* [CHANGE] Relax `launchy` version dependency requirement
|
|
29
|
+
* [CHANGE] Drop support for ruby 2.3 (by [@joshrpowell][])
|
|
30
|
+
* [CHANGE] Update Reek dependency to '~> 6.0', '< 7.0' (by [@joshrpowell][])
|
|
2
31
|
|
|
3
32
|
# v4.4.1 / 2020-02-20 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.4.0...v4.4.1)
|
|
4
33
|
|
|
@@ -334,3 +363,6 @@
|
|
|
334
363
|
[@GeoffTidey]: https://github.com/GeoffTidey
|
|
335
364
|
[@lloydwatkin]: https://github.com/lloydwatkin
|
|
336
365
|
[@Flink]: https://github.com/Flink
|
|
366
|
+
[@jackcasey]: https://github.com/jackcasey
|
|
367
|
+
[@sl4vr]: https://github.com/sl4vr
|
|
368
|
+
[@denny]: https://github.com/denny
|
data/CONTRIBUTING.md
CHANGED
|
File without changes
|
data/Gemfile
CHANGED
|
File without changes
|
data/LICENSE.txt
CHANGED
|
File without changes
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://travis-ci.org/whitesmith/rubycritic)
|
|
5
5
|
[](https://codeclimate.com/github/whitesmith/rubycritic)
|
|
6
6
|
|
|
7
|
-
<img src="https://github.com/whitesmith/rubycritic/raw/
|
|
7
|
+
<img src="https://github.com/whitesmith/rubycritic/raw/main/images/logo.png" alt="RubyCritic Icon" align="right">
|
|
8
8
|
|
|
9
9
|
RubyCritic is a gem that wraps around static analysis gems such as [Reek][1], [Flay][2] and [Flog][3] to provide a quality report of your Ruby code.
|
|
10
10
|
|
|
@@ -27,15 +27,15 @@ This gem provides features such as:
|
|
|
27
27
|
|
|
28
28
|
1. An overview of your project:
|
|
29
29
|
|
|
30
|
-

|
|
31
31
|
|
|
32
32
|
2. An index of the project files with their respective number of smells:
|
|
33
33
|
|
|
34
|
-

|
|
35
35
|
|
|
36
36
|
3. An index of the smells detected:
|
|
37
37
|
|
|
38
|
-

|
|
39
39
|
|
|
40
40
|
4. When analysing code like the following:
|
|
41
41
|
|
|
@@ -51,11 +51,11 @@ This gem provides features such as:
|
|
|
51
51
|
|
|
52
52
|
It basically turns something like this:
|
|
53
53
|
|
|
54
|
-

|
|
55
55
|
|
|
56
56
|
Into something like this:
|
|
57
57
|
|
|
58
|
-

|
|
59
59
|
|
|
60
60
|
5. It uses your source control system (only Git, Mercurial and Perforce
|
|
61
61
|
are currently supported) to compare your currently uncommitted
|
|
@@ -216,10 +216,10 @@ See [formatters](docs/formatters.md)
|
|
|
216
216
|
|
|
217
217
|
RubyCritic is supporting Ruby versions:
|
|
218
218
|
|
|
219
|
-
* 2.3
|
|
220
219
|
* 2.4
|
|
221
220
|
* 2.5
|
|
222
221
|
* 2.6
|
|
222
|
+
* 2.7
|
|
223
223
|
|
|
224
224
|
## Improving RubyCritic
|
|
225
225
|
|
|
@@ -243,7 +243,7 @@ The current core team consists of:
|
|
|
243
243
|
|
|
244
244
|
## Credits
|
|
245
245
|
|
|
246
|
-

|
|
247
247
|
|
|
248
248
|
RubyCritic is maintained and funded by [Whitesmith][9]. Tweet your questions or suggestions to [@Whitesmithco][10].
|
|
249
249
|
|
data/ROADMAP.md
CHANGED
|
File without changes
|
data/Rakefile
CHANGED
|
File without changes
|
data/lib/rubycritic.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -9,6 +9,8 @@ module RubyCritic
|
|
|
9
9
|
class Coverage
|
|
10
10
|
include Colorize
|
|
11
11
|
|
|
12
|
+
RESULTSET_FILENAME = '.resultset.json'
|
|
13
|
+
|
|
12
14
|
def initialize(analysed_modules)
|
|
13
15
|
@analysed_modules = analysed_modules
|
|
14
16
|
@result = results.first
|
|
@@ -44,30 +46,28 @@ module RubyCritic
|
|
|
44
46
|
@result.source_files.detect { |file| file.filename == needle }
|
|
45
47
|
end
|
|
46
48
|
|
|
47
|
-
# The path to the
|
|
49
|
+
# The path to the cache file
|
|
48
50
|
def resultset_path
|
|
49
|
-
File.join(SimpleCov.coverage_path,
|
|
51
|
+
File.join(SimpleCov.coverage_path, RESULTSET_FILENAME)
|
|
50
52
|
end
|
|
51
53
|
|
|
52
54
|
def resultset_writelock
|
|
53
|
-
|
|
55
|
+
"#{resultset_path}.lock"
|
|
54
56
|
end
|
|
55
57
|
|
|
56
58
|
# Loads the cached resultset from JSON and returns it as a Hash,
|
|
57
59
|
# caching it for subsequent accesses.
|
|
58
60
|
def resultset
|
|
59
|
-
@resultset ||=
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
end
|
|
70
|
-
end
|
|
61
|
+
@resultset ||= parse_resultset(stored_data)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def parse_resultset(data)
|
|
65
|
+
return {} unless data
|
|
66
|
+
|
|
67
|
+
JSON.parse(data) || {}
|
|
68
|
+
rescue JSON::ParserError => err
|
|
69
|
+
puts "Error: Loading #{RESULTSET_FILENAME}: #{err.message}"
|
|
70
|
+
{}
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
# Returns the contents of the resultset cache as a string or if the file is missing or empty nil
|
|
@@ -85,21 +85,23 @@ module RubyCritic
|
|
|
85
85
|
|
|
86
86
|
# Ensure only one process is reading or writing the resultset at any
|
|
87
87
|
# given time
|
|
88
|
-
def synchronize_resultset
|
|
88
|
+
def synchronize_resultset(&proc)
|
|
89
89
|
# make it reentrant
|
|
90
90
|
return yield if defined?(@resultset_locked) && @resultset_locked == true
|
|
91
91
|
|
|
92
92
|
return yield unless File.exist?(resultset_writelock)
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
with_lock(&proc)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def with_lock
|
|
98
|
+
@resultset_locked = true
|
|
99
|
+
File.open(resultset_writelock, 'w+') do |file|
|
|
100
|
+
file.flock(File::LOCK_EX)
|
|
101
|
+
yield
|
|
102
102
|
end
|
|
103
|
+
ensure
|
|
104
|
+
@resultset_locked = false
|
|
103
105
|
end
|
|
104
106
|
|
|
105
107
|
# Gets the resultset hash and re-creates all included instances
|
|
@@ -107,11 +109,15 @@ module RubyCritic
|
|
|
107
109
|
# All results that are above the SimpleCov.merge_timeout will be
|
|
108
110
|
# dropped. Returns an array of SimpleCov::Result items.
|
|
109
111
|
def results
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
if Gem.loaded_specs['simplecov'].version >= Gem::Version.new('0.19')
|
|
113
|
+
::SimpleCov::Result.from_hash(resultset)
|
|
114
|
+
else
|
|
115
|
+
array = []
|
|
116
|
+
resultset.each do |command_name, data|
|
|
117
|
+
array << ::SimpleCov::Result.from_hash(command_name => data)
|
|
118
|
+
end
|
|
119
|
+
array
|
|
113
120
|
end
|
|
114
|
-
array
|
|
115
121
|
end
|
|
116
122
|
end
|
|
117
123
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/rubycritic/browser.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -70,6 +70,12 @@ module RubyCritic
|
|
|
70
70
|
self.minimum_score = Float(min_score)
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
+
opts.on('--churn-after [DATE]', 'Only count churn from a certain date.',
|
|
74
|
+
'The date is passed through to version control (currently git only).',
|
|
75
|
+
'Example: 2017-01-01') do |churn_after|
|
|
76
|
+
self.churn_after = churn_after
|
|
77
|
+
end
|
|
78
|
+
|
|
73
79
|
opts.on('-m', '--mode-ci [BASE_BRANCH]',
|
|
74
80
|
'Use CI mode (faster, analyses diffs w.r.t base_branch (default: master))') do |branch|
|
|
75
81
|
self.base_branch = branch || 'master'
|
|
@@ -110,6 +116,7 @@ module RubyCritic
|
|
|
110
116
|
suppress_ratings: suppress_ratings,
|
|
111
117
|
help_text: parser.help,
|
|
112
118
|
minimum_score: minimum_score,
|
|
119
|
+
churn_after: churn_after,
|
|
113
120
|
no_browser: no_browser,
|
|
114
121
|
base_branch: base_branch,
|
|
115
122
|
feature_branch: feature_branch,
|
|
@@ -121,7 +128,7 @@ module RubyCritic
|
|
|
121
128
|
private
|
|
122
129
|
|
|
123
130
|
attr_accessor :mode, :root, :formats, :formatters, :deduplicate_symlinks,
|
|
124
|
-
:suppress_ratings, :minimum_score, :no_browser,
|
|
131
|
+
:suppress_ratings, :minimum_score, :churn_after, :no_browser,
|
|
125
132
|
:parser, :base_branch, :feature_branch, :threshold_score
|
|
126
133
|
def paths
|
|
127
134
|
@argv unless @argv.empty?
|
|
File without changes
|
data/lib/rubycritic/colorize.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -13,6 +13,7 @@ module RubyCritic
|
|
|
13
13
|
class Compare < Default
|
|
14
14
|
def initialize(options)
|
|
15
15
|
super
|
|
16
|
+
@original_config_root = Config.root
|
|
16
17
|
@build_number = 0
|
|
17
18
|
end
|
|
18
19
|
|
|
@@ -57,7 +58,7 @@ module RubyCritic
|
|
|
57
58
|
def analyse_modified_files
|
|
58
59
|
modified_files = Config.feature_branch_collection.where(SourceControlSystem::Git.modified_files)
|
|
59
60
|
analysed_modules = AnalysedModulesCollection.new(modified_files.map(&:path), modified_files)
|
|
60
|
-
Config.root =
|
|
61
|
+
Config.root = Config.compare_root_directory
|
|
61
62
|
report(analysed_modules)
|
|
62
63
|
end
|
|
63
64
|
|
|
@@ -85,7 +86,7 @@ module RubyCritic
|
|
|
85
86
|
end
|
|
86
87
|
|
|
87
88
|
def branch_directory(branch)
|
|
88
|
-
"#{
|
|
89
|
+
"#{@original_config_root}/compare/#{Config.send(branch)}"
|
|
89
90
|
end
|
|
90
91
|
|
|
91
92
|
# create a txt file with the branch score details
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -10,7 +10,7 @@ module RubyCritic
|
|
|
10
10
|
:feature_branch, :base_branch_score, :feature_branch_score,
|
|
11
11
|
:base_root_directory, :feature_root_directory,
|
|
12
12
|
:compare_root_directory, :threshold_score, :base_branch_collection,
|
|
13
|
-
:feature_branch_collection
|
|
13
|
+
:feature_branch_collection, :churn_after
|
|
14
14
|
|
|
15
15
|
def set(options)
|
|
16
16
|
self.mode = options[:mode] || :default
|
|
@@ -19,12 +19,17 @@ module RubyCritic
|
|
|
19
19
|
self.suppress_ratings = options[:suppress_ratings]
|
|
20
20
|
self.open_with = options[:open_with]
|
|
21
21
|
self.no_browser = options[:no_browser]
|
|
22
|
-
self.base_branch = options[:base_branch]
|
|
23
|
-
self.feature_branch = options[:feature_branch]
|
|
24
22
|
self.threshold_score = options[:threshold_score].to_i
|
|
23
|
+
setup_version_control(options)
|
|
25
24
|
setup_formats(options)
|
|
26
25
|
end
|
|
27
26
|
|
|
27
|
+
def setup_version_control(options)
|
|
28
|
+
self.base_branch = options[:base_branch]
|
|
29
|
+
self.feature_branch = options[:feature_branch]
|
|
30
|
+
self.churn_after = options[:churn_after]
|
|
31
|
+
end
|
|
32
|
+
|
|
28
33
|
def setup_formats(options)
|
|
29
34
|
formats = options[:formats].to_a
|
|
30
35
|
self.formats = formats.empty? ? [:html] : formats
|
|
@@ -59,11 +64,15 @@ module RubyCritic
|
|
|
59
64
|
end
|
|
60
65
|
|
|
61
66
|
def self.method_missing(method, *args, &block)
|
|
62
|
-
configuration.
|
|
67
|
+
if configuration.respond_to?(method)
|
|
68
|
+
configuration.public_send(method, *args, &block)
|
|
69
|
+
else
|
|
70
|
+
super
|
|
71
|
+
end
|
|
63
72
|
end
|
|
64
73
|
|
|
65
74
|
def self.respond_to_missing?(symbol, include_all = false)
|
|
66
|
-
configuration.
|
|
75
|
+
configuration.respond_to?(symbol) || super
|
|
67
76
|
end
|
|
68
77
|
end
|
|
69
78
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -221,7 +221,7 @@ header {
|
|
|
221
221
|
}
|
|
222
222
|
.sidebar-nav li a:hover {color:#9B111D;}
|
|
223
223
|
.sidebar-nav li a i,.sidebar-nav li a img {font-size:18px;display:block;margin:0 auto;}
|
|
224
|
-
/*End of Layout
|
|
224
|
+
/*End of Layout Styles*/
|
|
225
225
|
|
|
226
226
|
.fadeIn {-webkit-animation: fadein 2s; /* Safari, Chrome and Opera > 12.1 */
|
|
227
227
|
-moz-animation: fadein 2s; /* Firefox < 16 */
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|