You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: use_flat_map.rs
    path of file: ./repos/biome/crates/biome_js_analyze/src/analyzers/complexity
    
    the code of the file until where you have to start completion: use crate::JsRuleAction;
use biome_analyze::context::RuleContext;
use biome_analyze::{declare_rule, ActionCategory, Ast, FixKind, Rule, RuleDiagnostic, RuleSource};
use biome_console::markup;
use biome_diagnostics::Applicability;
use biome_js_factory::make::{ident, js_name};
use biome_js_syntax::{AnyJsExpression, AnyJsMemberExpression, AnyJsName, JsCallExpression};
use biome_rowan::{AstNode, AstSeparatedList, BatchMutationExt};

declare_rule! {
    /// Promotes the use of `.flatMap()` when `map().flat()` are used together.
    ///
    /// ## Examples
    ///
    /// ### Invalid
    ///
    /// ```js,expect_diagnostic
    /// const array = ["split", "the text", "into words"];
    /// array.map(sentence => sentence.split
    
    fn action(ctx: &RuleContext<Self>, flat_call: &Self::State) -> Option<JsRuleAction> {
        let node = ctx.query();
        let mut mutation = ctx.root().begin();
        let Ok(AnyJsExpression::JsStaticMemberExpression(old_static_member_expression)) =
            flat_call.callee()
        else {
            return None;
        };
        let member = js_name(ident("flatMap"));

        let flat_map_member_expression =
            old_static_member_expression.with_member(AnyJsName::JsName(member));

        let flat_map_call =
            flat_call
                .clone()
                .with_callee(AnyJsExpression::JsStaticMemberExpression(
                    flat_map_member_expression,
                ));

        mutation.replace_node(node.clone(), flat_map_call);

        Some(JsRuleAction {
            mutation,
            message: markup! {"Replace the chain with "<Emphasis>".flatMap()"</Emphasis>"."}
                .to_owned(),
            category: ActionCategory::QuickFix,
            applicability: Applicability::Always,
        })
    }