def build_entry_options(opts = {})
        if opts[:group]
          if opts[:group].is_a?(String) || opts[:group].is_a?(Hash)
            group = find_group(opts[:group])
            raise "Group #{opts[:group].inspect} does not exist" if group.nil?

            opts[:group] = group
            opts[:group_id] = group.id
          elsif opts[:group].is_a?(Keepassx::Group)
            opts[:group_id] = opts[:group].id
          end

        elsif opts[:group_id] && opts[:group_id].is_a?(Integer)
          group = find_group(id: opts[:group_id])
          raise "Group #{opts[:group_id].inspect} does not exist" if group.nil?

          opts[:group] = group
        end
        opts
      end
def build_entry_options(opts = {})
        if opts[:group]
          if opts[:group].is_a?(String) || opts[:group].is_a?(Hash)
            group = find_group(opts[:group])
            raise "Group #{opts[:group].inspect} does not exist" if group.nil?

            opts[:group] = group
            opts[:group_id] = group.id
          elsif opts[:group].is_a?(Keepassx::Group)
            opts[:group_id] = opts[:group].id
          end

        elsif opts[:group_id] && opts[:group_id].is_a?(Integer)
          group = find_group(id: opts[:group_id])
          raise "Group #{opts[:group_id].inspect} does not exist" if group.nil?

          opts[:group] = group
        end
        opts
      end
rubocop:disable Metrics/MethodLength, Style/SafeNavigation