Total Complexity | 2 |
Total Lines | 13 |
Duplicated Lines | 100 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | # frozen_string_literal: true |
||
10 | class Create < Action |
||
11 | attr_accessor :account |
||
12 | |||
13 | # @param [AMA::Chef::User::Model::Account] account |
||
14 | def initialize(account) |
||
15 | @account = account |
||
16 | super() |
||
17 | end |
||
18 | |||
19 | def apply(resource_factory) |
||
20 | resource_factory.user @account.id.to_s |
||
21 | end |
||
22 | end |
||
23 | end |
||
28 |