def METHOD_NAME(element):  # noqa: C901
    # update legacy embroider_ attributes to namespaced attributes
    legacy_attribs = False
    for attrib in element.node.attrib:
        if attrib.startswith('embroider_'):
            _replace_legacy_embroider_param(element, attrib)
            legacy_attribs = True
    # convert legacy tie setting
    legacy_tie = element.get_param('ties', None)
    if legacy_tie == "True":
        element.set_param('ties', 0)
    elif legacy_tie == "False":
        element.set_param('ties', 3)
    # convert legacy fill_method
    legacy_fill_method = element.get_int_param('fill_method', None)
    if legacy_fill_method == 0:
        element.set_param('fill_method', 'auto_fill')
    elif legacy_fill_method == 1:
        element.set_param('fill_method', 'contour_fill')
    elif legacy_fill_method == 2:
        element.set_param('fill_method', 'guided_fill')
    elif legacy_fill_method == 3:
        element.set_param('fill_method', 'legacy_fill')
    underlay_angle = element.get_param('fill_underlay_angle', None)
    if underlay_angle and ',' in underlay_angle:
        element.set_param('fill_underlay_angle', underlay_angle.replace(',', ' '))
    # legacy satin method
    if element.get_boolean_param('e_stitch', False) is True:
        element.remove_param('e_stitch')
        element.set_param('satin_method', 'e_stitch')
    if element.get_boolean_param('satin_column', False) or element.get_int_param('stroke_method', 0) == 1:
        # reverse_rails defaults to Automatic, but we should never reverse an
        # old satin automatically, only new ones
        element.set_param('reverse_rails', 'none')
    # default setting for fill_underlay has changed
    if legacy_attribs and not element.get_param('fill_underlay', ""):
        element.set_param('fill_underlay', False)
    # default setting for running stitch length has changed (fills and strokes, not satins)
    if not element.get_boolean_param('satin_column', False) and element.get_float_param('running_stitch_length_mm', None) is None:
        element.set_param('running_stitch_length_mm', 1.5)
    # convert legacy stroke_method
    if element.get_style("stroke") and not element.node.get('inkscape:connection-start', None):
        # manual stitch
        legacy_manual_stitch = element.get_boolean_param('manual_stitch', False)
        if legacy_manual_stitch is True:
            element.remove_param('manual_stitch')
            element.set_param('stroke_method', 'manual_stitch')
        # stroke_method
        legacy_stroke_method = element.get_int_param('stroke_method', None)
        if legacy_stroke_method == 0:
            element.set_param('stroke_method', 'running_stitch')
        elif legacy_stroke_method == 1:
            element.set_param('stroke_method', 'ripple_stitch')
        if (not element.get_param('stroke_method', None) and
                element.get_param('satin_column', False) is False and
                not element.node.style('stroke-dasharray')):
            element.set_param('stroke_method', 'zigzag_stitch')
        # grid_size was supposed to be mm, but it was in pixels
        grid_size = element.get_float_param('grid_size', None)
        if grid_size:
            size = grid_size / PIXELS_PER_MM
            size = "{:.2f}".format(size)
            element.set_param('grid_size_mm', size)
            element.remove_param('grid_size')