Code Duplication    Length = 2-2 lines in 5 locations

lib/nose/cli/execute.rb 1 location

@@ 42-43 (lines=2) @@
39
        # Construct an instance of the backend
40
        result = OpenStruct.new
41
        result.workload = Workload.new plans.schema.model
42
        result.workload.mix = options[:mix].to_sym \
43
          unless options[:mix] == 'default' && result.workload.mix != :default
44
        result.indexes = plans.schema.indexes.values
45
        backend = get_backend(options, result)
46

lib/nose/cli/search.rb 1 location

@@ 35-36 (lines=2) @@
32
      def search(name)
33
        # Get the workload and cost model
34
        workload = Workload.load name
35
        workload.mix = options[:mix].to_sym \
36
          unless options[:mix] == 'default' && workload.mix != :default
37
        workload.remove_updates if options[:read_only]
38
        cost_model = get_class_from_config options, 'cost', :cost_model
39

lib/nose/cli/search_all.rb 1 location

@@ 31-32 (lines=2) @@
28
      def search_all(name, directory)
29
        # Load the workload and cost model and create the output directory
30
        workload = Workload.load name
31
        workload.mix = options[:mix].to_sym \
32
          unless options[:mix] == 'default' && workload.mix != :default
33
        workload.remove_updates if options[:read_only]
34
        cost_model = get_class_from_config options, 'cost', :cost_model
35
        FileUtils.mkdir_p(directory) unless Dir.exist?(directory)

lib/nose/cli/dump.rb 1 location

@@ 21-22 (lines=2) @@
18
        plans = Plans::ExecutionPlans.load plan_name
19
        plans.mix = options[:mix].to_sym \
20
          unless options[:mix] == 'default' && plans.mix != :default
21
22
        # Set the cost of each plan
23
        cost_model = get_class_from_config options, 'cost', :cost_model
24
        plans.calculate_cost cost_model
25

lib/nose/cli/plan_schema.rb 1 location

@@ 21-22 (lines=2) @@
18
19
      def plan_schema(workload_name, schema_name)
20
        workload = Workload.load workload_name
21
        workload.mix = options[:mix].to_sym \
22
          unless options[:mix] == 'default' && workload.mix != :default
23
        schema = Schema.load schema_name
24
        indexes = schema.indexes.values
25