rubycritic 4.4.1 → 4.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +33 -1
  3. data/CONTRIBUTING.md +0 -0
  4. data/Gemfile +0 -0
  5. data/LICENSE.txt +0 -0
  6. data/README.md +8 -8
  7. data/ROADMAP.md +0 -0
  8. data/Rakefile +0 -0
  9. data/lib/rubycritic.rb +0 -0
  10. data/lib/rubycritic/analysers/attributes.rb +0 -0
  11. data/lib/rubycritic/analysers/churn.rb +0 -0
  12. data/lib/rubycritic/analysers/complexity.rb +0 -0
  13. data/lib/rubycritic/analysers/coverage.rb +34 -28
  14. data/lib/rubycritic/analysers/helpers/ast_node.rb +0 -0
  15. data/lib/rubycritic/analysers/helpers/flay.rb +0 -0
  16. data/lib/rubycritic/analysers/helpers/flog.rb +0 -0
  17. data/lib/rubycritic/analysers/helpers/methods_counter.rb +0 -0
  18. data/lib/rubycritic/analysers/helpers/modules_locator.rb +0 -0
  19. data/lib/rubycritic/analysers/helpers/parser.rb +0 -0
  20. data/lib/rubycritic/analysers/helpers/reek.rb +0 -0
  21. data/lib/rubycritic/analysers/smells/flay.rb +0 -0
  22. data/lib/rubycritic/analysers/smells/flog.rb +0 -0
  23. data/lib/rubycritic/analysers/smells/reek.rb +0 -0
  24. data/lib/rubycritic/analysers_runner.rb +0 -0
  25. data/lib/rubycritic/analysis_summary.rb +0 -0
  26. data/lib/rubycritic/browser.rb +0 -0
  27. data/lib/rubycritic/cli/application.rb +0 -0
  28. data/lib/rubycritic/cli/options.rb +0 -0
  29. data/lib/rubycritic/cli/options/argv.rb +8 -1
  30. data/lib/rubycritic/cli/options/file.rb +0 -0
  31. data/lib/rubycritic/colorize.rb +0 -0
  32. data/lib/rubycritic/command_factory.rb +0 -0
  33. data/lib/rubycritic/commands/base.rb +0 -0
  34. data/lib/rubycritic/commands/ci.rb +0 -0
  35. data/lib/rubycritic/commands/compare.rb +3 -2
  36. data/lib/rubycritic/commands/default.rb +0 -0
  37. data/lib/rubycritic/commands/help.rb +0 -0
  38. data/lib/rubycritic/commands/status_reporter.rb +0 -0
  39. data/lib/rubycritic/commands/utils/build_number_file.rb +0 -0
  40. data/lib/rubycritic/commands/version.rb +0 -0
  41. data/lib/rubycritic/configuration.rb +14 -5
  42. data/lib/rubycritic/core/analysed_module.rb +0 -0
  43. data/lib/rubycritic/core/analysed_modules_collection.rb +0 -0
  44. data/lib/rubycritic/core/location.rb +0 -0
  45. data/lib/rubycritic/core/rating.rb +0 -0
  46. data/lib/rubycritic/core/smell.rb +0 -0
  47. data/lib/rubycritic/generators/console_report.rb +0 -0
  48. data/lib/rubycritic/generators/html/assets/javascripts/application.js +0 -0
  49. data/lib/rubycritic/generators/html/assets/stylesheets/application.css +1 -1
  50. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/FontAwesome.otf +0 -0
  51. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.eot +0 -0
  52. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.svg +0 -0
  53. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.ttf +0 -0
  54. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.woff +0 -0
  55. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/fontawesome-webfont.woff2 +0 -0
  56. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.eot +0 -0
  57. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.svg +0 -0
  58. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.ttf +0 -0
  59. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.woff +0 -0
  60. data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.woff2 +0 -0
  61. data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/bootstrap.min.js +0 -0
  62. data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/highcharts.src-4.0.1.js +0 -0
  63. data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.filtertable.min.js +0 -0
  64. data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.min.js +0 -0
  65. data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.scrollTo.min.js +0 -0
  66. data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.tablesorter.js +0 -0
  67. data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.tablesorter.min.js +0 -0
  68. data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.timeago.js +0 -0
  69. data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/prettify.js +0 -0
  70. data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/bootstrap.min.css +0 -0
  71. data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/font-awesome.min.css +0 -0
  72. data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/prettify.css +0 -0
  73. data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/prettify.custom_theme.css +0 -0
  74. data/lib/rubycritic/generators/html/base.rb +0 -0
  75. data/lib/rubycritic/generators/html/code_file.rb +0 -0
  76. data/lib/rubycritic/generators/html/code_index.rb +0 -0
  77. data/lib/rubycritic/generators/html/line.rb +0 -0
  78. data/lib/rubycritic/generators/html/overview.rb +0 -0
  79. data/lib/rubycritic/generators/html/simple_cov_index.rb +0 -0
  80. data/lib/rubycritic/generators/html/smells_index.rb +0 -0
  81. data/lib/rubycritic/generators/html/templates/code_file.html.erb +0 -0
  82. data/lib/rubycritic/generators/html/templates/code_index.html.erb +0 -0
  83. data/lib/rubycritic/generators/html/templates/layouts/application.html.erb +14 -14
  84. data/lib/rubycritic/generators/html/templates/line.html.erb +0 -0
  85. data/lib/rubycritic/generators/html/templates/overview.html.erb +0 -0
  86. data/lib/rubycritic/generators/html/templates/simple_cov_index.html.erb +0 -0
  87. data/lib/rubycritic/generators/html/templates/smells_index.html.erb +0 -0
  88. data/lib/rubycritic/generators/html/templates/smelly_line.html.erb +0 -0
  89. data/lib/rubycritic/generators/html/turbulence.rb +0 -0
  90. data/lib/rubycritic/generators/html/view_helpers.rb +0 -12
  91. data/lib/rubycritic/generators/html_report.rb +0 -0
  92. data/lib/rubycritic/generators/json/simple.rb +0 -0
  93. data/lib/rubycritic/generators/json_report.rb +0 -0
  94. data/lib/rubycritic/generators/lint_report.rb +0 -0
  95. data/lib/rubycritic/generators/text/lint.rb +0 -0
  96. data/lib/rubycritic/generators/text/list.rb +0 -0
  97. data/lib/rubycritic/generators/text/templates/lint.erb +0 -0
  98. data/lib/rubycritic/generators/text/templates/list.erb +0 -0
  99. data/lib/rubycritic/rake_task.rb +0 -0
  100. data/lib/rubycritic/reporter.rb +0 -0
  101. data/lib/rubycritic/revision_comparator.rb +0 -0
  102. data/lib/rubycritic/serializer.rb +0 -0
  103. data/lib/rubycritic/smells_status_setter.rb +0 -0
  104. data/lib/rubycritic/source_control_systems/base.rb +1 -1
  105. data/lib/rubycritic/source_control_systems/double.rb +0 -0
  106. data/lib/rubycritic/source_control_systems/git.rb +1 -1
  107. data/lib/rubycritic/source_control_systems/git/churn.rb +9 -3
  108. data/lib/rubycritic/source_control_systems/mercurial.rb +0 -0
  109. data/lib/rubycritic/source_control_systems/perforce.rb +0 -0
  110. data/lib/rubycritic/source_locator.rb +0 -0
  111. data/lib/rubycritic/version.rb +1 -1
  112. metadata +114 -92
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80cbe6c77393b0819c820cd22c3cc67a0f6a5824598e1f67dbb1f8a7097070d8
4
- data.tar.gz: '08b6e201d99ad0537cc440f885a36c5f07cda146766a3009cb4616ce7209fc06'
3
+ metadata.gz: 4cdf1485043408cdfbf9a8a0a468f7b20163c2bd982314547d733aca7d185d88
4
+ data.tar.gz: 365505ba0aedce90a370be8a8ccdc8277f33c2b637c8e1e22f350530240d9889
5
5
  SHA512:
6
- metadata.gz: 1883ee9f5c4832b9fefcabed5f768d368e0b539d7cd7435813546c5a1db0b93856bc0705e525de902dd2d5cd500e6692854476c2b5a24dd23dc5a6a260c37877
7
- data.tar.gz: ebdb193754eab2b5d9b94830bda9de53cec62eecc1c11a1a4d15bf50c3a7e7f7bfcd0147fafbd85565f9a28962669e39b097a1f5dce93af77242be699b5d132a
6
+ metadata.gz: 5e5718fea056a233dcaab942dfe0529230d371ff1ef6fb71711283535c9aa85aab5cd07be697ec97d605574fbce7329e60f69aa608ca0504b54df094c5b65c46
7
+ data.tar.gz: 301500666e876676cc4caeaa2be96ed33b863dd7cad8b47b8f35461f665b7bc3ae66aa3fe3522466d5f42be679b525625bbe8c3b381da4c9015556c8b2bed348
data/CHANGELOG.md CHANGED
@@ -1,4 +1,33 @@
1
- # master [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.4.1...master)
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
  [![Build Status](https://travis-ci.org/whitesmith/rubycritic.svg?branch=master)](https://travis-ci.org/whitesmith/rubycritic)
5
5
  [![Code Climate](https://codeclimate.com/github/whitesmith/rubycritic/badges/gpa.svg)](https://codeclimate.com/github/whitesmith/rubycritic)
6
6
 
7
- <img src="https://github.com/whitesmith/rubycritic/raw/master/images/logo.png" alt="RubyCritic Icon" align="right">
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
- ![RubyCritic overview screenshot](https://github.com/whitesmith/rubycritic/raw/master/images/overview.png)
30
+ ![RubyCritic overview screenshot](https://github.com/whitesmith/rubycritic/raw/main/images/overview.png)
31
31
 
32
32
  2. An index of the project files with their respective number of smells:
33
33
 
34
- ![RubyCritic code index screenshot](https://github.com/whitesmith/rubycritic/raw/master/images/code.png)
34
+ ![RubyCritic code index screenshot](https://github.com/whitesmith/rubycritic/raw/main/images/code.png)
35
35
 
36
36
  3. An index of the smells detected:
37
37
 
38
- ![RubyCritic smells index screenshot](https://github.com/whitesmith/rubycritic/raw/master/images/smells.png)
38
+ ![RubyCritic smells index screenshot](https://github.com/whitesmith/rubycritic/raw/main/images/smells.png)
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
- ![Reek output screenshot](https://github.com/whitesmith/rubycritic/raw/master/images/reek.png)
54
+ ![Reek output screenshot](https://github.com/whitesmith/rubycritic/raw/main/images/reek.png)
55
55
 
56
56
  Into something like this:
57
57
 
58
- ![RubyCritic file code screenshot](https://github.com/whitesmith/rubycritic/raw/master/images/smell-details.png)
58
+ ![RubyCritic file code screenshot](https://github.com/whitesmith/rubycritic/raw/main/images/smell-details.png)
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
- ![Whitesmith](https://github.com/whitesmith/rubycritic/raw/master/images/whitesmith.png)
246
+ ![Whitesmith](https://github.com/whitesmith/rubycritic/raw/main/images/whitesmith.png)
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 .resultset.json cache file
49
+ # The path to the cache file
48
50
  def resultset_path
49
- File.join(SimpleCov.coverage_path, '.resultset.json')
51
+ File.join(SimpleCov.coverage_path, RESULTSET_FILENAME)
50
52
  end
51
53
 
52
54
  def resultset_writelock
53
- File.join(SimpleCov.coverage_path, '.resultset.json.lock')
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 ||= begin
60
- if (data = stored_data)
61
- begin
62
- JSON.parse(data) || {}
63
- rescue JSON::ParserError => err
64
- puts "Error: Loading .resultset.json: #{err.message}"
65
- {}
66
- end
67
- else
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
- begin
95
- @resultset_locked = true
96
- File.open(resultset_writelock, 'w+') do |file|
97
- file.flock(File::LOCK_EX)
98
- yield
99
- end
100
- ensure
101
- @resultset_locked = false
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
- array = []
111
- resultset.each do |command_name, data|
112
- array << ::SimpleCov::Result.from_hash(command_name => data)
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
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
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 = "#{Config.root}/compare"
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
- "#{Config.root}/compare/#{Config.send(branch)}"
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.public_send(method, *args, &block)
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.respond_to_missing?(symbol) || super
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
@@ -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 Stlyes*/
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 */