rubycritic 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubycritic.rb +4 -4
  3. data/lib/rubycritic/analysers/churn.rb +16 -0
  4. data/lib/rubycritic/analysers/flog.rb +1 -2
  5. data/lib/rubycritic/analysers_runner.rb +7 -7
  6. data/lib/rubycritic/quality_adapters/flog.rb +20 -0
  7. data/lib/rubycritic/report_generators/assets/javascripts/application.js +56 -0
  8. data/lib/rubycritic/report_generators/assets/javascripts/highcharts.src.js +17672 -0
  9. data/lib/rubycritic/report_generators/assets/stylesheets/application.css +5 -0
  10. data/lib/rubycritic/report_generators/overview_generator.rb +24 -0
  11. data/lib/rubycritic/report_generators/reporter.rb +11 -5
  12. data/lib/rubycritic/report_generators/templates/layouts/application.html.erb +4 -2
  13. data/lib/rubycritic/report_generators/templates/overview.html.erb +5 -0
  14. data/lib/rubycritic/report_generators/view_helpers.rb +4 -0
  15. data/lib/rubycritic/revision_comparator.rb +1 -3
  16. data/lib/rubycritic/smell_adapters/flay.rb +3 -2
  17. data/lib/rubycritic/smell_adapters/flog.rb +4 -2
  18. data/lib/rubycritic/smell_adapters/reek.rb +3 -2
  19. data/lib/rubycritic/source_control_systems/git.rb +4 -0
  20. data/lib/rubycritic/source_control_systems/source_control_system.rb +4 -0
  21. data/lib/rubycritic/turbulence.rb +32 -0
  22. data/lib/rubycritic/version.rb +1 -1
  23. data/test/lib/rubycritic/analysers/churn_test.rb +23 -0
  24. data/test/lib/rubycritic/analysers_runner_test.rb +3 -3
  25. data/test/lib/rubycritic/quality_adapters/flog_test.rb +18 -0
  26. data/test/lib/rubycritic/{metric_adapters/flay_adapter_test.rb → smell_adapters/flay_test.rb} +2 -4
  27. data/test/lib/rubycritic/{metric_adapters/flog_adapter_test.rb → smell_adapters/flog_test.rb} +3 -5
  28. data/test/lib/rubycritic/{metric_adapters/reek_adapter_test.rb → smell_adapters/reek_test.rb} +4 -7
  29. data/test/lib/rubycritic/turbulence_test.rb +27 -0
  30. data/test/samples/flog/smelly2.rb +11 -0
  31. metadata +22 -11
  32. data/lib/rubycritic/smells_aggregator.rb +0 -13
  33. data/test/lib/rubycritic/smells_aggregator_test.rb +0 -32
@@ -1,13 +0,0 @@
1
- module Rubycritic
2
-
3
- class SmellsAggregator
4
- def initialize(smell_adapters)
5
- @smell_adapters = smell_adapters
6
- end
7
-
8
- def smells
9
- @smells ||= @smell_adapters.map(&:smells).flatten.sort
10
- end
11
- end
12
-
13
- end
@@ -1,32 +0,0 @@
1
- require "test_helper"
2
- require "rubycritic/smells_aggregator"
3
-
4
- describe Rubycritic::SmellsAggregator do
5
- context "when analysing smelly files" do
6
- before do
7
- smell1 = Rubycritic::Smell.new
8
- smell2 = Rubycritic::Smell.new
9
- @smells = [smell2, smell1]
10
- @smell_adapters = [stub(:smells => [smell1]), stub(:smells => [smell2])]
11
- end
12
-
13
- describe "#smells" do
14
- it "returns the smells found in those files" do
15
- Rubycritic::SmellsAggregator.new(@smell_adapters).smells.must_equal @smells
16
- end
17
- end
18
- end
19
-
20
- context "when analysing files with no smells" do
21
- before do
22
- @smells = []
23
- @smell_adapters = [stub(:smells => @smells)]
24
- end
25
-
26
- describe "#smells" do
27
- it "returns an empty array" do
28
- Rubycritic::SmellsAggregator.new(@smell_adapters).smells.must_equal @smells
29
- end
30
- end
31
- end
32
- end