rubycritic 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +593 -0
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +7 -0
  5. data/CONTRIBUTING.md +17 -15
  6. data/README.md +15 -4
  7. data/Rakefile +9 -6
  8. data/bin/rubycritic +2 -2
  9. data/lib/rubycritic.rb +21 -1
  10. data/lib/rubycritic/analysers/churn.rb +4 -2
  11. data/lib/rubycritic/analysers/helpers/ast_node.rb +4 -8
  12. data/lib/rubycritic/analysers/helpers/methods_counter.rb +2 -5
  13. data/lib/rubycritic/analysers/helpers/modules_locator.rb +2 -5
  14. data/lib/rubycritic/analysers/helpers/parser.rb +12 -0
  15. data/lib/rubycritic/analysers/helpers/reek.rb +6 -2
  16. data/lib/rubycritic/analysers/smells/reek.rb +1 -1
  17. data/lib/rubycritic/analysers_runner.rb +13 -7
  18. data/lib/rubycritic/cli/application.rb +24 -0
  19. data/lib/rubycritic/cli/options.rb +57 -0
  20. data/lib/rubycritic/commands/ci.rb +28 -0
  21. data/lib/rubycritic/commands/default.rb +30 -0
  22. data/lib/rubycritic/commands/help.rb +13 -0
  23. data/lib/rubycritic/commands/version.rb +11 -0
  24. data/lib/rubycritic/configuration.rb +19 -14
  25. data/lib/rubycritic/core/analysed_module.rb +1 -1
  26. data/lib/rubycritic/core/smell.rb +1 -1
  27. data/lib/rubycritic/report_generators/base.rb +1 -1
  28. data/lib/rubycritic/report_generators/line.rb +1 -1
  29. data/lib/rubycritic/report_generators/smells_index.rb +1 -0
  30. data/lib/rubycritic/report_generators/templates/code_file.html.erb +1 -1
  31. data/lib/rubycritic/report_generators/templates/smells_index.html.erb +6 -2
  32. data/lib/rubycritic/report_generators/templates/smelly_line.html.erb +1 -1
  33. data/lib/rubycritic/report_generators/view_helpers.rb +4 -4
  34. data/lib/rubycritic/reporters/base.rb +1 -1
  35. data/lib/rubycritic/revision_comparator.rb +14 -14
  36. data/lib/rubycritic/source_control_systems/base.rb +9 -32
  37. data/lib/rubycritic/source_control_systems/double.rb +6 -7
  38. data/lib/rubycritic/source_control_systems/git.rb +10 -16
  39. data/lib/rubycritic/source_control_systems/mercurial.rb +29 -0
  40. data/lib/rubycritic/source_locator.rb +4 -5
  41. data/lib/rubycritic/version.rb +1 -1
  42. data/rubycritic.gemspec +4 -3
  43. data/test/lib/rubycritic/analysers/churn_test.rb +5 -5
  44. data/test/lib/rubycritic/analysers/smells/flay_test.rb +1 -1
  45. data/test/lib/rubycritic/configuration_test.rb +8 -7
  46. data/test/lib/rubycritic/core/analysed_module_test.rb +2 -2
  47. data/test/lib/rubycritic/core/smell_test.rb +2 -2
  48. data/test/lib/rubycritic/source_control_systems/{source_control_system_test.rb → base_test.rb} +1 -1
  49. data/test/lib/rubycritic/source_control_systems/double_test.rb +11 -0
  50. data/test/lib/rubycritic/source_control_systems/git_test.rb +13 -0
  51. data/test/lib/rubycritic/source_control_systems/interfaces/basic.rb +7 -0
  52. data/test/lib/rubycritic/source_control_systems/interfaces/time_travel.rb +7 -0
  53. data/test/lib/rubycritic/source_control_systems/mercurial_test.rb +11 -0
  54. data/test/lib/rubycritic/source_locator_test.rb +8 -2
  55. data/test/test_helper.rb +29 -0
  56. metadata +49 -13
  57. data/lib/rubycritic/cli.rb +0 -46
  58. data/lib/rubycritic/modules_initializer.rb +0 -14
  59. data/lib/rubycritic/orchestrator.rb +0 -23
@@ -1,14 +0,0 @@
1
- require "rubycritic/source_locator"
2
- require "rubycritic/core/analysed_module"
3
-
4
- module Rubycritic
5
-
6
- module ModulesInitializer
7
- def self.init(paths)
8
- SourceLocator.new(paths).pathnames.map do |pathname|
9
- AnalysedModule.new(:pathname => pathname)
10
- end
11
- end
12
- end
13
-
14
- end
@@ -1,23 +0,0 @@
1
- require "rubycritic/source_control_systems/base"
2
- require "rubycritic/modules_initializer"
3
- require "rubycritic/analysers_runner"
4
- require "rubycritic/revision_comparator"
5
-
6
- module Rubycritic
7
-
8
- class Orchestrator
9
- def initialize
10
- @source_control_system = SourceControlSystem::Base.create
11
- end
12
-
13
- def critique(paths)
14
- analysed_modules = ModulesInitializer.init(paths)
15
- AnalysersRunner.new(analysed_modules, @source_control_system).run
16
- if @source_control_system.has_revision?
17
- RevisionComparator.new(analysed_modules, @source_control_system, paths).set_statuses
18
- end
19
- analysed_modules
20
- end
21
- end
22
-
23
- end