rubycritic 3.4.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -2
  3. data/README.md +12 -10
  4. data/lib/rubycritic/cli/options.rb +25 -3
  5. data/lib/rubycritic/command_factory.rb +3 -0
  6. data/lib/rubycritic/commands/ci.rb +2 -8
  7. data/lib/rubycritic/commands/compare.rb +105 -0
  8. data/lib/rubycritic/commands/utils/build_number_file.rb +35 -0
  9. data/lib/rubycritic/configuration.rb +18 -1
  10. data/lib/rubycritic/core/analysed_modules_collection.rb +23 -3
  11. data/lib/rubycritic/generators/html/assets/stylesheets/application.css +20 -0
  12. data/lib/rubycritic/generators/html/base.rb +1 -1
  13. data/lib/rubycritic/generators/html/code_file.rb +11 -0
  14. data/lib/rubycritic/generators/html/code_index.rb +7 -0
  15. data/lib/rubycritic/generators/html/overview.rb +7 -0
  16. data/lib/rubycritic/generators/html/smells_index.rb +7 -0
  17. data/lib/rubycritic/generators/html/templates/code_index.html.erb +10 -0
  18. data/lib/rubycritic/generators/html/templates/layouts/application.html.erb +7 -0
  19. data/lib/rubycritic/generators/html/view_helpers.rb +10 -1
  20. data/lib/rubycritic/source_control_systems/git.rb +27 -1
  21. data/lib/rubycritic/version.rb +1 -1
  22. metadata +7 -131
  23. data/.gitignore +0 -23
  24. data/.rubocop.yml +0 -37
  25. data/.rubocop_todo.yml +0 -45
  26. data/.todo.reek +0 -142
  27. data/.travis.yml +0 -29
  28. data/.yardopts +0 -5
  29. data/docs/building-own-code-climate.md +0 -156
  30. data/docs/core-metrics.md +0 -72
  31. data/docs/jenkins-pr-reviews.md +0 -64
  32. data/features/command_line_interface/minimum_score.feature +0 -39
  33. data/features/command_line_interface/options.feature +0 -37
  34. data/features/rake_task.feature +0 -65
  35. data/features/step_definitions/rake_task_steps.rb +0 -5
  36. data/features/step_definitions/rubycritic_steps.rb +0 -33
  37. data/features/step_definitions/sample_file_steps.rb +0 -32
  38. data/features/support/env.rb +0 -43
  39. data/images/churn-vs-complexity.png +0 -0
  40. data/images/code.png +0 -0
  41. data/images/logo.png +0 -0
  42. data/images/overview.png +0 -0
  43. data/images/rating.png +0 -0
  44. data/images/reek.png +0 -0
  45. data/images/smell-details.png +0 -0
  46. data/images/smells.png +0 -0
  47. data/images/whitesmith.png +0 -0
  48. data/rubycritic.gemspec +0 -45
  49. data/test/analysers_test_helper.rb +0 -12
  50. data/test/lib/rubycritic/analysers/churn_test.rb +0 -35
  51. data/test/lib/rubycritic/analysers/complexity_test.rb +0 -18
  52. data/test/lib/rubycritic/analysers/helpers/methods_counter_test.rb +0 -31
  53. data/test/lib/rubycritic/analysers/helpers/modules_locator_test.rb +0 -55
  54. data/test/lib/rubycritic/analysers/smells/flay_test.rb +0 -41
  55. data/test/lib/rubycritic/analysers/smells/flog_test.rb +0 -28
  56. data/test/lib/rubycritic/analysers/smells/reek_test.rb +0 -32
  57. data/test/lib/rubycritic/analysis_summary_test.rb +0 -30
  58. data/test/lib/rubycritic/browser_test.rb +0 -18
  59. data/test/lib/rubycritic/commands/status_reporter_test.rb +0 -81
  60. data/test/lib/rubycritic/configuration_test.rb +0 -31
  61. data/test/lib/rubycritic/core/analysed_module_test.rb +0 -90
  62. data/test/lib/rubycritic/core/analysed_modules_collection_test.rb +0 -111
  63. data/test/lib/rubycritic/core/location_test.rb +0 -39
  64. data/test/lib/rubycritic/core/smell_test.rb +0 -105
  65. data/test/lib/rubycritic/core/smells_array_test.rb +0 -30
  66. data/test/lib/rubycritic/generators/console_report_test.rb +0 -83
  67. data/test/lib/rubycritic/generators/json_report_test.rb +0 -38
  68. data/test/lib/rubycritic/generators/lint_report_test.rb +0 -37
  69. data/test/lib/rubycritic/generators/turbulence_test.rb +0 -19
  70. data/test/lib/rubycritic/generators/view_helpers_test.rb +0 -85
  71. data/test/lib/rubycritic/revision_comparator_test.rb +0 -66
  72. data/test/lib/rubycritic/smells_status_setter_test.rb +0 -24
  73. data/test/lib/rubycritic/source_control_systems/base_test.rb +0 -31
  74. data/test/lib/rubycritic/source_control_systems/double_test.rb +0 -13
  75. data/test/lib/rubycritic/source_control_systems/git_test.rb +0 -15
  76. data/test/lib/rubycritic/source_control_systems/interfaces/basic.rb +0 -9
  77. data/test/lib/rubycritic/source_control_systems/interfaces/time_travel.rb +0 -9
  78. data/test/lib/rubycritic/source_control_systems/mercurial_test.rb +0 -13
  79. data/test/lib/rubycritic/source_control_systems/perforce_test.rb +0 -176
  80. data/test/lib/rubycritic/source_locator_test.rb +0 -80
  81. data/test/lib/rubycritic/version_test.rb +0 -10
  82. data/test/samples/empty.rb +0 -0
  83. data/test/samples/flay/smelly.rb +0 -8
  84. data/test/samples/flay/smelly2.rb +0 -8
  85. data/test/samples/flog/complex.rb +0 -11
  86. data/test/samples/flog/smelly.rb +0 -11
  87. data/test/samples/location/dir1/file1.rb +0 -0
  88. data/test/samples/location/file0.rb +0 -0
  89. data/test/samples/location/file0_symlink.rb +0 -1
  90. data/test/samples/location/file_with_different_extension.py +0 -0
  91. data/test/samples/location/file_with_no_extension +0 -0
  92. data/test/samples/methods_count.rb +0 -7
  93. data/test/samples/module_names.rb +0 -18
  94. data/test/samples/no_methods.rb +0 -4
  95. data/test/samples/reek/not_smelly.rb +0 -35
  96. data/test/samples/reek/smelly.rb +0 -17
  97. data/test/samples/unparsable.rb +0 -1
  98. data/test/test_helper.rb +0 -64
@@ -1,7 +0,0 @@
1
- class Example
2
- def self.one_class_method
3
- end
4
-
5
- def one_instance_method
6
- end
7
- end
@@ -1,18 +0,0 @@
1
- module Foo
2
- end
3
-
4
- module Foo
5
- class Bar
6
- end
7
-
8
- class Baz
9
- end
10
- end
11
-
12
- class Foo::Qux
13
- end
14
-
15
- module Foo::Quux
16
- class Corge
17
- end
18
- end
@@ -1,4 +0,0 @@
1
- module Foo
2
- class NoMethods
3
- end
4
- end
@@ -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
@@ -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
@@ -1 +0,0 @@
1
- unparsable :<%=
@@ -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