function getHeaderQueryBody(elem, request, objParameters, opt) {
    const origObjParameters = objParameters;

    if (elem) {
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*query\\s*\\n*\\t*\\.\\s*\\n*\\t*')).join('.query.');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*body\\s*\\n*\\t*\\.\\s*\\n*\\t*')).join('.body.');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*headers')).join('.headers');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*query')).join('.query');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*body')).join('.body');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*headers\\s*\\n*\\t*\\.\\s*\\n*\\t*')).join('.headers.');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*query\\s*\\n*\\t*[\\;|\\,|\\}]')).join('.query ');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*body\\s*\\n*\\t*[\\;|\\,|\\}]')).join('.body ');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*headers\\s*\\n*\\t*[\\;|\\,|\\}]')).join('.headers ');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\.\\s*\\n*\\t*')).join('.');
        elem = elem.split(new RegExp('\\s*\\n*\\t*\\=\\s*\\n*\\t*')).join(' = ');
    }

    const autoBody = autoBodyLogic(opt.autoBody);
    const autoQuery = autoQueryLogic(opt.autoQuery);
    const autoHeaders = autoHeadersLogic(opt.autoHeaders);

    try {
        for (let idx = 0; idx < request.length; ++idx) {
            let req = request[idx];

            if (req && req.split(/\(|\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n|"|'|`|\*/).length > 1) {
                continue;
            }
            elem = elem.split(new RegExp(`[\\(|\\)|\\{|\\}|\\[|\\]|\\/|\\|;|:|!|@|\\$|#|\\?|\\+|,|\\||&|\\t|\\n|\\*]${req}`)).join(` ${req}`, 'gm');
            const origElem = elem;

            // storing strings
            elem = elem.replaceAll(statics.STRING_QUOTE, '"');
            let str = utils.popString(elem, true);
            let count = 0;
            let storedStrings = [];
            while (str && count < 300) {
                if (str) {
                    let ref = `___STRING_REF___${count}___`;
                    elem = elem.replace(str, ref);
                    storedStrings.push({ ref: `___STRING_REF___${count}___`, str });
                    str = utils.popString(elem, true);
                }
                count += 1;
            }

            try {
                let inputTypes = ['headers', 'query', 'body'];
                for (let idxInput = 0; idxInput < inputTypes.length; ++idxInput) {
                    let inputType = inputTypes[idxInput];

                    // ES Mudule/TypeScript variable
                    let splitedElemTS = elem.split(new RegExp(`(\\s+\\w+\\s*\\:\\s*\\w+\\s*\\=\\s*${req}\\s*\\.\\s*${inputType}(?!\\.))`));
                    for (let idxElem = 1; idxElem < splitedElemTS.length; idxElem += 2) {
                        let e = splitedElemTS[idxElem];
                        if (e && e.includes(':') && e.includes('=') && e.includes(`.${inputType}`)) {
                            let varName = e.split(':')[0].trim();
                            elem = elem.split(new RegExp(`[\\(|\\)|\\{|\\}|\\[|\\]|\\/|\\|;|:|!|@|\\$|#|\\?|\\+|,|\\||&|\\t|\\n|\\*]${varName}`)).join(` ${varName}`, 'gm');
                            elem = elem.replaceAll(varName, `${req}.${inputType}`);
                        }
                    }

                    // CommonJS variable
                    let splitedElem = elem.split(new RegExp(`(\\s+\\w+\\s*\\=\\s*${req}\\s*\\.\\s*${inputType}(?!\\.))`));
                    for (let idxElem = 1; idxElem < splitedElem.length; idxElem += 2) {
                        let e = splitedElem[idxElem];
                        if (e && e.includes('=') && e.includes(`.${inputType}`)) {
                            let varName = e.split('=')[0].trim();
                            elem = elem.split(new RegExp(`[\\(|\\)|\\{|\\}|\\[|\\]|\\/|\\|;|:|!|@|\\$|#|\\?|\\+|,|\\||&|\\t|\\n|\\*]${varName}`)).join(` ${varName}`, 'gm');
                            elem = elem.replaceAll(varName, `${req}.${inputType}`);
                        }
                    }
                }
            } catch (err) {
                elem = origElem;
            }

            // Coming back with the strings
            storedStrings
                .filter(e => e)
                .forEach(s => {
                    elem = elem.replace(s.ref, s.str);
                });

            elem = elem.replaceAll('"', statics.STRING_QUOTE);

            /**
             * Headers
             */
            if (autoHeaders && req && elem && elem.split(' ' + req + '.headers.').length > 1) {
                elem.split(' ' + req + '.headers.')
                    .splice(1)
                    .filter(e => e)
                    .forEach(p => {
                        p = p.trim();
                        let name = p
                            .split(/\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n| /)[0]
                            .replaceAll(' ', '')
                            .replaceAll('\r', '');

                        if (name && name.includes('.')) {
                            name = name.split('.')[0];
                        }
                        if (name && name.slice(-1)[0] == '(') {
                            return;
                        }

                        name = name.replaceAll('...', '');

                        if (!!objParameters[name] === false || (objParameters[name] && objParameters[name].name !== name) || (objParameters[name] && objParameters[name].name === name && objParameters[name].in !== 'header')) {
                            name += `__[__[__header__]__]`;

                            if (!!objParameters[name] === false) {
                                // Checks if the parameter name already exists
                                objParameters[name] = {
                                    name,
                                    in: 'header'
                                };
                            }
                            if (!objParameters[name].in) {
                                objParameters[name].in = 'header';
                            }
                            if (!objParameters[name].type && !objParameters[name].schema) {
                                // by default: 'type' is 'string' when 'schema' is missing
                                if (swaggerTags.getOpenAPI()) {
                                    objParameters[name].schema = { type: 'string' };
                                } else {
                                    objParameters[name].type = 'string';
                                }
                            }
                        }
                    });
            }

            /**
             * CASE: Destructuring body, such as: const { body, query, headers } = req
             */
            const bodyRegexPattern1 = '\\}\\s*\\n*\\t*\\=\\s*\\n*\\t*' + req + '[\\s|\\;]';
            if (autoBody && req && elem && elem.split(new RegExp(bodyRegexPattern1)).length > 1) {
                let elems = elem.split(new RegExp(bodyRegexPattern1));
                for (let idxBody = 0; idxBody < elems.length - 1; ++idxBody) {
                    let requestTypes = elems[idxBody];

                    /**
                     * CASE: const { item1, item2: { subItem1, subItem2 } } = req.body;
                     * Solution: Eliminate sub-items for now
                     * TODO: In the future, handle sub-items
                     */
                    if (requestTypes.split(new RegExp('\\:\\s*\\n*\\t*\\{')).length > 1) {
                        let subObjs = requestTypes.split(new RegExp('\\:\\s*\\n*\\t*\\{'));
                        for (let idxObj = 1; idxObj < subObjs.length; ++idxObj) {
                            subObjs[idxObj] = subObjs[idxObj].split('}')[1];
                        }
                        requestTypes = subObjs.join('');
                    }
                    /* END CASE */

                    requestTypes = requestTypes.split('{').slice(-1)[0];
                    requestTypes = requestTypes.split(',');
                    requestTypes = requestTypes.map(e => e.trim());

                    const bodyRegex = /[\s|(|{|[|,|;|/]body\./;
                    if (requestTypes.includes('body')) {
                        elem.split(bodyRegex)
                            .splice(1)
                            .filter(e => e)
                            .forEach(p => {
                                p = p.trim();
                                let name = p
                                    .split(/\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n| /)[0]
                                    .replaceAll(' ', '')
                                    .replaceAll('\r', '');

                                if (name && name.includes('.')) {
                                    name = name.split('.')[0];
                                }
                                if (name && name.slice(-1)[0] == '(') {
                                    return;
                                }

                                name = name.replaceAll('...', '');

                                if (!!objParameters['__obj__in__body__'] === false) {
                                    objParameters['__obj__in__body__'] = {
                                        name: '__obj__in__body__',
                                        in: 'body',
                                        schema: {
                                            type: 'object',
                                            properties: {}
                                        }
                                    };
                                }
                                if (!!objParameters['__obj__in__body__'] === true) {
                                    // Checks if the parameter name already exists
                                    objParameters['__obj__in__body__'].schema.properties[name] = {
                                        example: 'any'
                                    };
                                }
                            });
                        elem = elem.replaceAll(/\}\s*=\s*body[\s|;]/, `} = ${req}.body `);
                    }

                    ['query', 'headers'].forEach(requestType => {
                        if (requestTypes.includes(requestType)) {
                            elem.split(new RegExp(`[\\s|(|{|[|,|;|/]${requestType}\\.`))
                                .splice(1)
                                .filter(e => e)
                                .map(name => {
                                    name = name.trim();
                                    name = name.replaceAll('...', '');
                                    name = name
                                        .split(/\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n| /)[0]
                                        .replaceAll(' ', '')
                                        .replaceAll('\r', '');
                                    if (name && name.slice(-1)[0] == '(') {
                                        return;
                                    }
                                    if (name == '') {
                                        return;
                                    }

                                    let formattedRequestType = requestType;
                                    if (formattedRequestType === 'headers') {
                                        formattedRequestType = 'header';
                                    }
                                    if (!!objParameters[name] === false || (objParameters[name] && objParameters[name].name !== name) || (objParameters[name] && objParameters[name].name === name && objParameters[name].in !== formattedRequestType)) {
                                        name += `__[__[__${formattedRequestType}__]__]`;

                                        if (!!objParameters[name] === false) {
                                            // Checks if the parameter name already exists
                                            objParameters[name] = {
                                                name,
                                                in: formattedRequestType
                                            };
                                        }
                                        if (!objParameters[name].in) {
                                            objParameters[name].in = formattedRequestType;
                                        }
                                        if (!objParameters[name].type && !objParameters[name].schema) {
                                            // by default: 'type' is 'string' when 'schema' is missing
                                            if (swaggerTags.getOpenAPI()) {
                                                objParameters[name].schema = { type: 'string' };
                                            } else {
                                                objParameters[name].type = 'string';
                                            }
                                        }
                                    }
                                });
                            elem = elem.replaceAll(new RegExp(`\\}\\s*\\=\\s*${requestType}[\\s|;]`), `} = ${req}.${requestType} `);
                        }
                    });
                }
            }

            /**
             * Headers
             * Destructuring in body, such as: {a, b} = req.headers
             */
            if (autoHeaders && req && elem && elem.split(new RegExp('\\}\\s*\\n*\\t*\\=\\s*\\n*\\t*' + req + '.headers\\s+')).length > 1) {
                let elems = elem.split(new RegExp('\\}\\s*\\n*\\t*\\=\\s*\\n*\\t*' + req + '.headers\\s+'));
                for (let idxHeader = 0; idxHeader < elems.length - 1; ++idxHeader) {
                    let header = elems[idxHeader];

                    if (header.split(new RegExp('\\:\\s*\\n*\\t*\\{')).length > 1) {
                        let subObjs = header.split(new RegExp('\\:\\s*\\n*\\t*\\{'));
                        for (let idxObj = 1; idxObj < subObjs.length; ++idxObj) {
                            subObjs[idxObj] = subObjs[idxObj].split('}')[1];
                        }
                        header = subObjs.join('');
                    }

                    header = header.split('{').slice(-1)[0];
                    header = header.split(',');
                    header
                        .filter(e => e)
                        .map(name => {
                            name = name.trim();
                            name = name.replaceAll('...', '');
                            name = name
                                .split(/\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n| /)[0]
                                .replaceAll(' ', '')
                                .replaceAll('\r', '');
                            if (name && name.slice(-1)[0] == '(') {
                                return;
                            }
                            if (name == '') {
                                return;
                            }

                            if (!!objParameters[name] === false || (objParameters[name] && objParameters[name].name !== name) || (objParameters[name] && objParameters[name].name === name && objParameters[name].in !== 'header')) {
                                name += `__[__[__header__]__]`;

                                if (!!objParameters[name] === false) {
                                    // Checks if the parameter name already exists
                                    objParameters[name] = {
                                        name,
                                        in: 'header'
                                    };
                                }
                                if (!objParameters[name].in) {
                                    objParameters[name].in = 'header';
                                }
                                if (!objParameters[name].type && !objParameters[name].schema) {
                                    // by default: 'type' is 'string' when 'schema' is missing
                                    if (swaggerTags.getOpenAPI()) {
                                        objParameters[name].schema = { type: 'string' };
                                    } else {
                                        objParameters[name].type = 'string';
                                    }
                                }
                            }
                        });
                }
            }

            /**
             * Headers
             * E.g: let someHeader = req.headers['x-token']
             */
            if (autoHeaders && req && elem && elem.split(' ' + req + '.headers[').length > 1) {
                let elems = elem.split(' ' + req + '.headers[');
                for (let idxHeader = 1; idxHeader < elems.length; ++idxHeader) {
                    let header = elems[idxHeader];
                    if (header.split(statics.STRING_QUOTE).length > 2) {
                        let name = header.split(statics.STRING_QUOTE)[1];
                        name = name.trim();
                        name = name.replaceAll('...', '');
                        name = name
                            .split(/\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n| /)[0]
                            .replaceAll(' ', '')
                            .replaceAll('\r', '');
                        if (name && name.slice(-1)[0] == '(') {
                            return;
                        }
                        if (name == '') {
                            break;
                        }

                        if (!!objParameters[name] === false || (objParameters[name] && objParameters[name].name !== name) || (objParameters[name] && objParameters[name].name === name && objParameters[name].in !== 'header')) {
                            name += `__[__[__header__]__]`;

                            if (!!objParameters[name] === false) {
                                // Checks if the parameter name already exists
                                objParameters[name] = {
                                    name,
                                    in: 'header'
                                };
                            }
                            if (!objParameters[name].in) {
                                objParameters[name].in = 'header';
                            }
                            if (!objParameters[name].type && !objParameters[name].schema) {
                                // by default: 'type' is 'string' when 'schema' is missing
                                if (swaggerTags.getOpenAPI()) {
                                    objParameters[name].schema = { type: 'string' };
                                } else {
                                    objParameters[name].type = 'string';
                                }
                            }
                        }
                    }
                }
            }

            /**
             * query
             */
            if (autoQuery && req && elem && elem.split(' ' + req + '.query.').length > 1) {
                elem.split(' ' + req + '.query.')
                    .splice(1)
                    .filter(e => e)
                    .forEach(p => {
                        p = p.trim();
                        let name = p
                            .split(/\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n| /)[0]
                            .replaceAll(' ', '')
                            .replaceAll('\r', '');

                        if (name && name.includes('.')) {
                            name = name.split('.')[0];
                        }
                        if (name && name.slice(-1)[0] == '(') {
                            return;
                        }

                        name = name.replaceAll('...', '');

                        if (!!objParameters[name] === false || (objParameters[name] && objParameters[name].name !== name) || (objParameters[name] && objParameters[name].name === name && objParameters[name].in !== 'query')) {
                            name += `__[__[__query__]__]`;

                            if (!!objParameters[name] === false) {
                                // Checks if the parameter name already exists
                                objParameters[name] = {
                                    name,
                                    in: 'query'
                                };
                            }
                            if (!objParameters[name].in) {
                                objParameters[name].in = 'query';
                            }
                            if (!objParameters[name].type && !objParameters[name].schema) {
                                // by default: 'type' is 'string' when 'schema' is missing
                                if (swaggerTags.getOpenAPI()) {
                                    objParameters[name].schema = { type: 'string' };
                                } else {
                                    objParameters[name].type = 'string';
                                }
                            }
                        }
                    });
            }

            /**
             * Pull Request (#30)
             * CASE: Destructuring in body, such as: {a, b} = req.query
             * Created by: WHL
             * Modified by: Davi Baltar
             */
            if (autoQuery && req && elem && elem.split(new RegExp('\\}\\s*\\n*\\t*\\=\\s*\\n*\\t*' + req + '.query\\s+')).length > 1) {
                let elems = elem.split(new RegExp('\\}\\s*\\n*\\t*\\=\\s*\\n*\\t*' + req + '.query\\s+'));
                for (let idxQuery = 0; idxQuery < elems.length - 1; ++idxQuery) {
                    let query = elems[idxQuery];

                    /**
                     * CASE: const { item1, item2: { subItem1, subItem2 } } = req.query;
                     * Solution: Eliminate sub-items for now
                     * TODO: In the furute, handle sub-items
                     */
                    if (query.split(new RegExp('\\:\\s*\\n*\\t*\\{')).length > 1) {
                        let subObjs = query.split(new RegExp('\\:\\s*\\n*\\t*\\{'));
                        for (let idxObj = 1; idxObj < subObjs.length; ++idxObj) {
                            subObjs[idxObj] = subObjs[idxObj].split('}')[1];
                        }
                        query = subObjs.join('');
                    }
                    /* END CASE */

                    query = query.split('{').slice(-1)[0];
                    query = query.split(',');
                    query
                        .filter(e => e)
                        .map(name => {
                            name = name.trim();
                            name = name.replaceAll('...', '');
                            name = name
                                .split(/\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n| /)[0]
                                .replaceAll(' ', '')
                                .replaceAll('\r', '');
                            if (name && name.slice(-1)[0] == '(') {
                                return;
                            }
                            if (name == '') {
                                return;
                            }

                            if (!!objParameters[name] === false || (objParameters[name] && objParameters[name].name !== name) || (objParameters[name] && objParameters[name].name === name && objParameters[name].in !== 'query')) {
                                name += `__[__[__query__]__]`;

                                if (!!objParameters[name] === false) {
                                    // Checks if the parameter name already exists
                                    objParameters[name] = {
                                        name,
                                        in: 'query'
                                    };
                                }
                                if (!objParameters[name].in) {
                                    objParameters[name].in = 'query';
                                }
                                if (!objParameters[name].type && !objParameters[name].schema) {
                                    // by default: 'type' is 'string' when 'schema' is missing
                                    if (swaggerTags.getOpenAPI()) {
                                        objParameters[name].schema = { type: 'string' };
                                    } else {
                                        objParameters[name].type = 'string';
                                    }
                                }
                            }
                        });
                }
            }

            /**
             * Pull Request (#30)
             * CASE: Recognize body parameters
             * Created by: WHL
             * Modified by: Davi Baltar
             */
            if (autoBody && req && elem && elem.split(' ' + req + '.body.').length > 1) {
                elem.split(' ' + req + '.body.')
                    .splice(1)
                    .filter(e => e)
                    .forEach(p => {
                        p = p.trim();
                        let name = p
                            .split(/\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n| /)[0]
                            .replaceAll(' ', '')
                            .replaceAll('\r', '');

                        if (name && name.includes('.')) {
                            name = name.split('.')[0];
                        }
                        if (name && name.slice(-1)[0] == '(') {
                            return;
                        }

                        name = name.replaceAll('...', '');

                        if (!!objParameters['__obj__in__body__'] === false) {
                            objParameters['__obj__in__body__'] = {
                                name: '__obj__in__body__',
                                in: 'body',
                                schema: {
                                    type: 'object',
                                    properties: {}
                                }
                            };
                        }
                        if (!!objParameters['__obj__in__body__'] === true) {
                            // Checks if the parameter name already exists
                            objParameters['__obj__in__body__'].schema.properties[name] = {
                                example: 'any'
                            };
                        }
                    });
            }

            /**
             * Pull Request (#30)
             * CASE: Destructuring in body, such as: {a, b} = req.body
             * Created by: WHL
             * Modified by: Davi Baltar
             */
            if (autoBody && req && elem && elem.split(new RegExp('\\}\\s*\\n*\\t*\\=\\s*\\n*\\t*' + req + '.body\\s+')).length > 1) {
                let elems = elem.split(new RegExp('\\}\\s*\\n*\\t*\\=\\s*\\n*\\t*' + req + '.body\\s+'));
                for (let idxBody = 0; idxBody < elems.length - 1; ++idxBody) {
                    let objBody = elems[idxBody];

                    /**
                     * CASE: const { item1, item2: { subItem1, subItem2 } } = req.body;
                     * Solution: Eliminate sub-items for now
                     * TODO: In the future, handle sub-items
                     */
                    if (objBody.split(new RegExp('\\:\\s*\\n*\\t*\\{')).length > 1) {
                        let subObjs = objBody.split(new RegExp('\\:\\s*\\n*\\t*\\{'));
                        for (let idxObj = 1; idxObj < subObjs.length; ++idxObj) {
                            subObjs[idxObj] = subObjs[idxObj].split('}')[1];
                        }
                        objBody = subObjs.join('');
                    }
                    /* END CASE */

                    objBody = objBody.split('{').slice(-1)[0];
                    objBody = objBody.split(',');
                    objBody
                        .filter(e => e)
                        .map(name => {
                            name = name.trim();
                            name = name.replaceAll('...', '');
                            name = name
                                .split(/\)|\{|\}|\[|\]|\/|\\|;|:|!|@|\$|#|=|\?|\+|,|\||&|\t|\n| /)[0]
                                .replaceAll(' ', '')
                                .replaceAll('\r', '');
                            if (name && name.slice(-1)[0] == '(') {
                                return;
                            }
                            if (name == '') {
                                return;
                            }

                            if (!!objParameters['__obj__in__body__'] === false) {
                                objParameters['__obj__in__body__'] = {
                                    name: '__obj__in__body__',
                                    in: 'body',
                                    schema: {
                                        type: 'object',
                                        properties: {}
                                    }
                                };
                            }
                            if (!!objParameters['__obj__in__body__'] === true) {
                                // Checks if the parameter name already exists
                                objParameters['__obj__in__body__'].schema.properties[name] = {
                                    example: 'any'
                                };
                            }
                        });
                }
            }
        }
        return objParameters;
    } catch (err) {
        return origObjParameters;
    }
}
Recognize header, query and body content automatically.
@param {string} elem content.
@param {array} request array containing variables of response.
@param {object} objParameters