ruby-watchr 0.1.5.2 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/watchr/analyse.rb +1 -1
- data/lib/watchr/analysers/reek.rb +23 -0
- data/lib/watchr/file_analyse.rb +6 -2
- data/lib/watchr/{flay_metric → metrics/flay}/diff.rb +0 -0
- data/lib/watchr/{flay_metric → metrics/flay}/report.rb +1 -1
- data/lib/watchr/{flog_metric → metrics/flog}/class.rb +0 -0
- data/lib/watchr/{flog_metric → metrics/flog}/method.rb +0 -0
- data/lib/watchr/{flog_metric → metrics/flog}/report.rb +2 -2
- data/lib/watchr/metrics/reek/report.rb +15 -0
- data/lib/watchr/version.rb +1 -1
- data/spec/watchr/file_analyse_spec.rb +2 -0
- data/spec/watchr/flay/report_spec.rb +1 -1
- data/spec/watchr/flog_metric/flog_matric/flog_report_spec.rb +1 -1
- metadata +10 -9
data/lib/watchr/analyse.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'watchr/smell'
|
2
|
+
|
3
|
+
module Watchr
|
4
|
+
module Analysers
|
5
|
+
module Reek
|
6
|
+
include SmellTypes
|
7
|
+
|
8
|
+
def analyse_reek(report)
|
9
|
+
report.smells.each do |smell|
|
10
|
+
location = Location.new(
|
11
|
+
smell.location['source'],
|
12
|
+
smell.location['lines'].first
|
13
|
+
)
|
14
|
+
|
15
|
+
add_smell(Watchr::Smell.new(
|
16
|
+
smell.smell['subclass'],
|
17
|
+
smell.location['context'], smell.smell['message'], location, {}
|
18
|
+
))
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/watchr/file_analyse.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
require 'watchr/
|
1
|
+
require 'watchr/metrics/flog/report'
|
2
|
+
require 'watchr/metrics/reek/report'
|
2
3
|
require 'watchr/smell'
|
3
4
|
require 'watchr/smells_collector'
|
4
5
|
require 'watchr/analysers/flog'
|
6
|
+
require 'watchr/analysers/reek'
|
5
7
|
require 'watchr/rating'
|
6
8
|
|
7
9
|
module Watchr
|
@@ -12,6 +14,7 @@ module Watchr
|
|
12
14
|
#
|
13
15
|
class FileAnalyse
|
14
16
|
include Analysers::Flog
|
17
|
+
include Analysers::Reek
|
15
18
|
include Rating
|
16
19
|
|
17
20
|
attr_reader :path
|
@@ -24,8 +27,9 @@ module Watchr
|
|
24
27
|
def initialize(path)
|
25
28
|
@path = path
|
26
29
|
@smells = SmellsCollector.new
|
27
|
-
|
30
|
+
|
28
31
|
analyse_flog(FlogMetric::Report.new([path]))
|
32
|
+
analyse_reek(ReekMetric::Report.new([path]))
|
29
33
|
end
|
30
34
|
|
31
35
|
def smelly?
|
File without changes
|
File without changes
|
File without changes
|
data/lib/watchr/version.rb
CHANGED
metadata
CHANGED
@@ -5,9 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 0.1.5.2
|
8
|
+
- 6
|
9
|
+
version: 0.1.6
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Petr Janda
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2012-07-
|
17
|
+
date: 2012-07-13 00:00:00 +02:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -75,13 +74,15 @@ files:
|
|
75
74
|
- lib/watchr.rb
|
76
75
|
- lib/watchr/analyse.rb
|
77
76
|
- lib/watchr/analysers/flog.rb
|
77
|
+
- lib/watchr/analysers/reek.rb
|
78
78
|
- lib/watchr/file_analyse.rb
|
79
|
-
- lib/watchr/flay_metric/diff.rb
|
80
|
-
- lib/watchr/flay_metric/report.rb
|
81
|
-
- lib/watchr/flog_metric/class.rb
|
82
|
-
- lib/watchr/flog_metric/method.rb
|
83
|
-
- lib/watchr/flog_metric/report.rb
|
84
79
|
- lib/watchr/location.rb
|
80
|
+
- lib/watchr/metrics/flay/diff.rb
|
81
|
+
- lib/watchr/metrics/flay/report.rb
|
82
|
+
- lib/watchr/metrics/flog/class.rb
|
83
|
+
- lib/watchr/metrics/flog/method.rb
|
84
|
+
- lib/watchr/metrics/flog/report.rb
|
85
|
+
- lib/watchr/metrics/reek/report.rb
|
85
86
|
- lib/watchr/paths.rb
|
86
87
|
- lib/watchr/rating.rb
|
87
88
|
- lib/watchr/smell.rb
|