rubycritic 4.4.0 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -1
- data/CONTRIBUTING.md +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +1 -1
- 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 +33 -27
- 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 +7 -2
- data/lib/rubycritic/source_control_systems/git/churn.rb +93 -0
- 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 +56 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e29663da0f7e6b712b6159000d212bc6a4857b1422058c0b5e9073cf211aabb
|
4
|
+
data.tar.gz: a735167e5d172d2fe951bbdd19fe16764246dfe6f6c632e95bad960a3bc57cbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 572343ee07ec87aedc9d3774e89d2ff8ba1b9acd9682f9378070e197a3fdfe173d29cf112811213c08c3f95ce596dc71894496296a051bec504c87f486981c23
|
7
|
+
data.tar.gz: f34521dff687c6cc832ba6dd6e5afd60e2f76ef5e1fefc10db5be9ad273d5110867b6459c05a5e8081bd8dbb5e97f5d64f4d60cad8360f8c808b6ad0880b4977
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,31 @@
|
|
1
|
-
#
|
1
|
+
# main [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.6.0...main)
|
2
|
+
|
3
|
+
# v4.6.0 / 2021-01-28 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.5.2...v4.6.0)
|
4
|
+
|
5
|
+
* [CHANGE] Fix rubocop offenses (by [@sl4vr][])
|
6
|
+
* [CHANGE] Make Github Linguist ignore vendored files (by [@sl4vr][])
|
7
|
+
* [BUGFIX] Fix directory structure of reports when comparing branches (by [@denny][])
|
8
|
+
* [BUGFIX] Restrict simplecov to versions before data format changed (by [@denny][])
|
9
|
+
|
10
|
+
# v4.5.2 / 2020-08-20 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.5.1...v4.5.2)
|
11
|
+
|
12
|
+
* [BUGFIX] Handle simplecov v0.19 and install appraisal (by [@MZiserman][])
|
13
|
+
|
14
|
+
# v4.5.1 / 2020-06-29 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.5.0...v4.5.1)
|
15
|
+
|
16
|
+
* [BUGFIX] Handle git --name-status Copied (C) operation (by [@rizalmuthi][])
|
17
|
+
|
18
|
+
* [FEATURE] Add --churn-after (only supports git) to limit churn analysis to recent history (by [@jackcasey][])
|
19
|
+
|
20
|
+
# v4.5.0 / 2020-05-14 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.4.1...v4.5.0)
|
21
|
+
|
22
|
+
* [CHANGE] Relax `launchy` version dependency requirement
|
23
|
+
* [CHANGE] Drop support for ruby 2.3 (by [@joshrpowell][])
|
24
|
+
* [CHANGE] Update Reek dependency to '~> 6.0', '< 7.0' (by [@joshrpowell][])
|
25
|
+
|
26
|
+
# v4.4.1 / 2020-02-20 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.4.0...v4.4.1)
|
27
|
+
|
28
|
+
* [CHANGE] Rewrite how churn is calculated to make it faster
|
2
29
|
|
3
30
|
# v4.4.0 / 2020-02-15 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.3.3...v4.4.0)
|
4
31
|
|
@@ -330,3 +357,6 @@
|
|
330
357
|
[@GeoffTidey]: https://github.com/GeoffTidey
|
331
358
|
[@lloydwatkin]: https://github.com/lloydwatkin
|
332
359
|
[@Flink]: https://github.com/Flink
|
360
|
+
[@jackcasey]: https://github.com/jackcasey
|
361
|
+
[@sl4vr]: https://github.com/sl4vr
|
362
|
+
[@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
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
|
@@ -91,15 +91,17 @@ module RubyCritic
|
|
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
|
File without changes
|
File without changes
|
data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.eot
RENAMED
File without changes
|
data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.svg
RENAMED
File without changes
|
data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.ttf
RENAMED
File without changes
|
data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.woff
RENAMED
File without changes
|
data/lib/rubycritic/generators/html/assets/{fonts → vendor/fonts}/glyphicons-halflings-regular.woff2
RENAMED
File without changes
|
data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/bootstrap.min.js
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.scrollTo.min.js
RENAMED
File without changes
|
data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.tablesorter.js
RENAMED
File without changes
|
File without changes
|
data/lib/rubycritic/generators/html/assets/{javascripts → vendor/javascripts}/jquery.timeago.js
RENAMED
File without changes
|
File without changes
|
data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/bootstrap.min.css
RENAMED
File without changes
|
data/lib/rubycritic/generators/html/assets/{stylesheets → vendor/stylesheets}/font-awesome.min.css
RENAMED
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
|
@@ -8,16 +8,16 @@
|
|
8
8
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
9
9
|
|
10
10
|
<!-- StyleSheets -->
|
11
|
-
<link href="<%=
|
12
|
-
<link href="<%=
|
13
|
-
<link href="<%=
|
14
|
-
<link href="<%=
|
11
|
+
<link href="<%= asset_path("vendor/stylesheets/bootstrap.min.css") %>" media="screen, projection, print" rel="stylesheet" type="text/css">
|
12
|
+
<link href="<%= asset_path("vendor/stylesheets/font-awesome.min.css") %>" media="screen, projection, print" rel="stylesheet" type="text/css">
|
13
|
+
<link href="<%= asset_path("vendor/stylesheets/prettify.custom_theme.css") %>" media="screen, projection, print" rel="stylesheet" type="text/css">
|
14
|
+
<link href="<%= asset_path("stylesheets/application.css") %>" media="screen, projection, print" rel="stylesheet" type="text/css">
|
15
15
|
</head>
|
16
16
|
|
17
17
|
<body>
|
18
18
|
<header class="navbar navbar-default navbar-fixed-top">
|
19
19
|
<a href="#menu-toggle" class="btn btn-default hidden-lg visible-sm-* hidden-md visible-xs-* pull-left" id="menu-toggle"><i class="fa fa-bars" aria-hidden="true"></i></a>
|
20
|
-
<a href="<%= file_path('overview.html') %>"><img src="<%=
|
20
|
+
<a href="<%= file_path('overview.html') %>"><img src="<%= asset_path('images/logo.png') %>" alt="Ruby Critic Logo" title="Ruby Critic Logo" width="55"><span class="logo">RUBYCRITIC</span></a>
|
21
21
|
<% if Config.compare_branches_mode? %>
|
22
22
|
<ul class="nav navbar-nav navbar-right">
|
23
23
|
<a href="<%= @base_path %>"><span class="branch"><%= Config.base_branch %></span></a>
|
@@ -53,14 +53,14 @@
|
|
53
53
|
</div>
|
54
54
|
|
55
55
|
<!-- JavaScripts -->
|
56
|
-
<%=
|
57
|
-
<%=
|
58
|
-
<%=
|
59
|
-
<%=
|
60
|
-
<%=
|
61
|
-
<%=
|
62
|
-
<%=
|
63
|
-
<%=
|
64
|
-
<%=
|
56
|
+
<script src="<%= asset_path("vendor/javascripts/jquery.min.js") %>"></script>
|
57
|
+
<script src="<%= asset_path("vendor/javascripts/jquery.tablesorter.min.js") %>"></script>
|
58
|
+
<script src="<%= asset_path("vendor/javascripts/jquery.scrollTo.min.js") %>"></script>
|
59
|
+
<script src="<%= asset_path("vendor/javascripts/jquery.timeago.js") %>"></script>
|
60
|
+
<script src="<%= asset_path("vendor/javascripts/highcharts.src-4.0.1.js") %>"></script>
|
61
|
+
<script src="<%= asset_path("vendor/javascripts/prettify.js") %>"></script>
|
62
|
+
<script src="<%= asset_path("vendor/javascripts/bootstrap.min.js") %>"></script>
|
63
|
+
<script src="<%= asset_path("javascripts/application.js") %>"></script>
|
64
|
+
<script src="<%= asset_path("vendor/javascripts/jquery.filtertable.min.js") %>"></script>
|
65
65
|
</body>
|
66
66
|
</html>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -6,22 +6,10 @@ module RubyCritic
|
|
6
6
|
"<time class='js-timeago' datetime='#{time}'>#{time}</time>"
|
7
7
|
end
|
8
8
|
|
9
|
-
def javascript_tag(file)
|
10
|
-
"<script src='" + asset_path("javascripts/#{file}.js").to_s + "'></script>"
|
11
|
-
end
|
12
|
-
|
13
|
-
def stylesheet_path(file)
|
14
|
-
asset_path("stylesheets/#{file}.css")
|
15
|
-
end
|
16
|
-
|
17
9
|
def asset_path(file)
|
18
10
|
relative_path("assets/#{file}")
|
19
11
|
end
|
20
12
|
|
21
|
-
def image_path(file)
|
22
|
-
asset_path("images/#{file}")
|
23
|
-
end
|
24
|
-
|
25
13
|
def file_path(file)
|
26
14
|
relative_path(file)
|
27
15
|
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
|
data/lib/rubycritic/rake_task.rb
CHANGED
File without changes
|
data/lib/rubycritic/reporter.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'tty/which'
|
4
|
+
require 'rubycritic/source_control_systems/git/churn'
|
4
5
|
|
5
6
|
module RubyCritic
|
6
7
|
module SourceControlSystem
|
@@ -28,12 +29,16 @@ module RubyCritic
|
|
28
29
|
'Git'
|
29
30
|
end
|
30
31
|
|
32
|
+
def churn
|
33
|
+
@churn ||= Churn.new(churn_after: Config.churn_after)
|
34
|
+
end
|
35
|
+
|
31
36
|
def revisions_count(path)
|
32
|
-
|
37
|
+
churn.revisions_count(path)
|
33
38
|
end
|
34
39
|
|
35
40
|
def date_of_last_commit(path)
|
36
|
-
|
41
|
+
churn.date_of_last_commit(path)
|
37
42
|
end
|
38
43
|
|
39
44
|
def revision?
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubyCritic
|
4
|
+
module SourceControlSystem
|
5
|
+
class Git < Base
|
6
|
+
Stats = Struct.new(:count, :date)
|
7
|
+
|
8
|
+
class Renames
|
9
|
+
def initialize
|
10
|
+
@data = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
def renamed(from, to)
|
14
|
+
current = current(to)
|
15
|
+
@data[from] = current
|
16
|
+
end
|
17
|
+
|
18
|
+
def current(name)
|
19
|
+
@data.fetch(name, name)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class Churn
|
24
|
+
def initialize(churn_after: nil)
|
25
|
+
@renames = Renames.new
|
26
|
+
@date = nil
|
27
|
+
@stats = {}
|
28
|
+
@churn_after = churn_after
|
29
|
+
|
30
|
+
call
|
31
|
+
end
|
32
|
+
|
33
|
+
def revisions_count(path)
|
34
|
+
stats(path).count
|
35
|
+
end
|
36
|
+
|
37
|
+
def date_of_last_commit(path)
|
38
|
+
stats(path).date
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def call
|
44
|
+
Git
|
45
|
+
.git(git_log_command)
|
46
|
+
.split("\n")
|
47
|
+
.reject(&:empty?)
|
48
|
+
.each { |line| process_line(line) }
|
49
|
+
end
|
50
|
+
|
51
|
+
def git_log_command
|
52
|
+
after_clause = @churn_after ? "--after='#{@churn_after}' " : ''
|
53
|
+
"log --all --date=iso --follow --format='format:date:%x09%ad' --name-status #{after_clause}."
|
54
|
+
end
|
55
|
+
|
56
|
+
def process_line(line)
|
57
|
+
operation, *rest = line.split("\t")
|
58
|
+
|
59
|
+
case operation
|
60
|
+
when /^date:/
|
61
|
+
process_date(*rest)
|
62
|
+
when /^[RC]/
|
63
|
+
process_rename(*rest)
|
64
|
+
else
|
65
|
+
process_file(*rest)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def process_date(date)
|
70
|
+
@date = date
|
71
|
+
end
|
72
|
+
|
73
|
+
def process_rename(from, to)
|
74
|
+
@renames.renamed(from, to)
|
75
|
+
process_file(to)
|
76
|
+
end
|
77
|
+
|
78
|
+
def process_file(filename)
|
79
|
+
record_commit(@renames.current(filename), @date)
|
80
|
+
end
|
81
|
+
|
82
|
+
def record_commit(filename, date)
|
83
|
+
stats = @stats[filename] ||= Stats.new(0, date)
|
84
|
+
stats.count += 1
|
85
|
+
end
|
86
|
+
|
87
|
+
def stats(path)
|
88
|
+
@stats.fetch(path, Stats.new(0))
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
data/lib/rubycritic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubycritic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme Simoes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flay
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: launchy
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 2.
|
47
|
+
version: 2.0.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.
|
54
|
+
version: 2.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: parser
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,20 +86,20 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '6.0'
|
90
90
|
- - "<"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: '
|
92
|
+
version: '7.0'
|
93
93
|
type: :runtime
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: '
|
99
|
+
version: '6.0'
|
100
100
|
- - "<"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '7.0'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: ruby_parser
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,6 +121,9 @@ dependencies:
|
|
121
121
|
- - ">="
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: 0.17.0
|
124
|
+
- - "<"
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0.21'
|
124
127
|
type: :runtime
|
125
128
|
prerelease: false
|
126
129
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -128,6 +131,9 @@ dependencies:
|
|
128
131
|
- - ">="
|
129
132
|
- !ruby/object:Gem::Version
|
130
133
|
version: 0.17.0
|
134
|
+
- - "<"
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0.21'
|
131
137
|
- !ruby/object:Gem::Dependency
|
132
138
|
name: tty-which
|
133
139
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,6 +162,20 @@ dependencies:
|
|
156
162
|
- - "~>"
|
157
163
|
- !ruby/object:Gem::Version
|
158
164
|
version: '1.0'
|
165
|
+
- !ruby/object:Gem::Dependency
|
166
|
+
name: appraisal
|
167
|
+
requirement: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ">="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: '0'
|
172
|
+
type: :development
|
173
|
+
prerelease: false
|
174
|
+
version_requirements: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: '0'
|
159
179
|
- !ruby/object:Gem::Dependency
|
160
180
|
name: aruba
|
161
181
|
requirement: !ruby/object:Gem::Requirement
|
@@ -434,35 +454,35 @@ files:
|
|
434
454
|
- lib/rubycritic/core/rating.rb
|
435
455
|
- lib/rubycritic/core/smell.rb
|
436
456
|
- lib/rubycritic/generators/console_report.rb
|
437
|
-
- lib/rubycritic/generators/html/assets/fonts/FontAwesome.otf
|
438
457
|
- lib/rubycritic/generators/html/assets/fonts/Roboto-Medium.ttf
|
439
458
|
- lib/rubycritic/generators/html/assets/fonts/Roboto-Regular.ttf
|
440
|
-
- lib/rubycritic/generators/html/assets/fonts/fontawesome-webfont.eot
|
441
|
-
- lib/rubycritic/generators/html/assets/fonts/fontawesome-webfont.svg
|
442
|
-
- lib/rubycritic/generators/html/assets/fonts/fontawesome-webfont.ttf
|
443
|
-
- lib/rubycritic/generators/html/assets/fonts/fontawesome-webfont.woff
|
444
|
-
- lib/rubycritic/generators/html/assets/fonts/fontawesome-webfont.woff2
|
445
|
-
- lib/rubycritic/generators/html/assets/fonts/glyphicons-halflings-regular.eot
|
446
|
-
- lib/rubycritic/generators/html/assets/fonts/glyphicons-halflings-regular.svg
|
447
|
-
- lib/rubycritic/generators/html/assets/fonts/glyphicons-halflings-regular.ttf
|
448
|
-
- lib/rubycritic/generators/html/assets/fonts/glyphicons-halflings-regular.woff
|
449
|
-
- lib/rubycritic/generators/html/assets/fonts/glyphicons-halflings-regular.woff2
|
450
459
|
- lib/rubycritic/generators/html/assets/images/logo.png
|
451
460
|
- lib/rubycritic/generators/html/assets/javascripts/application.js
|
452
|
-
- lib/rubycritic/generators/html/assets/javascripts/bootstrap.min.js
|
453
|
-
- lib/rubycritic/generators/html/assets/javascripts/highcharts.src-4.0.1.js
|
454
|
-
- lib/rubycritic/generators/html/assets/javascripts/jquery.filtertable.min.js
|
455
|
-
- lib/rubycritic/generators/html/assets/javascripts/jquery.min.js
|
456
|
-
- lib/rubycritic/generators/html/assets/javascripts/jquery.scrollTo.min.js
|
457
|
-
- lib/rubycritic/generators/html/assets/javascripts/jquery.tablesorter.js
|
458
|
-
- lib/rubycritic/generators/html/assets/javascripts/jquery.tablesorter.min.js
|
459
|
-
- lib/rubycritic/generators/html/assets/javascripts/jquery.timeago.js
|
460
|
-
- lib/rubycritic/generators/html/assets/javascripts/prettify.js
|
461
461
|
- lib/rubycritic/generators/html/assets/stylesheets/application.css
|
462
|
-
- lib/rubycritic/generators/html/assets/
|
463
|
-
- lib/rubycritic/generators/html/assets/
|
464
|
-
- lib/rubycritic/generators/html/assets/
|
465
|
-
- lib/rubycritic/generators/html/assets/
|
462
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/FontAwesome.otf
|
463
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/fontawesome-webfont.eot
|
464
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/fontawesome-webfont.svg
|
465
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/fontawesome-webfont.ttf
|
466
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/fontawesome-webfont.woff
|
467
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/fontawesome-webfont.woff2
|
468
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/glyphicons-halflings-regular.eot
|
469
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/glyphicons-halflings-regular.svg
|
470
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/glyphicons-halflings-regular.ttf
|
471
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/glyphicons-halflings-regular.woff
|
472
|
+
- lib/rubycritic/generators/html/assets/vendor/fonts/glyphicons-halflings-regular.woff2
|
473
|
+
- lib/rubycritic/generators/html/assets/vendor/javascripts/bootstrap.min.js
|
474
|
+
- lib/rubycritic/generators/html/assets/vendor/javascripts/highcharts.src-4.0.1.js
|
475
|
+
- lib/rubycritic/generators/html/assets/vendor/javascripts/jquery.filtertable.min.js
|
476
|
+
- lib/rubycritic/generators/html/assets/vendor/javascripts/jquery.min.js
|
477
|
+
- lib/rubycritic/generators/html/assets/vendor/javascripts/jquery.scrollTo.min.js
|
478
|
+
- lib/rubycritic/generators/html/assets/vendor/javascripts/jquery.tablesorter.js
|
479
|
+
- lib/rubycritic/generators/html/assets/vendor/javascripts/jquery.tablesorter.min.js
|
480
|
+
- lib/rubycritic/generators/html/assets/vendor/javascripts/jquery.timeago.js
|
481
|
+
- lib/rubycritic/generators/html/assets/vendor/javascripts/prettify.js
|
482
|
+
- lib/rubycritic/generators/html/assets/vendor/stylesheets/bootstrap.min.css
|
483
|
+
- lib/rubycritic/generators/html/assets/vendor/stylesheets/font-awesome.min.css
|
484
|
+
- lib/rubycritic/generators/html/assets/vendor/stylesheets/prettify.css
|
485
|
+
- lib/rubycritic/generators/html/assets/vendor/stylesheets/prettify.custom_theme.css
|
466
486
|
- lib/rubycritic/generators/html/base.rb
|
467
487
|
- lib/rubycritic/generators/html/code_file.rb
|
468
488
|
- lib/rubycritic/generators/html/code_index.rb
|
@@ -496,6 +516,7 @@ files:
|
|
496
516
|
- lib/rubycritic/source_control_systems/base.rb
|
497
517
|
- lib/rubycritic/source_control_systems/double.rb
|
498
518
|
- lib/rubycritic/source_control_systems/git.rb
|
519
|
+
- lib/rubycritic/source_control_systems/git/churn.rb
|
499
520
|
- lib/rubycritic/source_control_systems/mercurial.rb
|
500
521
|
- lib/rubycritic/source_control_systems/perforce.rb
|
501
522
|
- lib/rubycritic/source_locator.rb
|
@@ -512,7 +533,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
512
533
|
requirements:
|
513
534
|
- - ">="
|
514
535
|
- !ruby/object:Gem::Version
|
515
|
-
version: 2.
|
536
|
+
version: 2.4.0
|
516
537
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
517
538
|
requirements:
|
518
539
|
- - ">="
|