rubycritic 3.4.0 → 3.5.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 +10 -2
- data/README.md +12 -10
- data/lib/rubycritic/cli/options.rb +25 -3
- data/lib/rubycritic/command_factory.rb +3 -0
- data/lib/rubycritic/commands/ci.rb +2 -8
- data/lib/rubycritic/commands/compare.rb +105 -0
- data/lib/rubycritic/commands/utils/build_number_file.rb +35 -0
- data/lib/rubycritic/configuration.rb +18 -1
- data/lib/rubycritic/core/analysed_modules_collection.rb +23 -3
- data/lib/rubycritic/generators/html/assets/stylesheets/application.css +20 -0
- data/lib/rubycritic/generators/html/base.rb +1 -1
- data/lib/rubycritic/generators/html/code_file.rb +11 -0
- data/lib/rubycritic/generators/html/code_index.rb +7 -0
- data/lib/rubycritic/generators/html/overview.rb +7 -0
- data/lib/rubycritic/generators/html/smells_index.rb +7 -0
- data/lib/rubycritic/generators/html/templates/code_index.html.erb +10 -0
- data/lib/rubycritic/generators/html/templates/layouts/application.html.erb +7 -0
- data/lib/rubycritic/generators/html/view_helpers.rb +10 -1
- data/lib/rubycritic/source_control_systems/git.rb +27 -1
- data/lib/rubycritic/version.rb +1 -1
- metadata +7 -131
- data/.gitignore +0 -23
- data/.rubocop.yml +0 -37
- data/.rubocop_todo.yml +0 -45
- data/.todo.reek +0 -142
- data/.travis.yml +0 -29
- data/.yardopts +0 -5
- data/docs/building-own-code-climate.md +0 -156
- data/docs/core-metrics.md +0 -72
- data/docs/jenkins-pr-reviews.md +0 -64
- data/features/command_line_interface/minimum_score.feature +0 -39
- data/features/command_line_interface/options.feature +0 -37
- data/features/rake_task.feature +0 -65
- data/features/step_definitions/rake_task_steps.rb +0 -5
- data/features/step_definitions/rubycritic_steps.rb +0 -33
- data/features/step_definitions/sample_file_steps.rb +0 -32
- data/features/support/env.rb +0 -43
- data/images/churn-vs-complexity.png +0 -0
- data/images/code.png +0 -0
- data/images/logo.png +0 -0
- data/images/overview.png +0 -0
- data/images/rating.png +0 -0
- data/images/reek.png +0 -0
- data/images/smell-details.png +0 -0
- data/images/smells.png +0 -0
- data/images/whitesmith.png +0 -0
- data/rubycritic.gemspec +0 -45
- data/test/analysers_test_helper.rb +0 -12
- data/test/lib/rubycritic/analysers/churn_test.rb +0 -35
- data/test/lib/rubycritic/analysers/complexity_test.rb +0 -18
- data/test/lib/rubycritic/analysers/helpers/methods_counter_test.rb +0 -31
- data/test/lib/rubycritic/analysers/helpers/modules_locator_test.rb +0 -55
- data/test/lib/rubycritic/analysers/smells/flay_test.rb +0 -41
- data/test/lib/rubycritic/analysers/smells/flog_test.rb +0 -28
- data/test/lib/rubycritic/analysers/smells/reek_test.rb +0 -32
- data/test/lib/rubycritic/analysis_summary_test.rb +0 -30
- data/test/lib/rubycritic/browser_test.rb +0 -18
- data/test/lib/rubycritic/commands/status_reporter_test.rb +0 -81
- data/test/lib/rubycritic/configuration_test.rb +0 -31
- data/test/lib/rubycritic/core/analysed_module_test.rb +0 -90
- data/test/lib/rubycritic/core/analysed_modules_collection_test.rb +0 -111
- data/test/lib/rubycritic/core/location_test.rb +0 -39
- data/test/lib/rubycritic/core/smell_test.rb +0 -105
- data/test/lib/rubycritic/core/smells_array_test.rb +0 -30
- data/test/lib/rubycritic/generators/console_report_test.rb +0 -83
- data/test/lib/rubycritic/generators/json_report_test.rb +0 -38
- data/test/lib/rubycritic/generators/lint_report_test.rb +0 -37
- data/test/lib/rubycritic/generators/turbulence_test.rb +0 -19
- data/test/lib/rubycritic/generators/view_helpers_test.rb +0 -85
- data/test/lib/rubycritic/revision_comparator_test.rb +0 -66
- data/test/lib/rubycritic/smells_status_setter_test.rb +0 -24
- data/test/lib/rubycritic/source_control_systems/base_test.rb +0 -31
- data/test/lib/rubycritic/source_control_systems/double_test.rb +0 -13
- data/test/lib/rubycritic/source_control_systems/git_test.rb +0 -15
- data/test/lib/rubycritic/source_control_systems/interfaces/basic.rb +0 -9
- data/test/lib/rubycritic/source_control_systems/interfaces/time_travel.rb +0 -9
- data/test/lib/rubycritic/source_control_systems/mercurial_test.rb +0 -13
- data/test/lib/rubycritic/source_control_systems/perforce_test.rb +0 -176
- data/test/lib/rubycritic/source_locator_test.rb +0 -80
- data/test/lib/rubycritic/version_test.rb +0 -10
- data/test/samples/empty.rb +0 -0
- data/test/samples/flay/smelly.rb +0 -8
- data/test/samples/flay/smelly2.rb +0 -8
- data/test/samples/flog/complex.rb +0 -11
- data/test/samples/flog/smelly.rb +0 -11
- data/test/samples/location/dir1/file1.rb +0 -0
- data/test/samples/location/file0.rb +0 -0
- data/test/samples/location/file0_symlink.rb +0 -1
- data/test/samples/location/file_with_different_extension.py +0 -0
- data/test/samples/location/file_with_no_extension +0 -0
- data/test/samples/methods_count.rb +0 -7
- data/test/samples/module_names.rb +0 -18
- data/test/samples/no_methods.rb +0 -4
- data/test/samples/reek/not_smelly.rb +0 -35
- data/test/samples/reek/smelly.rb +0 -17
- data/test/samples/unparsable.rb +0 -1
- data/test/test_helper.rb +0 -64
File without changes
|
File without changes
|
data/test/samples/no_methods.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
class Perfume
|
2
|
-
attr_reader :perfumed
|
3
|
-
|
4
|
-
def ignoreRubyStyle(oneParameter)
|
5
|
-
oneVariable = oneParameter
|
6
|
-
end
|
7
|
-
|
8
|
-
def allow_nesting_iterators_two_levels_deep
|
9
|
-
loop do
|
10
|
-
loop do
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def allow_many_statements
|
16
|
-
do_something
|
17
|
-
do_something
|
18
|
-
do_something
|
19
|
-
do_something
|
20
|
-
do_something
|
21
|
-
do_something
|
22
|
-
end
|
23
|
-
|
24
|
-
def allow_up_to_two_duplicate_method_calls
|
25
|
-
respond_to do |format|
|
26
|
-
if success
|
27
|
-
format.html { redirect_to some_path }
|
28
|
-
format.js { head :ok }
|
29
|
-
else
|
30
|
-
format.html { redirect_to :back, status: :bad_request }
|
31
|
-
format.js { render status: :bad_request }
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
data/test/samples/reek/smelly.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
class Theon
|
2
|
-
def reeks?(reek = true)
|
3
|
-
reek
|
4
|
-
end
|
5
|
-
|
6
|
-
def flayed?(a)
|
7
|
-
a
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
# Reek should report
|
12
|
-
# [1]:Theon has no descriptive comment (IrresponsibleModule)
|
13
|
-
# [2]:Theon#reeks? has boolean parameter 'reek' (BooleanParameter)
|
14
|
-
# This comment is below the module because otherwise Reek will interpret this
|
15
|
-
# as a comment describing the module which would thus prevent
|
16
|
-
# IrresponsibleModule from being reported.
|
17
|
-
# It should ignore the UncommunicativeParameterName as it's on the .todo.reek
|
data/test/samples/unparsable.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
unparsable :<%=
|
data/test/test_helper.rb
DELETED
@@ -1,64 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'minitest/autorun'
|
4
|
-
require 'minitest/around/spec'
|
5
|
-
require 'minitest/pride'
|
6
|
-
require 'mocha/mini_test'
|
7
|
-
require 'ostruct'
|
8
|
-
require 'diff/lcs'
|
9
|
-
|
10
|
-
def context(*args, &block)
|
11
|
-
describe(*args, &block)
|
12
|
-
end
|
13
|
-
|
14
|
-
def capture_output_streams
|
15
|
-
$stdout = StringIO.new
|
16
|
-
$stderr = StringIO.new
|
17
|
-
yield
|
18
|
-
ensure
|
19
|
-
$stdout = STDOUT
|
20
|
-
$stderr = STDERR
|
21
|
-
end
|
22
|
-
|
23
|
-
def with_cloned_fs
|
24
|
-
FakeFS do
|
25
|
-
begin
|
26
|
-
config = File.expand_path('..', __dir__)
|
27
|
-
FakeFS::FileSystem.clone(config)
|
28
|
-
Dir.chdir(config)
|
29
|
-
yield
|
30
|
-
ensure
|
31
|
-
FakeFS::FileSystem.clear
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
module MiniTest
|
37
|
-
module Assertions
|
38
|
-
##
|
39
|
-
# Fails unless <tt>exp</tt> and <tt>act</tt> are both arrays and
|
40
|
-
# contain the same elements.
|
41
|
-
#
|
42
|
-
# assert_matched_arrays [3,2,1], [1,2,3]
|
43
|
-
|
44
|
-
def assert_matched_arrays(exp, act)
|
45
|
-
exp_ary = exp.to_ary
|
46
|
-
assert_kind_of Array, exp_ary
|
47
|
-
act_ary = act.to_ary
|
48
|
-
assert_kind_of Array, act_ary
|
49
|
-
diffs = Diff::LCS.sdiff(act_ary.sort, exp_ary.sort).reject(&:unchanged?)
|
50
|
-
assert diffs.empty?, "There are diffs between expected and actual values:\n#{diffs.map(&:inspect).join("\n")}"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
module Expectations
|
55
|
-
##
|
56
|
-
# See MiniTest::Assertions#assert_matched_arrays
|
57
|
-
#
|
58
|
-
# [1,2,3].must_match_array [3,2,1]
|
59
|
-
#
|
60
|
-
# :method: must_match_array
|
61
|
-
|
62
|
-
infect_an_assertion :assert_matched_arrays, :must_match_array
|
63
|
-
end
|
64
|
-
end
|