Commit d272b2e2a2b4d5fc9341013b31e524bb986811df
1 parent
5424a5c8
Exists in
master
and in
1 other branch
Rubocop: remove redundant self. calls
Showing
6 changed files
with
11 additions
and
21 deletions
Show diff stats
.rubocop_todo.yml
... | ... | @@ -13,7 +13,7 @@ Metrics/AbcSize: |
13 | 13 | # Offense count: 5 |
14 | 14 | # Configuration parameters: CountComments. |
15 | 15 | Metrics/ClassLength: |
16 | - Max: 205 | |
16 | + Max: 206 | |
17 | 17 | |
18 | 18 | # Offense count: 5 |
19 | 19 | Metrics/CyclomaticComplexity: |
... | ... | @@ -363,16 +363,6 @@ Style/Proc: |
363 | 363 | Style/RaiseArgs: |
364 | 364 | Enabled: false |
365 | 365 | |
366 | -# Offense count: 13 | |
367 | -# Cop supports --auto-correct. | |
368 | -Style/RedundantSelf: | |
369 | - Exclude: | |
370 | - - 'app/models/app.rb' | |
371 | - - 'app/models/issue_tracker.rb' | |
372 | - - 'app/models/notification_service.rb' | |
373 | - - 'app/models/problem.rb' | |
374 | - - 'lib/configurator.rb' | |
375 | - | |
376 | 366 | # Offense count: 3 |
377 | 367 | # Cop supports --auto-correct. |
378 | 368 | # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. | ... | ... |
app/models/app.rb
... | ... | @@ -106,11 +106,11 @@ class App |
106 | 106 | alias_method :notify_on_deploys?, :notify_on_deploys |
107 | 107 | |
108 | 108 | def repo_branch |
109 | - self.repository_branch.present? ? self.repository_branch : 'master' | |
109 | + repository_branch.present? ? repository_branch : 'master' | |
110 | 110 | end |
111 | 111 | |
112 | 112 | def github_repo? |
113 | - self.github_repo.present? | |
113 | + github_repo.present? | |
114 | 114 | end |
115 | 115 | |
116 | 116 | def github_url |
... | ... | @@ -122,7 +122,7 @@ class App |
122 | 122 | end |
123 | 123 | |
124 | 124 | def bitbucket_repo? |
125 | - self.bitbucket_repo.present? | |
125 | + bitbucket_repo.present? | |
126 | 126 | end |
127 | 127 | |
128 | 128 | def bitbucket_url |
... | ... | @@ -157,12 +157,12 @@ class App |
157 | 157 | if (copy_app = App.where(:_id => app_id).first) |
158 | 158 | # Copy fields |
159 | 159 | (copy_app.fields.keys - %w(_id name created_at updated_at)).each do |k| |
160 | - self.send("#{k}=", copy_app.send(k)) | |
160 | + send("#{k}=", copy_app.send(k)) | |
161 | 161 | end |
162 | 162 | # Clone the embedded objects that can be changed via apps/edit (ignore errs & deploys, etc.) |
163 | 163 | %w(watchers issue_tracker notification_service).each do |relation| |
164 | 164 | if (obj = copy_app.send(relation)) |
165 | - self.send("#{relation}=", obj.is_a?(Array) ? obj.map(&:clone) : obj.clone) | |
165 | + send("#{relation}=", obj.is_a?(Array) ? obj.map(&:clone) : obj.clone) | |
166 | 166 | end |
167 | 167 | end |
168 | 168 | end | ... | ... |
app/models/issue_tracker.rb
... | ... | @@ -12,7 +12,7 @@ class IssueTracker |
12 | 12 | def tracker |
13 | 13 | @tracker ||= |
14 | 14 | begin |
15 | - klass = ErrbitPlugin::Registry.issue_trackers[self.type_tracker] || ErrbitPlugin::NoneIssueTracker | |
15 | + klass = ErrbitPlugin::Registry.issue_trackers[type_tracker] || ErrbitPlugin::NoneIssueTracker | |
16 | 16 | # TODO: we need to find out a better way to pass those config to the issue tracker |
17 | 17 | klass.new(options.merge( |
18 | 18 | github_repo: app.try(:github_repo), |
... | ... | @@ -22,7 +22,7 @@ class IssueTracker |
22 | 22 | end |
23 | 23 | |
24 | 24 | def type_tracker |
25 | - self.attributes['type_tracker'] ? self.attributes['type_tracker'] : 'none' | |
25 | + attributes['type_tracker'] ? attributes['type_tracker'] : 'none' | |
26 | 26 | end |
27 | 27 | |
28 | 28 | # Allow the tracker to validate its own params | ... | ... |
app/models/notification_service.rb
app/models/problem.rb
lib/configurator.rb