ruby-watchr 0.1.6.2 → 0.1.6.3

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.
@@ -12,10 +12,20 @@ module Watchr
12
12
  smell.location['lines'].first
13
13
  )
14
14
 
15
+ type = case smell.smell['subclass']
16
+ when 'IrresponsibleModule' then IRRESPONSIBLE_MODULE
17
+ when 'DuplicateMethodCall' then DUPLICATE_METHOD_CALL
18
+ when 'NestedIterators' then NESTED_ITERATORS
19
+ when 'TooManyStatements' then TOO_MANY_STATEMENTS
20
+ when 'FeatureEnvy' then FEATURE_ENVY
21
+ when 'UtilityFunction' then UTILITY_FUNCTION
22
+ else nil
23
+ end
24
+
15
25
  add_smell(Watchr::Smell.new(
16
26
  smell.smell['subclass'],
17
27
  smell.location['context'], smell.smell['message'], location, {}
18
- ))
28
+ )) unless type.nil?
19
29
  end
20
30
  end
21
31
  end
@@ -29,5 +29,28 @@ module Watchr
29
29
  # Code in multiple places is similar (not identical).
30
30
  #
31
31
  SIMILAR_CODE = :similar_code
32
+
33
+
34
+ IRRESPONSIBLE_MODULE = :irresponsible_module
35
+ DUPLICATE_METHOD_CALL = :duplicate_method_call
36
+ NESTED_ITERATORS = :nested_iterators
37
+ TOO_MANY_STATEMENTS = :too_many_statements
38
+ FEATURE_ENVY = :feature_envy
39
+ UTILITY_FUNCTION = :utility_function
40
+
41
+ ALL_SMELLS = [
42
+ COMPLEX_METHOD,
43
+ VERY_COMPLEX_METHOD,
44
+ COMPLEX_OBJECT,
45
+ VERY_COMPLEX_OBJECT,
46
+ IDENTICAL_CODE,
47
+ SIMILAR_CODE,
48
+ IRRESPONSIBLE_MODULE,
49
+ DUPLICATE_METHOD_CALL,
50
+ NESTED_ITERATORS,
51
+ TOO_MANY_STATEMENTS,
52
+ FEATURE_ENVY,
53
+ UTILITY_FUNCTION
54
+ ]
32
55
  end
33
56
  end
@@ -1,3 +1,3 @@
1
1
  module Watchr
2
- VERSION = "0.1.6.2"
2
+ VERSION = "0.1.6.3"
3
3
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 1
8
8
  - 6
9
- - 2
10
- version: 0.1.6.2
9
+ - 3
10
+ version: 0.1.6.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Petr Janda