summaryrefslogtreecommitdiff
path: root/.rubocop.yml
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-11-14 20:19:38 +0100
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-08 08:43:08 +0100
commit79fb993a6598df4836e5c0ed4e27a72e844429fc (patch)
treebb220378647015e4ba6fc8fe2e2c1d0ce4d7949b /.rubocop.yml
parente02940e32941cc253f713ef3fe0aac896c9342ac (diff)
downloadgitlab-ce-79fb993a6598df4836e5c0ed4e27a72e844429fc.tar.gz
Enable rubocop metrics
This enables rubocop metrics like CyclomaticComplexity and ABCSize. Initial threshold values are high, should be probably decreased.
Diffstat (limited to '.rubocop.yml')
-rw-r--r--.rubocop.yml43
1 files changed, 24 insertions, 19 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index d59edbc8b17..fd382182abe 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -735,23 +735,39 @@ Metrics/AbcSize:
Description: >-
A calculated magnitude based on number of assignments,
branches, and conditions.
- Enabled: false
+ Enabled: true
+ Max: 70
+
+Metrics/CyclomaticComplexity:
+ Description: >-
+ A complexity metric that is strongly correlated to the number
+ of test cases needed to validate a method.
+ Enabled: true
+ Max: 16
+
+Metrics/PerceivedComplexity:
+ Description: >-
+ A complexity metric geared towards measuring complexity for a
+ human reader.
+ Enabled: true
+ Max: 16
+
+Metrics/ParameterLists:
+ Description: 'Avoid parameter lists longer than three or four parameters.'
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
+ Enabled: true
+ Max: 8
Metrics/BlockNesting:
Description: 'Avoid excessive block nesting'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
- Enabled: false
+ Enabled: true
+ Max: 4
Metrics/ClassLength:
Description: 'Avoid classes longer than 100 lines of code.'
Enabled: false
-Metrics/CyclomaticComplexity:
- Description: >-
- A complexity metric that is strongly correlated to the number
- of test cases needed to validate a method.
- Enabled: false
-
Metrics/LineLength:
Description: 'Limit lines to 80 characters.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
@@ -762,17 +778,6 @@ Metrics/MethodLength:
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
Enabled: false
-Metrics/ParameterLists:
- Description: 'Avoid parameter lists longer than three or four parameters.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
- Enabled: false
-
-Metrics/PerceivedComplexity:
- Description: >-
- A complexity metric geared towards measuring complexity for a
- human reader.
- Enabled: false
-
#################### Lint ################################
### Warnings