Code Duplication    Length = 2-2 lines in 5 locations

lib/nose/cli/execute.rb 1 location

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

lib/nose/cli/search.rb 1 location

@@ 35-36 (lines=2) @@
32
                         desc: 'the objective function to use in the ILP'
33
      option :by_id_graph, type: :boolean, default: false,
34
                           desc: 'whether to group generated indexes in' \
35
                                 'graphs by ID',
36
                           aliases: '-i'
37
38
      def search(name)
39
        # Get the workload and cost model

lib/nose/cli/search_all.rb 1 location

@@ 31-32 (lines=2) @@
28
                           aliases: '-n',
29
                           desc: 'the maximum number of results to produce'
30
      def search_all(name, directory)
31
        # Load the workload and cost model and create the output directory
32
        workload = Workload.load name
33
        workload.mix = options[:mix].to_sym \
34
          unless options[:mix] == 'default' && workload.mix != :default
35
        workload.remove_updates if options[:read_only]

lib/nose/cli/dump.rb 1 location

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

lib/nose/cli/plan_schema.rb 1 location

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